DBSCAN: Optimal Rates For Density Based Clustering

We study the problem of optimal estimation of the density cluster tree under various assumptions on the underlying density. Building up from the seminal work of Chaudhuri et al. [2014], we formulate a new notion of clustering consistency which is better suited to smooth densities, and derive minimax rates of consistency for cluster tree estimation for Holder smooth densities of arbitrary degree \alpha. We present a computationally efficient, rate optimal cluster tree estimator based on a straightforward extension of the popular density-based clustering algorithm DBSCAN by Ester et al. [1996]. The procedure relies on a kernel density estimator with an appropriate choice of the kernel and bandwidth to produce a sequence of nested random geometric graphs whose connected components form a hierarchy of clusters. The resulting optimal rates for cluster tree estimation depend on the degree of smoothness of the underlying density and, interestingly, match minimax rates for density estimation under the supremum norm. Our results complement and extend the analysis of the DBSCAN algorithm in Sriperumbudur and Steinwart [2012]. Finally, we consider level set estimation and cluster consistency for densities with jump discontinuities, where the sizes of the jumps and the distance among clusters are allowed to vanish as the sample size increases. We demonstrate that our DBSCAN-based algorithm remains minimax rate optimal in this setting as well.

Introduction
Clustering is one of the most basic and fundamental tasks in statistics and machine learning, used ubiquitously and extensively in the exploration and analysis of data. The literature on this topic is vast, and practitioners have at their disposal a multitude of algorithms and heuristics to perform clustering on data of virtually all types. However, despite its importance and popularity, rigorous statistical theories for clustering, leading to inferential procedures with provable theoretical guarantees, have been traditionally lacking in the literature. As a result, the practice of clustering, a central tasks in the analysis and manipulation of data, still relies in many cases on methods and heuristics of unknown or even dubious scientific validity. One of the most striking instances of such a disconnect is the DBSCAN algorithm of Ester et al. [1996], an extremely popular and relatively efficient [see Gan andTao, 2015, Wang et al., 2015] clustering methodology whose statistical properties have been properly analyzed only very recently: see Sriperumbudur and Steinwart [2012], Jiang [2017a] and Steinwart et al. [2017].
In this paper, we provide a complementary and thorough study of DBSCAN, and show that this simple algorithm can deliver optimal statistical performance in density-based clustering. Densitybased clustering [see, e.g., Hartigan, 1981] provides a general and rigorous probabilistic framework in which the clustering task is well-defined and amenable to statistical analysis. Given a probability distribution P on R d with a corresponding continuous density p and a fixed threshold λ ≥ 0, the λclusters of p are the connected components of the upper λ-level set of p, the set {x ∈ R d : p(x) ≥ λ} of all points whose density values exceed the level λ. With this definition, clusters are the highdensity regions, subsets of the support of P with the largest probability content among all sets of the same volume.
As noted in Hartigan [1981], the hierarchy of inclusions of all clusters of p is a tree structure indexed by λ > 0, called the cluster tree of p. The chief goal of density clustering is to estimate the cluster tree of p, given an i.i.d. sequence {X i } n i=1 of points with common distribution P . A cluster tree estimator is also a tree structure, consisting of a hierarchy of nested subsets of the sample points, and typically relies on non-parametric estimators of p in order to determine which sample points belong to high-density regions of p. A cluster tree estimator is deemed accurate if, with high probability, the hierarchy of clusters it encodes is close to the hierarchy that would have been obtained should p be known.
Density-based clustering, an instance of hierarchical clustering, enjoys several advantages: (1) it imposes virtually no restrictions on the shape, size and number of clusters, at any level of the tree; (2) unlike flat (i.e. non-hierarchical) clustering, it does not require a pre-specified number of clusters as an input and in fact the number of clusters itself is a quantity that may change depending on the level of the tree; (3) it provides a multi-resolution representation of all the clustering features of p across all levels λ at the same time; (4) it allows for an efficient representation and storage of the entire tree of clusters with a compact data structure that can be easily accessed and queried, and (5) the main object of interest for inference, namely the cluster tree of p, is a well-defined quantity.
Despite the appealing properties of the density-based clustering framework, a rigorous quantification of the statistical performance of this type of algorithms has proved difficult. Previous results by Hartigan [1981] and then Penrose [1995] have demonstrated a weaker notion of consistency achieved by the popular single-linkage algorithm. More recently Chaudhuri et al. [2014] have developed a general framework for defining consistency of cluster tree estimators based on a separation criterion among clusters. The authors further demonstrated that two graph-based algorithms, both based on k-nearest neighbors graphs over the sample points, achieve such consistency and provided minimax optimal consistency rates with respect to the parameters specifying the amount of cluster separation. Such results hold with virtually no assumptions on the underlying density. However, because of this generality, these consistency rates do not directly reflect any degree of regularity or smoothness of the underlying density. In particular, it remains unclear whether cluster tree estimation would be easier with smoother densities.
In this paper we provide further contributions to the theory of density based clustering by deriving novel, nearly minimax-optimal rates for cluster tree estimation that depend explicitly on the smoothness of the underlying density function. Our results further confirm that the smoother the density the faster the rate of consistency for the cluster tree estimation problem, a finding that is consistent with analogous results about non-parametric density estimation. Interestingly, our rates match those for estimating smooth densities in the L ∞ norm. To the best of our knowledge, this finding and the implication that density based clustering is no easier -at least in our setting -than density estimation, has not been rigorously shown before. In order to account explicitly for the smoothness of the density, we have developed a new criterion for cluster consistency that is better suited for smooth densities. In terms of procedures, we consider cluster tree estimators that arise from applying a very simple generalization of the well-known DBSCAN algorithm and are computationally efficient. Furthermore, our DBSCAN-based estimator is minimax optimal over arbitrary smooth densities according to our notion of consistency under appropriate conditions.

Related work
The idea of using the probability density function in order to study clustering structure dates back to Hartigan [1981], who formalized the notion of clusters as the connected components of high density regions and of cluster tree. Much of the subsequent theoretical work focused on consistency for "flat" clustering at a fixed level, which effectively reduces to level set estimation. The literature on this topic is vast and offers a multitude of results covering different settings and metric for consistency. See, e.g., Penrose [1995] Polonik [1995], Tsybakov et al. [1997], Cuevas and Fraiman [1997], BaÍllo et al. [2000], Klemelä [2004], Willett and Nowak [2007], Singh et al. [2009], Rigollet and Vert [2009], Rinaldo and Wasserman [2010]. In contrast, there have been fewer contributions to the theory of practice of cluster tree estimation: see, e.g., Stuetzle [2003], Stuetzle and Nugent [2010], Klemelä [2009] and Rinaldo et al. [2012]. The work of Chaudhuri et al. [2014] (see also Kpotufe and Luxburg [2011]) represented a significant advance in the theory of density-based clustering, as it derived a new framework and consistency rates for cluster tree estimation. Balakrishnan et al. [2012] generalized these results to the probability distributions supported over well-behaved manifolds, with consistency rates depending on the reach of the manifold and its intrinsic dimension. Corresponding guarantees in Hausdorff distance have been recently obtained by Jiang [2017a]. Eldridge et al. [2015] developed a unified theory for consistency in cluster tree estimation that encompasses the original framework of Hartigan while Kim et al. [2016] investigated the challenging problems of defining adequate metrics over the space of cluster tree and of constructing confidence sets for cluster tree structures.  provides bootstrap-based methods for constructing confidence sets for density level sets and for visualization of high-density clusters. Recently, Jang and Jiang [2018] proposed a variant of the DBSCAN algorithm with both minimax clustering rate and sub-quadratic computational complexity while Jiang et al. [2019] studied DBSCAN under possibly adversarial contamination of the input data.
In a parallel and important line of work, Steinwart [2011,2015] developed a rigorous, measuretheoretic approach to density-based clustering whereby the cluster tree is recovered by estimating the lowest split level of the density and then proceeding recursively. The corresponding results demonstrate a direct link between density based clustering and optimal level set estimation. This approach was applied in Sriperumbudur and Steinwart [2012] to show that the DBSCAN algorithm yield consistent estimator of density trees, a result that was then extended in Steinwart et al. [2017] to allow for more general, KDE-based procedures. Our work built directly upon the contributions of Chaudhuri et al. [2014] and Steinwart [2015].

Organization of the paper
The rest of the paper is organized as follows. In Section 3, we describe the DBSCAN algorithm and establish its connections with non-parametric density estimation. In Section 4 we introduce a new notion of cluster consistency, called δ-consistency that is tailored to Hölder-continuous densities. We describe a DBSCAN-based algorithm for clustered tree estimation that is computational efficient and delivers nearly optimal minimax rates that depend explicitly on the degree of smoothness of the underlying density, whereby cluster tree of smoother densities can be estimated at faster rates. Interestingly and, perhaps surprisingly, for the class of DBSCAN-based algorithms we consider, we observe a trade-off between statistical optimality and computational cost for smoother Hölder densities of degree α > 1. In these situations, minimax rates can still be achieved by our computationally efficient algorithm provided that the underlying density satisfies additional geometric regularity conditions around the split levels. Such conditions are relatively mild and have been exploited before; see in particular Steinwart [2015]. Finally, in Section 5 we consider a different scenario in which the underlying density exhibits jump discontinuities. We are particularly interested in level set and cluster estimation at the jump, with the assumption that the size of the discontinuity is vanishing when n → ∞ so that clustering becomes increasingly difficult. We show that, with suitable inputs, the DBSCAN algorithm returns a Devroye-Wise type of estimator which is minimax optimal for cluster recovery and level set estimation. In addition, we derive the minimax scaling for the size of the jump discontinuity.

Notation
We denote with p a density for the distribution P of the i.
For a constant λ > 0, we set L(λ) = {p ≥ λ} to be the λ-upper upper level set of the density p. We use T p to denote the cluster tree generated by the density p and T to density any estimator of T p . We use subscript n to emphasize any global variable which may change with respect to n. L represents the Lebesgue measure in R d and B(x, r) the closed d dimensional Euclidean ball centered at x with radius r and V d = L(B(0, 1)) the volume of the unit ball B(0, 1). For a vector x we denote with x and x ∞ its Euclidean and L ∞ norms, respectively. With a slight abuse of notation, if f is a real valued function defined over a subset S of R d , we let f ∞ = sup x∈S |f (x)| its L ∞ norm. For any h > 0 and a measurable set A ⊂ R d we set For any two real sequences {a n } ∞ n=1 and {b n } ∞ n=1 we write a n = O(b n ) if there exists C > 0 such that lim sup n→∞ |a n /b n | < C and write a n = Θ(b n ) if a n = O(b n ) and b n = O(a n ). For any two closed subsets A and B of R n , we use d(A, B) = inf x∈A,y∈B x − y to represent the ordinary distance between them.

Cluster Trees Estimation
Let P be a probability distribution with a continuous 1 Lebesgue density p and with support Ω ⊂ R d . For any λ ≥ 0, let {x ∈ Ω : p(x) ≥ λ} be the λ-upper level set of p and the λ-cluster of p are the connected components of L(λ). See Appendix A for definition of connectedness. Notice that the set of all clusters is an indexed collection of subsets of Ω, whereby each cluster of p is assigned the index λ associated to the corresponding super-level set L(λ), and that many clusters may be indexed by the same level λ. The cluster tree of p is the collection T p of all clusters of p, that is We can think of the cluster tree of p as the function defined on [0, ∞) and for each λ ≥ 0, it returns the set of λ-clusters of p. Thus, T p (λ) consists of disjoint connected subsets of Ω. We remark that, since the density p is unique only up to sets of Lebesgue measure zero, the cluster tree T p is also not unique. In fact, Steinwart [2015] shows that there exists a well-defined notion of cluster tree for the distribution P that is independent of the choice of the density. Furthermore, if P admits an upper semi-continuous density p, then the cluster tree is in fact composed of the hierarchy of the (closures of the) upper level sets of such density. As P is assumed, throughout most of the article, to have a density that is continuous everywhere on its support, when we speak of "the" density of P , we will refer to this canonical choice.
The concept of cluster tree owes its name to the easily verifiable property (see Hartigan [1981]) that if A and B are elements of T p , i.e. distinct clusters of p, then A ∩ B = ∅ or A ⊆ B or B ⊆ A. This induces a partial order on the set of clusters. In particular, for any λ 1 ≥ λ 2 ≥ 0, if A ∈ T p (λ 1 ) and B ∈ T p (λ 2 ) then either A ∩ B = ∅ or B ⊆ A. As a result, T p can be represented as a dendrogram with height indexed by λ ≥ 0. We refer to Kim et al. [2016] for a formal definition of the dendrogram encoding a cluster tree.
Let {X i } n i=1 be i.i.d. samples from P . In order to estimate the cluster tree of p we will consider tree-valued estimators, defined below.
Definition 1. A cluster tree estimator of T p is a collection T n of subsets of {X i } n i=1 indexed by [0, ∞) such that • for each λ ≥ 0, T n (λ) consists of disjoint subsets of {X i } n i=1 (including, possibly the empty set), called clusters, and • T n satisfies the tree property: for any λ 1 ≥ λ 2 ≥ 0, if A ∈ T n (λ 1 ) and B ∈ T n (λ 2 ) then either It is important to realize that, while the cluster tree T p is a collection of connected subsets of the support of p, the cluster tree estimators considered in this paper are collections of subsets of the sample points.
In order to quantify how well a cluster-tree estimator approximates the true cluster tree, we will make use of the notion of cluster tree consistency put forward by Chaudhuri et al. [2014].
In detail, let A n denote a collection of connected subsets of the support of p, which may depend on n. A cluster tree estimator T n is consistent with respect to A n if, with probability tending to 1 as n → ∞, the following holds simultaneously over all A and A in A n : the smallest clusters in The requirement for consistency outlined above is rather natural: if a cluster tree is deemed consistent with respect to the sequence A n , then it should, with probability tending to 1, cluster the sample points perfectly well, as if we had the ability of verifying, for each pair of sample points X i and X j and each connected set A ∈ A n , whether both X i and X j are in A.
We allow A n to grow larger and more complex with n, so that the cluster tree estimator will be able to discriminate among clusters of p that are barely distinguishable given the size of the sample.
An example of a sequence {A n } ∞ n=1 is the set of δ n -separated clusters according to Definition 2, where the parameter δ n is taken to be vanishing as n → ∞. The sequence of target subsets {A n } ∞ n=1 may not be chosen to be too large: for example if A n equals to the set of all clusters of p, then, depending on the complexity of p, no cluster tree estimator need to be consistent. A natural way to define {A n } ∞ n=1 is by specifying a separation criterion for sets, which may become less strict as n grows, and then populate each A n using only the connected subsets of the support of p fulfilling such a criterion. In particular, Chaudhuri et al. [2014] develop a criterion known as the ( , σ)-separation, which requires two connected subsets A and A to be far apart from each other in terms of their "horizontal" distance d(A, B) and their "vertical" distance, in the sense that the smallest cluster containing both A and B should belong to a level set of p indexed by a value of λ significantly smaller to the values indexing the level sets of A and B. See Definition 10 below for details. One of the main contributions of this paper is to replace this rather general notion of separation by a simpler one, the δ-separation criterion in Definition 2, which is better suited deal with smooth densities. This allows us to derive new rates of consistency that depend explicitly on the smoothness of the density.
As explained in Eldridge et al. [2015], the cluster tree consistency guarantees based on separation criteria can be fairy coarse, as they only require T n to preserve the connectivity of all the sets in A n . In particular, a tree estimator that is consistent with respect to such definition needs not yield a good clustering of the sample points. Concretely, T n might have additional unwanted clusters, referred to as false in Chaudhuri et al. [2014], that do not correspond to any disjoints sets in A n , a phenomenon referred to as over-segmentation by Eldridge et al. [2015]. Similarly, T n might not conform to the partial order of inclusions among the clusters of p, an issue called improper nesting. In fact, the estimators developed in this paper do not suffer from such shortcomings and are consistent in the merge distortion metric of Eldridge et al. [2015], a more refined stronger notion of consistency for cluster trees. See Sections 4.6 and 6 below.

The DBSCAN Algorithm
The DBSCAN algorithm, first introduced in Ester et al. [1996], is an extremely popular methodology for "flat" clustering. In this section we introduce a simple generalization of DBSCAN, shown below in Algorithm 1, that yields cluster tree estimators and establish its connections with kernel density estimation.
For a fixed value of k, Algorithm 1 is in fact a simplified version of the original DBSCAN procedure of Ester et al. [1996], where the parameters h and k are called instead Eps and MinPts, respectively. Notice that, unlike in the original formulation of DBSCAN, we do not distinguish between core and border points and, furthermore, we evaluate connectivity among the sample points using balls of radius 2h instead of h. Such modifications have no impact on the rates of consistency we obtain but simplify the derivations.
Assuming h > 0 fixed, by sweeping through all the possible values of k, Algorithm 1 produces a sequence of nested geometric graphs T n = {C(h, k)} k∈N . It is immediate to see that T n forms a cluster tree estimator over the sample points {X i } n i=1 ; see Definition 1. This is because, for each k 1 ≤ k 2 , In practice, Algorithm 1 can be efficiently implemented using a union-find structure in such a way that the set C(h, k) of the maximal connected components of G h,k can be computed without using the potentially expensive breadth-first search or depth-first search algorithms. The resulting cluster tree algorithm is simpler than the estimator based on Wishart's algorithm proposed in Chaudhuri et al. [2014]. Indeed, the DBSCAN-based estimator is obtained from a sequence of nodeinduced sub-graphs of the 2h-neighborhood graph over the sample points. In contrast, Wishart's algorithm entails taking node and edge-induced sub-graphs of the k-nearest neighborhood graph over {X 1 , . . . , X n }, which has higher computational complexity.
As explained in Sriperumbudur and Steinwart [2012], DBSCAN is implicitly using a kernel density estimator with kernel corresponding to the indicator function of the unit d-dimensional Euclidean ball to cluster the points. In detail, consider the density estimator p h given by where It is easy to see that p h is a Lebesgue density, i.e. p h (x) is a measurable, non-negative function and For any λ ≥ 0, set Then, setting, for k > 0, , one can see that, for clustering purpose, C(h, k) and L(λ k ) convey the same information. Indeed from the definition of L(λ k ), it is straightforward to see that Lemma 1. Two data points X i and X j are in the same connected component of the d-dimensional set L(λ k ) if and only if they are in the same connected component of the graph C(h, k).
The union of balls L(λ) is a renown estimator in the literature on level set estimation, originally studied in Devroye and Wise [1980] (see also Cuevas and Rodríguez-Casal [2004]). In particular, with a suitable choice of the bandwidth parameter h and as n grows unbounded, L(λ) is a rateoptimal estimator of the level set L(λ) under various loss functions and appropriate assumptions on the underlying density.

Clustering Consistency for Hölder Continuous Densities
In this section we show that the DBSCAN algorithm 1 is consistent under Hölder smooth densities. Towards that end, we introduce a new notion of cluster tree consistency, called δ-consistency (see Section 4.2 below), which is well-suited to study cluster trees generated by smooth densities. We will show that DBSCAN, with suitable inputs, will return cluster tree estimators that nearly attain the corresponding minimax optimal rates and that those rates depend on the degree of smoothness of the density.

Hölder smooth densities
Below we give a recap of well-known results on non-parametric density estimation. Given vectors s = (s 1 , . . . , s d ) in N d and x = (x 1 , . . . , x d ) in R d , set |s| = s 1 + · · · + s d and x s = x s 1 1 . . . x s d d , and let D s = ∂ s 1 +···+s d ∂x s 1 1 . . . ∂x s d d denote the differential operator. A function p : R d → R is said to belong the Hölder class Σ(L, α) with parameters α > 0 and L > 0 if p is α -times continuously differentiable and, for all x, y ∈ R d and all s ∈ N d with |s| = α , Notice that, when 0 < α ≤ 1, the Hölder condition reduces to the Lipschitz condition Let p h denote a kernel density estimator with bandwidth h and kernel K, that is Then, we obtain the standard bias-variance decomposition for the KDEs, namely In order to control the stochastic component p h − p h ∞ we will invoke well-known concentration bounds from density estimation to conclude that, under appropriate and very mild assumptions on K, there exists a constant C 1 > 0, depending on p ∞ , d and K, such that, for any γ > 0 and all n large enough and assuming nh d ≥ 1, where a n = C 1 (γ + log(1/h)) nh d .
The verification of this bound can be found in many places in the literature; see, e.g., Giné and Guillou [2002], Sriperumbudur and Steinwart [2012], Jiang [2017b] and Kim et al. [2019]. See Appendix B for details. As for the bias term p h − p ∞ , if K is chosen to be a α-valid kernel 2 (see, e.g., Rigollet and Vert [2009]), then standard calculations yield that for an appropriate constant C 2 > 0 depending on L and α. In particular, since this type of kernels are polynomials supported on [0, 1] d , they automatically satisfy the VC condition [see lemma 22 of Nolan and Pollard, 1987, for a justification]. Thus combining the bias in (6) and the variance in (8), we conclude that, with probability at least 1 − e −γ , with γ any positive number, Setting, e.g., γ = log n, the optimal choice of the bandwidth is leading to the final rate of log n n α 2α+d , which is in fact minimax optimal.

The δ-Separation Criterion
We now formulate a notion of cluster separation that is naturally suited to smooth densities and, for continuous densities is equivalent to separation in the merge distance of Eldridge et al. [2015] [see also Kim et al., 2016].
Definition 2. Let A and A be subsets the support of the density p and set λ := inf x∈A∪A p(x). For δ ∈ (0, λ), A and A are said to be δ-separated if they belong to distinct connected components of the level set {x : p(x) > λ − δ}.
Unlike the separation criterion of Chaudhuri et al. [2014], which requires the specification of two parameters quantifying the horizontal and vertical displacement between clusters, δ-separation only uses one parameter The intuition behind the notion of δ-separation is simple: due to the smoothness of the density, the degrees of "vertical" and "horizontal" separation between clusters are coupled. This is illustrated in Figure 1 and best explained for the case of a density in Σ(L, α) with α ≤ 1. If A and A are δ-separated, then their distance is at least δ L 1/α . As a result, the degree of separation between clusters of smooth densities can be described using only one parameter, a feature that we will exploit to derive new notion of consistency for clustering.
is (δ, γ)-accurate if, with probability no smaller than 1 − γ, for any pair of connected subsets A and A of the support that are δ-separated, exactly one of the following conditions holds:

the smallest clusters in the cluster tree estimator containing
Let {δ n } n be a vanishing sequence of positive numbers and a {γ n } a vanishing sequence in (0, 1). We say that the sequence of cluster tree estimators {T n } n , where T n is based on an i.i.d. sample , is δ-consistent with rate δ n if, for all n large enough, T n is (δ n , γ n )-accurate where γ n decays polynomially in n.
It is important to realize that the notion of δ-consistency is a uniform notion of consistency that is required to hold simultaneously over all possibly pairs of δ-separated connected subsets of the support.
The δ-separation criterion is closely related to the concept of the merge height introduced by Eldridge et al. [2015]. In the context of hierarchical clustering, the merge height is used to describe the height at which two points or two clusters merge into one cluster; see Definition 9. In particular we show below in Lemma 4 that if two subsets A and A of the support are δ-separated and inf x∈A∪A p(x) = λ, then their merge height is no larger than λ − δ. To further emphasize how similar the two approaches are, we mention that our results about cluster consistency still hold for a slightly stronger notion of cluster consistency, whereby condition 2 in Definition 3 is replaced by the condition are contained in two different λ-clusters of the cluster tree estimator.
The key difference between δ-consistency and this stronger version of δ-consistency is that in the latter case we further constrain the split level for A and A in the cluster tree estimator to occur at a value less than inf x∈A∪A f (x) by an amount no larger than δ n . This is precisely what is required for merge distance consistency; see Eldridge et al. [2015]. We provide more detailed comparison in Section 6, where we further elucidate the differences between our notion of δ-separation and the ( , σ)-separation criterion of Chaudhuri et al. [2014].

The split levels
One of the most impoertant features of a cluster tree is the collections of levels λ at which the clusters split into two or more disjoint sub-clusters, which we refer to as split levels. Such levels belong to the well-known class of "critical levels" in differential topology, which identify critical changes in the topology of the upper level sets of p. See, for example, Hirsch [2012] for more details.
In particular, the estimation of split levels is a central theme in the contributions of Sriperumbudur and Steinwart [2012] and in Steinwart [2015]. Below, we provide a slightly different characterization of the split levels of continuous densities and relate it to the criterion of δ-separation of clusters. The notion of split levels will be important below in Section 4.4.2 in formalizing conditions under which computationally efficient and statistically optimal cluster tree estimation is feasible for Hölder densities with smoothness degree α > 1. It will also be used to demonstrate that we can easily remove false clusters from the cluster tree estimations returned by our algorithms (see Section 4.6).
Definition 4. Let p : R d → R be a continuous density function. For a fixed λ * > 0, let {C k } K k=1 be the connected components of {p ≥ λ * }. The value λ * is said to be a split level of p if there exists a C k such that C k ∩ {p > λ * } has two or more connected components.
The following simple result illustrates the main topological properties of split levels.
Proposition 1. Suppose that p : R d → R is compactly supported and that A and A are subsets of two distinct connected components of {p ≥ λ 1 }. If A and A belongs to the same connected components of {p ≥ λ 2 }, where λ 2 < λ 1 , then there is a unique split level λ * ∈ [λ 2 , λ 1 ) such that A and A belong to one connected component of {p ≥ λ * } and to distinct connected components of {p > λ * }.
Proposition 1 suggests that if two connected components merge into one as the density level λ decreases, then there exists one and only one split level at which the corresponding merge takes place. Therefore, the following definition, which characterizes the split level of any two distinct clusters in a cluster tree, seems natural.
Definition 5. Suppose A and A are two open subsets of the support of p. Then A and A are said to split at level λ * if A and A belong to one connected component of {p ≥ λ * } and to two distinct connected components of {p > λ * }.
In our next result we illustrate a direct link between the notion of split levels and the criterion of δ-separation introduced above. We will exploit this fact later in Section 4.6 to demonstrate how to prune the cluster tree estimators to yield accurate estimates of the split levels without producing false clusters.
Corollary 1. Let A and A be δ-separated. Then there exists a split level λ * of the density, with such that A and A belong to one connected component of {p ≥ λ * } and to two distinct connected components of {p > λ * }.

Rate of consistency for the DBSCAN algorithm
We are now ready to present the main results of the paper, and derive rates of consistency for DBSCAN-based cluster tree estimators with respect to the criterion of δ-separation and for Hölder smooth densities. Specifically, we will show that these estimators are δ-consistent with rate for an appropriate constant C that depends on p ∞ , L, K and α. The above rates depend on the smoothness of the underlying density, with smoother densities leading to faster rates, and, as shown in Section 4.5, are in fact minimax optimal. This is one of the main contributions of this article and delivers an extension of the cluster consistency results of Chaudhuri et al. [2014], which are agnostic to the smoothness of p.

Consistency for α ≤ 1
We first show that, when α ≤ 1, the DBSCAN algorithm is δ-consistent with rate of order (11). We remark that this type of result can be deduced from several contributions in the literature on density-based clustering, which show that variants of the DBSCAN algorithm lead to some form of cluster consistency when α ≤ 1. See, e.g., Rinaldo and Wasserman [2010], Sriperumbudur and Steinwart [2012], Jiang [2017a] and Steinwart et al. [2017]. We provide the details for completeness. In order to demonstrate that DBSCAN is δ-consistent, it will be sufficient to show that the procedure provides an approximation to the upper level sets of p h . This is done in the next result, which relies on general, well-known, finite sample concentration bounds for KDEs along with standard calculations for the bias of a KDE; see Lemma 6 and Proposition 7 in Appendix B.
Lemma 2. Assume that p ∈ Σ(L, α), where α ∈ (0, 1], and let K be the spherical kernel. Then, there exist constants C 2 , depending on C 1 , p ∞ , L and d such that, if h = C 1 n − 1 2α+d then uniformly over all λ > 0, with probability at least 1 − 1/n, As a direct corollary, we see that the DBSCAN algorithm, with an appropriate choice of the bandwidth h, outputs a δ-consistent cluster tree with consistency rates that depend on α. Corollary 2. Assume that p ∈ Σ(L, α), where α ∈ (0, 1], and let K be the spherical kernel. Then, there exist constants C 1 depending on p ∞ , L and d such that, if h = C 1 log(n) n 1 2α+d , the cluster tree returned by the DBSCAN Algorithm 1 is δ-consistent with rate δ n ≥ C log(n)

Consistency for α > 1
When α > 1, Algorithm 1 no longer delivers the optimal rate displayed in (11), for two reasons. The first reason stems from standard non-parametric density estimation considerations: when α > 1 it becomes necessary to rely on smoother kernels, namely α-valid kernels as indicated before. This will lead to a bias p − p h ∞ of the correct order O(h α ). The second reason is more subtle: the straightforward arguments we used to handle the case of α ≤ 1 do not lead to optimal clustering rates even if the kernel K is chosen to be α-valid. To exemplify, suppose we would like to cluster the sample points The computationally efficient linkage rule implemented by DBSCAN is to cluster the points based on the connected components of the union-of-balls around them, i.e based on the connected components of Assume now that the gradient of p has norm uniformly bounded by a constant D for all x ∈ L(λ). Then, max and, as a result, where C log(n) √ nh d + h α comes from the L ∞ error bound of α-valid kernels as in (9) and Dh is due to (13). As h → 0, the term Dh dominates the bias term Ch α , so that the optimal choice of h is of the order h log n n 1/(2+d) , which in turn yields a worse rate than (11) when α > 1. What is more, ∇p(X j ) > 0 for any X j away from the critical points of p. This would mean that (14) are tight, showing that the sub-optimal choice of h cannot be ruled out. We believe that this phenomenon is not specific to DBSCAN only, but applies more broadly to the the class of singlelinkage-type clustering algorithms. That is, it seems to us that such algorithms are in general unable, like our DBSCAN-based procedure in Algorithm 1, to take advantage of a higher degree of smoothness of the underlying density.
The issue outlined above can be handled in more than one way. A possible solution, which is nearly trivial but impractical, is to deploy a computationally inefficient algorithm that assumes the ability to evaluate the connected components of the upper level set of p h exactly: see Algorithm 3 in the appendix. It is immediate to see that this approach produces optimal δ-consistency; see Corollary 3 in Algorithm 3. Unfortunately, this procedure will require evaluating p h on a fine grid, which is computationally infeasible even in small dimensions. The second, more interesting and novel solution which we describe next, is to further assume that p satisfies additional mild regularity conditions around the split levels. The conditions are of geometric and analytic nature and are reminiscent of low-noise type assumptions in classification. Under these conditions, the modified DBSCAN Algorithm 2 will achieve the optimal rate (11) while remaining computationally efficient. This finding, stated formally in Theorem 1 below, is the main result of this section.

Algorithm 2 The modified DBSCAN
Remark 1. Despite its seemingly different form, Algorithm 2 is nearly identical to Algorithm 1. The only difference is the use of an α-valid kernel K instead of a spherical kernel. Furthermore, the procedures only require evaluating at most n + 1 different graphs: And, again just like with Algorithm 1, the connected components of each C(h, λ) can be easily evaluated by maintaining a union-find structure.
To formulate the the extra regularity conditions on the geometry of the density p ∈ Σ(α, L) around the split levels that guarantee optimality of the clustering Algorithm 2 we first recall some notions commonly used in the literature on level set and support estimation. Below, Ω denotes a generic subset of R d of dimension d.

C1. (The Inner Cone Condition)
The subset Ω satisfies the inner cone conditions if ihere exist constants r I , c I > 0 such that, for any 0 ≤ r ≤ r I and x ∈ Ω, where L denotes the Lebesgue measure of R d .

C2. (The Covering
Condition) The subset Ω satisfies the covering condition if there exists a constant C I such that, for any 0 < r ≤ r I , there exists a collection of points N r ⊂ Ω such that card(N r ) ≤ C I r −d and y∈Nr B(y, r) ⊃ Ω.
Both assumptions C1, C2 are rather mild. If Ω is a compact manifold of dimension b ≤ d with piecewise Lipschitz boundary, both assumptions are automatically verified with the dimension d replaced by the intrinsic dimension b. [see, e.g. Do Carmo, 1992]. The inner cone condition C1 is used in Korostelev and Tsybakov [1993] and is well-known as the standard condition [Cuevas, 2009] or, more recently, the (a, b) condition of [Chazal et al., 2015]. It is essentially equivalent to the level set regularity condition [B] in Singh et al. [2009]. The covering condition C2 holds automatically if Ω is compact. See, e.g., Rinaldo and Wasserman [2010] and Balakrishnan et al. [2012].
Since p ∈ Σ(L, α) with α > 1, any level set {p ≥ λ} is a union of connected d dimensional manifolds with C 1 boundary. Therefore it is natural to require both C1 and C2 to hold simultaneously for all the upper level-sets of p right above the split levels. Specifically, we will assume the following.
C. There exists a δ 0 > 0 such that, for any split level λ * of p and any 0 < δ ≤ δ 0 , the set {x : p(x) ≥ λ * + δ} satisfies conditions C1 and C2 with constants r I ,c I and C I only depending on p.
We also need the connected components of the upper level sets right above the split levels to satisfy a low-noise condition as follows.
S(α). There exist positive constants δ S and c S such that, for each split level λ * of the density p, the following holds. Let {C k } K k=1 be the connected components of {x : p(x) > λ * }. Then, Condition S(α) constrains the behavior of the density only around the split levels. It is a fairly common assumption in the literature: it coincides with the separation exponent condition of Steinwart [2015] (see Definition 4.2 therein), which quantifies the separation of distinct connected components right above the split levels. Furthermore, S(α) is implied by the local density regularity conditions of Singh et al. [2009], which in turn is used in Jiang [2017a] to define the β-regularity condition for cluster separation. Steinwart [2015] provides several specific examples of densities satisfying the S(α) condition. In fact, we prove that conditions C and S(α) are verified in a large non-parametric class of functions. This class consists of Morse density functions, which are widely used in the density based clustering and mode estimation and topological data analysis; see, e.g., Chacón et al. [2015], Arias-Castro et al. [2016] and references therein. We recall that a function p is Morse if all its critical points have a non-degenerate Hessian. An equivalent and more intuitive condition is that p behaves like a quadratic function around its critical points.
Proposition 2. Suppose p : R d → R is a Morse function. Then p satisfies C and S(2).
Another interesting class of density functions satisfying conditions C and S(α) can be obtained as follows. Let α ≥ 2 be any integer and f 1 : [0, 1] → R be such that f 1 (x) = (x − 2) α . Then, there exists a polynomial f 2 of degree α such that the function on R defined point-wise as has continuous derivatives up to order α − 1 and is such that It is easy to see that for any 0 < δ ≤ 1 As a result, conditions C and S(α) are trivially satisfied in this simple case.
Our main result of this section is to prove that that the conclusion of Corollary 2 still holds for α > 1, provided that the conditions C and S(α) are met.
Theorem 1. Let p ∈ Σ(α > 1, L) be any density function with compact and connected support and finitely many split levels. Suppose that conditions C and S(α) hold for p. If h log(n) n 1/ (2α+d) ), then, with probability at least 1 − 1 n − O(h −d exp(−cn α/(2α+d) )), the cluster tree returned by the modified DBSCAN Algorithm 2 is δ-consistent with rate where c is a constant that depends on p only, a n = C 1 (log n+log(1/h)) nh d + C 2 h α is the right hand side of the inequality in (9) and c S is defined in C.
The choice of the parameter h in Theorem 1 yields that Algorithm 2 is δ consistent with rate given by (11).

Lower bounds
Next, we show that the consistent rates of the DBSCAN algorithm derived in the previous sections are nearly minimax optimal, save for a log(n) term. We point out that the lower bound results by Chaudhuri et al. [2014] are not directly applicable to our problem, since they rely on discontinuous densities.
Theorem 2. Suppose d ≥ 1 and α > 0. There exists a finite family F of d-dimensional probability density functions belonging to the Hölder class Σ(L, α) satisfying the conditions C, S(α) and uniformly bounded from above by C 0 , and a constant K, depending on L and α, such that when where V d denote the volume of a d dimensional ball, the following holds. If cluster tree estimator is (δ n , 1/4)-accurate when presented with an i.i.d. sample from a density function in F, then it must be the case that for some constant C only depends on d.
Therefore, with the constant C 0 in the previous theorem and the dimension d fixed, the bounds obtained in Theorem 1 and Corollary 2 match the minimax bound in (16), up to a log(n) factor. Thus, together they show that, up to log factors, the optimal rate for δ-consistency of density functions in Σ(L, α) is of order log(n) n α/(2α+d) . Interestingly, the minimax clustering rates we derived match the rates for estimation of a Hölder density p under L ∞ norm; see Section 4.1. While this result may not be entirely surprising in light of the findings of, e.g., Eldridge et al. [2015] and Kim et al. [2016], such a a connection has never been formally established, to the best of our knowledge. In particular, our results seem to settle, at least for the class of Hölder-continuous densities and with respect to the criterion of δ-consistency, a long-standing open problem of how density-based clustering compares to density estimation: both problems exhibit the same degree of statistical difficulty.

Consistent Estimate of The Split Levels
In this section, we present a simple pruning strategy, leading to consistent estimators of the split levels of the the density. While pruning strategies and consistent estimation of split levels have been considered by several authors, such as Sriperumbudur and Steinwart [2012], Steinwart [2015], Chaudhuri et al. [2014] and Jiang [2017a], the existing results do not yield error bounds that depend on the degree of smoothness α for density p ∈ Σ(L, α) with α > 1.
The following definition provides a way to identify significant split levels in the cluster tree estimator returned by Algorithm 2.
Definition 6. Let ∆ > 0. The random variable λ * ∈ (0, ∞) is said to be a ∆-significant split level of the cluster tree estimator if there exist two data points X i , X j ∈ D( λ * + ∆) such that λ * = sup{λ > 0 : X i and X j are in the same connected component of C(h, λ).} Below, we show that there is a one to one correspondence between ∆-significant split levels of the modified DBSCAN cluster tree estimator from Algorithm 2 and the split levels of the population density under a slightly stronger covering condition than condition C given above. Specifically, we assume the following.
C'. There exists a constant δ 0 > 0 such that, for any split level λ * of p and any δ ∈ R with |δ| ≤ δ 0 , {p ≥ λ * + δ} satisfies conditions C1 and C2 with constants r I ,c I and C I only depending on p.
The only difference between C and C' is that while condition C assumes some regularity of p only above split levels, C' requires the same type of regularity around split levels.
Proposition 3. Suppose condition C' and S(α) hold. Let ∆ = 2a n + (4h/c S ) α where a n is defined in (9) and h = C 1 n −1/(2α+d) . Suppose p has finitely many split levels. Then, with probability at least 1 − 1/n − O(h −d exp(−cn α/(2α+d) )), the following additional results hold: 1. Let λ * be a split level of the density p. Suppose C and C are two open sets splitting at λ * (see Definition 5) and that Then, there exists a ∆-significant split level λ * of the cluster tree estimator returned by the modified DBSCAN such that |λ * − λ * | ≤ ∆.
2. Conversely, suppose that λ * is a ∆-significant split level of the cluster tree estimator. Then there exists a split level λ * of p such that Proposition 3 says that, with high probability, every ∆-split level corresponds to a density split level and that conversely, any split level of the density p can be found if we have enough data. To prune the cluster tree returned by the modified DBSCAN algorithm, it suffices to remove all the split levels that are not ∆ significant.

Densities with Gaps
We now consider the particular scenario where the density p exhibiting a jump discontinuity in such a way that, for all levels λ in a given interval of length , the upper level sets {x : p(x) ≥ λ} do not change. The value of is referred to as the gap size. We provide a formal definition next, which we formulate within the general measure-theoretic language of Steinwart [2015] since the underlying densities are not continuous. We recall that L denotes the Lebesgue measure on R d .
Definition 7 (Distribution with a gap). Let P a probability measure on R d , absolutely continuous with respect to the Lebesgue measure. For any λ * > 0, let S λ * be the support of the sub-probability measure where p is any density of P . Then, P is said to have a gap at λ * of size , where 0 < < λ * , if P (S λ * ) > 0 with L(∂S λ * ) = 0 and S λ * −η \S λ * = ∅, ∀η ∈ (0, ).
We impose the condition that L(∂S λ * ) = 0 in order to avoid pathological cases. The above definition is independent of the choice of the density of P . At the same time, it also implies that P admits a Lebesgue density p such that Here, given any set A, cl(A) denotes the closure of A. Indeed, it is not hard to see that, if p is any Lebesgue density of P , then the function is also a density of P , and satisfies (22). Thus, with a slight abuse of notation, we may also speak of "the" density p even in this case, with the understanding that we are referring to any density of P for which (22) holds. See Figure 2 for an illustration. Figure 2: The left plot depicts a one dimensional density with gap of size at level λ. It is clear that {λ < p ≤ λ + } is an empty set. The right plot depicts 500 i.i.d sampling from a two dimensional density with a gap. It is clear that the density is low in the background and high in the disk centered at (-1,-1) and in the square centered at (1,1). Finding the samples points with low density values can be thought of as outliers detection in this case.
Though fairly restrictive, the scenario of a distribution with a gap is quite interesting for the purpose of both clustering and level set estimation. Indeed, this situation encompasses the ideal clustering scenario, depicted as examples in Figures 1 and 5 in the original DBSCAN paper Ester et al. [1996], of a piece-wise constant density that is low everywhere on its support with the exception of a few connected, full-dimensional regions, or clusters, where it is higher by a certain amount (in our case the gap ). The size of the gap parameter and the minimal distance among clusters both affect the difficulty of the clustering task, which becomes harder as the parameters get smaller.
To formally capture the dependence on the distance between clusters we set where (C 1 , . . . , C I ) are disjoint, connected, (necessarily) closed sets of positive P measure and let be the minimal distance between them. The separation parameter σ captures an aspect of the intrinsic difficulty of the clustering task that is complementary to the one quantified by gap parameter : clusters that are at a small distance σ from each other are hard to separate, for any given value of . In our analysis, we let both the gap parameter and the separation parameter σ vary with n (though we do not make this dependence in out notation for ease of readability), thus allowing for harder clustering problems as a function of the sample size.
In the next simple result, we show that a flat version of the vanilla DBSCAN algorithm given in Algorithm 1, with suitable choices for the input parameters, can optimally estimate the clusters at λ * at a rate that depend explicitly on both and σ.
Proposition 4. Let {X 1 , . . . , X n } be an i.i.d. sample from a probability distribution P that has a gap of size at level λ * . Set a n = C 1 log(n)+log(1/h) nh d as in (7) and suppose the input parameters h and k of the DBSCAN algorithm are such that for any C > 0 such that 2a n < and any λ in (λ * − + a n , λ * − a n ]. Then with probability at least 1 − 1/n: i. simultaneously over all connected sets A such that A 2h ⊂ C i , for some i, all the sample points in A, if any, belong to the same connected component of G k,h ; ii. simultaneously over all connected sets A and A such that A 2h ⊂ C i and A 2h ⊂ C j , for some i = j, the sample points in A and A , if any, belong to distinct connected components of G k,h . The definition of A 2h and A −2h can be found in (1). Notice that the above results hold true for all n large enough such that a n < /2. Proposition 4 implies the DBSCAN algorithm will yield clustering consistency, in the sense of Chaudhuri et al. [2014], provided that its input parameters fulfill (24) holds. In particular, this result requires that the sample size relates to the gap parameter and the separation parameter σ according to the inequality for some constant C, depending on d. In fact, such scaling is nearly minimax optimal: no other clustering algorithms can guarantee cluster consistency under the same assumptions and with a better sample complexity as a function of both and σ. This results follows from the lower bound guarantee given in Theorem VI.1 of Chaudhuri et al. [2014], where we take notice that the parameters σ and have different, though related, meaning; see Appendix C.4. In fact, the results in Proposition 4 can be further extended to hold over more general settings of arbitrary densities; see Appendix D.
We conclude by noting that the gap size and the separation parameters σ quantify two very separate notions of intrinsic difficulty of clustering that are unrelated to each other, and the clustering problem becomes impossible whenever either one of them becomes so small to violate the lower bound (53), regardless of the other. In particular, it is easy to give examples in which the clustering task is impossible to solve because is too small even if σ is large, and the other way around. As a result, the overall hardness of the clustering problem around the gap is a combination of these two parameters. This is in contrast with the settings considered earlier, where, due to the smoothness of the underlying density, only one parameter is sufficient to capture separation among clusters.

The Devroye-Wise estimator of the Level Sets
The assumption of a density with gap allows us to carry out a further analysis of the DBSCAN algorithm, showing that it is also minimax optimal for estimating the level set itself S λ * . For this purpose, the DBSCAN algorithm reduces to the renown Devroye-Wise estimator: see Devroye and Wise [1980]. Below we provide a novel, sharper analysis of this estimator, where we allow the size of the gap to decrease with n, and demonstrate that its rate-optimal (again, we will not explicitly express this dependence in our notation for simplicity). To the best of our knowledge, such scaling has not been previously established.
Recall that the DBSCAN algorithm with inputs k and h outputs a set of nodes G h,k . One then may construct the estimator comprised of a union of balls around such points, and use it as an estimator of the corresponding high density region S = S λ * = ∪ I i=1 C i consisting of all the clusters. We measure the performance of any estimator S with the Lebesgue measure of its symmetric difference with S: We will in addition impose the following condition: R. (Level set regularity). There exists constants h 0 > 0 and C 0 > 0 such that, for all h ∈ (0, h 0 ), where S h and S −h are defined in (1). Condition R is very mild. Indeed, if ∂S is C 2 , then the set N h := S h \S −h is the tubular neighborhood [see, e.g. Hirsch, 2012] of ∂S in R d . In particular, every compact domain in R d with C 2 boundary satisfies condition R. In this case C 0 V d−1 |∂S|, where |∂S| denotes the surface volume of S. We also note that R is equivalent to the "smooth boundary" condition in Steinwart [2015].
Proposition 5. Let {X 1 , . . . , X n } be an i.i.d. sample from a probability distribution P that has a gap of size at level λ * . Let a n = C log(n)+log(1/h) nh d be defined as in (7). Suppose the input parameters (h, k) of the DBSCAN algorithm satisfy for any C > 0 such that 2a n < and any λ in (λ * − + a n , λ * − a n ]. Then with probability at least 1 − 1/n, Similarly to Proposition 4, the above results hold true for all n large enough such that a n < /2. If P (X ∈ S) = 1, the level set estimator S h is also a support estimator and = inf x∈S p(x). In this case, Proposition 5 says that if the lower bound on the density vanishes no faster than O(n −1/2 ), then support estimation is still possible.
Below we show that the error bound given in Proposition 5 is minimax optimal up to log factors. Consider P n (h 0 , ), the class of probability distribution of n i.i.d. random vectors in R d whose common density exhibit a gap of size such that condition (22) holds, and satisfying condition R with parameter h 0 > 0. Then Proposition 5 shows that, for all n large enough, provided that h is of the order log(n) n 2 1/d . Our next result provides a nearly-matching lower bound.
Proposition 6. There exist constants h 0 and c, depending only on d such that for any ≤ 1/4, for all n large enough here exist probability distributions {P 1 , . . . , where the infimum is with respect to all estimators of S.
Thus, if log(n) n 2 → 0 as n → ∞ (so that condition (26) is eventually satisfied), then the bounds given in Proposition 5 and Proposition 6 match, up to a log(n) factor. That is, with suitable choice of input, DBSCAN can optimally estimate the level set S at the gap.
The performance of the Devroye-Wise estimator is a well-established topic in the literature: see, e.g., Theorem 4 and 5 in Cuevas and Rodríguez-Casal [2004]. Our contribution in this regard is two fold: we allow for an explicit dependence on the gap size parameter and deliver minimax lower bounds. Our rate of convergence confirms the intuition that a smaller gap size leads to a harder estimation problem.

Discussion
In this article we propose a new notion of consistency for estimating the clustering structure under various conditions. Our analysis shows that the DBSCAN algorithm is minimax optimal. Interestingly, the rates match, up to log terms, minimax rates for density estimation in the supreme norm for Höloder smooth densities. In particular, our results provide a complete, rigorous justification to the plausible belief, commonly held in density-based clustering, that clustering is as difficult as density estimation. In the rest of the discussion section, we will compare our notion of separation with other existing ones in the literature. For the sake of exposition, we will follow the convention used in much of the literature on density-based clustering of assuming that the cluster tree of the data generating distribution in fact corresponds to the hierarchy of the upper level sets of a canonical density p. As explained in Steinwart [2015], this definition is in general not well-posed, since different densities will yield different trees.

Hartigan consistency in Hartigan [1981]
We follow Chaudhuri and Dasgupta [2010] and Eldridge et al. [2015] in defining Hartigan consistency in terms of the density cluster tree.
Definition 8 (Hartigan consistency). Let T n be a cluster tree estimator constructed from i.i.d. data {X i } n i=1 from a disribution P with Lebesgue density p. For any pair of subsets A and A , let denote A n and A n be the smallest clusters of T n containing A ∩ {X i } n i=1 and A ∩ {X i } n i=1 , respectively. The cluster tree estimator T n is Hartigan consistent if, for any pair of sets A and A belonging to distinct connected components of {x : p(x) ≥ λ} for some λ, P (A n ∩ A n = ∅) → 1 as n → ∞.
It is immediate from Definition 3 that a δ-consistent cluster tree is also Hartigan consistent. While Hartigan consistency is a simple form of point-wise cluster tree consistency, which holds for each fixed pairs of disjoint clusters, δ-consistency is a stronger guarantee, as it yields uniform consistency over all δ-separated clusters and, furthermore, gives consistency rates depending on the value of the separation parameter δ.

Comparison with the Merge distortion metric
The notion of δ-separation is closely related to the notion of merge distance introduced by Eldridge et al. [2015], which we present next.
Definition 9. Let p and q be Lebesgue densities in R d and let T p and T q be the corresponding cluster density trees. The merge distortion distance between T p and T q is defined as where, for a Lebesgue density p, m p (x, y) = sup{λ > 0 ∈ R : there exists C ∈ T p (λ) such that {x, y} ⊂ C}.
The original definition of merge distortion metric is, in fact, more general but, when specialized to our settings, reduces to the one given above.
The merge distortion distance is closely related to the L ∞ distance between densities. In fact, by Theorem 17 in Eldridge et al. [2015], d M (T p , T q ) ≤ p − q ∞ , so that, if {p n } n is a sequence of Lebesgue densities, then p n −p → 0 implies that d M (T pn , T p ) → 0. In fact, Lemma 1 in Appendix F of Kim et al. [2016] shows that, if p and q are continuous, then d M (T p , T q ) = p−q ∞ . As a result, for the class of continuous (and, in particular, Hölder smooth) densities, cluster consistency in the merge distortion distance is equivalent to cluster consistency based on the δ-separation criterion, which in turn is equivalent to estimation consistency of the underlying density in the L ∞ norm.
The above statement immediately applies to the näive cluster tree estimator T p hn built using the level sets of any density estimator p hn that is continuous and, as h n → ∞, consistent in the L ∞ norm. Such estimator is of course computationally unfeasible even in low dimension. In fact, the DBSCAN-based procedures described above in Algorithms 1 and 2, which are applicable in highdimensional settings, are also consistent in the merge-distortion metric. To see this, and following the arguments of Eldridge et al. [2015], it is sufficient to demonstrate the properties of minimality and separation, as defined in that reference, for the DBSCAN cluster-tree estimators. The separation property, which prevents the emergence of false clusters or over-segmentation, follows directly from the definition of δ-separation; see also the pruning results of Section 4.6. On the other hand, minimality avoids the occurrence of improper nesting and holds for the DBSCAN procedures we consider here in virtue of Lemma 1 and Lemma 6. The fact that our algorithms produce cluster tree estimators that are consistent in the merge distance should not be surprising, since δ-consistency is directly tied to consistency for density estimation in in L ∞ . As shown in Eldridge et al. [2015], the robust single-linkage clustering algorithm of Chaudhuri et al. [2014] is also consistent in the merge distance.
6.3 Comparison with the ( , σ)-separation criterion of Chaudhuri et al. [2014] The criterion of δ-separation we introduce in this paper is most useful when studying smooth densities. Nonetheless, it will be helpful to compare it to the notion of ( , σ)-separation defined in Chaudhuri et al. [2014], which is applicable to arbitrary densities.
1. Let f be a density supported on X ⊂ R d . We say that A, A ⊂ X are ( , σ)-separated if there exists S ⊂ X (the separator set) such that (i) any path in X from A to A intersects S, and given. An estimate of the cluster tree is said to be ( , σ) consistent if for any pair A and A being ( , σ) separated, the smallest cluster containing In the following result we make a straightforward connection between the δ-separation and ( , σ)-separation.
Lemma 3. Assume that p ∈ Σ(L, α) with α ≤ 1 and that A and A are δ-separated. Then, A and A are ( , σ)-separated with where λ = inf z∈A∪A p(z).
Proof of lemma 3. Denote λ = inf z∈A∪A p(z). Suppose for the sake of contradiction that there is a path l connects A and A and that l ∩ {p ≤ λ − δ} = ∅. Then by the continuity of p and the compactness of l, there exist γ > 0 such that l ⊂ {p ≥ λ − δ + γ}. Let σ α = δ/(3L) and = δ/3, then for any According to the separation criterion in Definition 10, two clusters can be ( , σ)-separated for many the values of and σ. In particular, by taking the separator set to be larger, it is easy to produce examples of δ-separated clusters that are also ( , σ)-separated such that δ is big but σ is small. This is simply because σ is heavily associated with S. And conversely, by taking an almost flat density function, it is possible to have a very large σ and very small δ.
We remark that when α > 1, there is no obvious relationship between the parameter (σ, ) in Definition 10 and δ in Definition 3 as that in Lemma 3. For α > 1, while p ∈ Σ(L, α) implies that p is Lipschitz continuous, the Lipschitz constant in this case does not depend on L and α in a simple manner. As a result, the parameter σ, representing the distance between connected components of upper level sets of p, is not straightforwardly related to δ.

A Topological Preliminaries
For completeness, we review the definition of connectedness from the general topology. We briefly explain why the connected components naturally introduce a hierarchical structure to the level sets of p. Let λ 1 > λ 2 , so we have {p ≥ λ 1 } ⊂ {p ≥ λ 2 }.
• Suppose A is any subset of R d , and A belongs to the same connected component of {p ≥ λ 1 }.
Then A is contained in the same connected component of {p ≥ λ 2 }.
• Suppose A ∪ A ⊂ {p ≥ λ 1 } and they belong to distinct connected components of {p ≥ λ 2 } Then A and A are not contained in the same connected component of {p ≥ λ 1 }.
We also review a closed related concepts, which is call the path connectedness in general topology.
Definition 12. We say that a subset U ⊂ R d is path connected if for any x, y ∈ U , there exists a path continuous P : [0, 1] → U such that P(0) = x and P(1) = y.
The main reason we introduce the path connectedness is that if U is an open set in R d , then U is connected if and only if it is path connected. Therefore a simple but useful consequence is that for any λ, the connected components of {p > λ} are also the path connected components. We will repeatedly use these topological properties in our analysis without further mentioning. The proofs of them are omitted and can be found in Munkres [2000] or any other books on general topology.

B Proofs from Section 4
We begin by justifying (6). Since this is a well known result, we simply use a result of Sriperumbudur and Steinwart [2012]. We will assume the following condition for the kernel K which is fairly standard in the non-parametric literature.
VC. The kernel K : R d → R has bounded support and integrates to 1. Let F be the class of functions of the form Then, F is a uniformly bounded VC class: there exist positive constants A and v such that where N (T, d, ) denotes the -covering number of the metric space (T, d), F is the envelope function of F and the sup is taken over the set of all probability measures on R d . The constants A and v are called the VC characteristics of the kernel.
The assumption VC holds for a large class of kernels, including any compact supported polynomial kernel and the Gaussian kernel. See Nolan and Pollard [1987] and Giné and Guillou [2002].
Proposition 7 (Sriperumbudur and Steinwart [2012]). Let P be the probability measure on R d with Lebesgue density bounded by p ∞ and assume that the kernel K belongs to L ∞ (R d ) ∩ L 2 (R d ) satisfies the VC assumption. Then for any γ > 0 and h > 0, there exists an absolute constant C depending on the VC characteristic of K such that, with probability no smaller than 1 − e −γ , Lemma 4. Suppose A and A are two clusters of T p (λ) and they are δ-separated. Then their merge Proof. By Definition 2, there A and A belong distinct connected components of {p > λ − δ}. For the sake of contradiction, suppose m f (A, A ) > λ − δ.
Therefore there exists λ such that m f (A, A ) > λ > λ − δ and that by Definition 9 A and A belong the same connected component of {p ≥ λ }. This is a contradiction because {p ≥ λ } ⊂ {p > λ − δ}.

B.1 Proofs in Section 4.3
Proof of proposition 1. To show proposition 1, we begin by introducing a standard topology lemma.
Lemma 5. Suppose p : R d → R are compactly supported. If A and A are in the same connected components of {p ≥ λ i } for i = 1, 2, . . . , ∞ and that λ i ≤ λ i+1 ,then A and A are in the same connected components of {p ≥ λ 0 }, where λ 0 = sup i λ i .
Proof of lemma 5. Let C i be the connected component of {p ≥ λ i } that contains A and A . Thus C i are compact and connected. Since Consider λ * = sup{λ : A, A belongs to the same connected components of {p ≥ λ}} Then λ 2 ≤ λ * ≤ λ 1 . By lemma 5 , A and A are in the same connected components of {p ≥ λ * }. Thus λ 2 ≤ λ * < λ 1 . In order to show that λ * is split level, it suffices to show that A and A are in the different connected components of {p > λ * }. Suppose for the sake of contradiction that A and A are connected in {p > λ * }. Then A and A are path connected as {p > λ * } is open. Thus there exist P connects A and A in {p > λ * }. Since P is compact, p(P) > λ * implies that there exists a > 0 such that λ * + a < λ 1 and P, A, A ⊂ {p ≥ λ * + a}. Thus A and A belong to the same connected component of {p ≥ λ * + a}. This is a contradiction because by construction of λ * , A and A belongs to the different connected components of {p ≥ λ * + a}.
Proof of corollary 1. Suppose A and A are δ separated with respect to λ. Then A and A belongs to distinct connected components of {p > λ − δ} where λ = inf x∈A∪A f (x). Let 0 < ≤ δ be given. Then since {p ≥ λ − δ + } ⊂ {p > λ − δ}, A and A belongs to distinct connected components of {p ≥ λ − δ + }. Since R d = {p ≥ 0} is connected, A and A belongs to the same connected component of {p ≥ 0}. By proposition 1, there exists 0 ≤ λ * < λ − δ + such that A and A in the same connected component of {p ≥ λ * } and in different connected components of {p > λ * }. By taking → 0, the claimed result follows.

B.2 Proofs in sections 4.4
Proof of Lemma 2. From the proof of Lemma 6, it can be see that Thus for any y ∈ B(X j , h) for some X j ∈D(λ), where the first inequality follows from |p(y) − p(X j )| ≤ Lh α . Therefore the above display implies For the other inclusion, let x ∈ p ≥ λ + C log(n) Thus p h (X j ) ≥ λ, which means that X j ∈ D(λ). So x ∈ X j ∈D(λ) B(X j , h) and the first inclusion follows.
Proof of Theorem 1. Let B be the event that By Proposition 7, we can choose a n so that P (B) ≥ 1 − 1/n and that a n = O log(n) n α/(d+2α) .
All the argument will be made on the good event B.
Observe that p has connected support. Therefore λ = 0 is not a split level. Assume that λ 0 = min{λ * : λ * is a split level of p}. Then λ 0 > 0. If h = O(n −1/(2α+d) ), for large n, we have 2a n + (4h/c S ) α < min{δ S , δ 0 }. Take Let A and A are two sets being δ-separated and let λ = inf x∈A∪A p(x). Since A and A are in distinct connected components of {p > λ − δ}, by proposition 1 there exists λ * being a split level of p such that λ * ≤ λ − δ and that A and A belongs to distinct connected components of {p > λ * }. Thus A and A belong to distinct connected components of {p > λ }, where Let {C k } K k=1 be the collection of connected components of {p > λ }. Thus we have A ⊂ C k and A ⊂ C k for some k = k . In order to show the smallest cluster containing A ∩ {X i } n i=1 and A ∩ {X i } n i=1 are disjoint with high probability, it suffices to show the following statement.
• Let A and A be two connected subsets of {p > λ } and belong to two distinct connected components of {p > λ * }. Then the smallest cluster containing A ∩ {X i } n i=1 and A ∩ {X i } n i=1 are disjoint with high probability.
Note that this observation reduce the original statement which concerns with generic δ-separated sets to the current statement which only concerns with one level near the split level. Since there are finitely many split levels, a simple union bound will suffice to show the δ consistency of the cluster tree returned by Algorithm 2.
The proof will be completed by the following two claims.
Since for large n, a n + (4h/c S ) α ≤ δ 0 , Since {p > λ } satisfies the inner cone condition C1, So there exists c I only depending on d and c I such that where the second inequality follows from h = O(n 1/(2α+d) ) and the equality follows from λ 0 n 2α/(2α+d) / log(n) → ∞ and n being large enough. Consider the event By the union bound So for any y ∈ {p > λ } , there exists the claim follows.
To finish the proof of the theorem, we still need to show at level λ − a n the data points are contained in distinct clusters. Therefore the following claim finish the proof.

Claim 2. There exists a partition
belong to distinct subsets of the partition and that data points in distinct subsets of the partition are mutually disconnected.
Proof. Let {B i } I i=1 be the collection of connected components of {p ≥ (4h/c S ) α + λ * }. Since A and A belong to distinct connected components of {p > λ * }, and λ * < (4h/c S ) α + λ * , A and A are contained in distinct elements of Note that D(λ −a n ) ⊂ {p ≥ (4h/c S ) α +λ * } as a consequence of event B. Thus S i = B i ∩ D(λ −a n ) form a partition of D(λ − a n ). Let By (32), L i ∩ L j = ∅ if i = j. This shows that data points in distinct subsets of the partition {S i } I i=1 are mutually disconnected at the graph C(h, λ − a n ).
Proof of Proposition 2.
Proof of C1. Since a Morse function has only isolated non degenerate critical points, and an isolated set in a compact domain is also finite, we infer that ∇p(x) = 0 only for finitely many x. In particular, since λ * are split levels, and {p = λ * } contains a critical point, there exist sufficiently small δ 1 , δ 2 > 0 such that {λ * + δ 1 ≤ p ≤ λ * + δ 2 } contains no critical points (since there are only finitely many critical points). Since the level sets are orthogonal to the gradient, we infer that {p = λ * + δ 1 } is smooth. In particular, {p = λ * + δ 1 } it satisfies the inner cone property with c I = 1/2.
The key difficulty in extending the above argument to {p > λ * } (instead of just {p ≥ λ * + δ 1 } with δ 1 > 0) is that the norm of gradient |∇p| can approach zero as δ 1 → 0, since {p = λ * } is a split level, hence it contains critical points.
Proof of C2. Let U = {p ≥ λ * + δ}. Fix an arbitrary r. Clearly U ⊆ x∈U B(x, r/3). Since U = {p ≥ λ * + δ} is closed, and the domain Ω is compact, we infer U = {p ≥ λ * + δ} is also compact. Thus we can extract a covering U ⊆ Cr i=1 B(x i , r/3) with finitely many balls. By Vitali covering lemma, we can further extract mutually disjoint balls B(x i j , r/3) such that Thus we can choose N r = {x i j }, j = 1, · · · , C r .

B.2.1 Proofs in Section 4.5
Proof of lemma 2. Let λ > 0 be given. Later in the proof, it can be seen that λ = C 0 , being the common upper bound of f i ∈ F . Define a > 0 to be such that 56λ · 8 d−1 a d = 1. Consider and for α ≥ 1,define where K ≤ 1 is chosen so that g ∈ Σ(L, α). By construction 0 ≤ g(r) ≤ δ. Consider the inequality Thus f i ∈ Σ(L, α) for , i = 1, . . . , 8 and the common upper bound of f i is f i ∞ = λ. Since f = 1, by symmetry each f i also integrates to 1. The fact that f i ≥ 0 follows from 0 ≤ g(r) ≤ δ ≤ p max . Since for any 1 ≤ i, j ≤ 8 , f j (x) = λ for any x ∈ B(x i , b).
Define the three events E 1 , E 1 and E 3 as following Then one has E 1 ∩ E 2 ⊂ E 3 . This is because if an algorithm is δ, consistent and every B(x i , b) contains at least one point , the algorithm will assign points in ∪ j =i B(x j , b) and points B(x i , b) into different clusters before joining them into the same cluster. In this way, the algorithm can identify the true density. Since P (E 1 ) ≥ 3/4 and P (E 2 ) ≥ 3/4, P (E 3 ) ≥ 1/2 It remains to compute the KL divergent between f 1 and f 2 and apply Fano's lemma. Using spherical coordinate centering at x 1 and x 2 , the KL divergent is given by and this implies λ Since δ ≤ λ/(2 d/2+1 ), this gives Combines equation (40) and equation (41) one has This gives where To justify that the collection of functions {f i } 8 i=1 constructed in the previous proof satisfies condition C and S(α), observe that λ is the only split level of f i for all 1 ≤ i ≤ 8. The case of α > 1 is only provided as the case of α < 1 is simpler. Straight forward computations shows that for any t ≤ 2 −α , {x : f i (x) ≥ λ + t} has two connected components: ∩ Ω. Therefore condition C and S(α) are trivially satisfied.

B.3 Proofs in Section 4.6
Poof proposition 3. By (9), with probability at least γ, we have p h − p ∞ ≤ a n .
Step 1. In this step, we show that for any split level λ * satisfying (18), there exists λ * being ∆-significant and that | λ * − λ * | ≤ ∆ for large n. Let C and C be two sets split at λ * . Thus there exists B being the connected component of {p ≥ λ * } containing both C and C . By (18), for large n, neither • By the same argument that gives (30) {p ≥ λ * } ⊂ L(λ * − a n ) := Since B ⊂ {p ≥ λ * } and that B is connected, X i and X j have the same label in C(h, λ * − a n ).
• Since X i ∈ C, X j ∈ C and that C and C are split exactly at λ * , X i , X j are contained in the distinct connected components of {p ≥ λ * + ∆}. By Claim 2 in the proof of Theorem 1, X i and X j belong to distinct connected components of C(h, λ * + ∆ − a n ). Let λ * be defined as in (17). By the above two bullet points, λ * − a n ≤ λ * ≤ λ * + ∆ − a n .
The fact that λ * is ∆-significant follows from the observation that X i , X j ∈ C(h, λ * + 2∆ − a n ).
Step 2. In this step, we show that if λ * is a ∆-significant level of the cluster tree constructed using modified DBSCAN, then there exists λ * being a split level of p such that So suppose X i ,X j and λ * satisfies (17) and that X i , X j ∈ C(h, λ * + ∆). Let λ * := sup{λ ≥ 0 : X i and X j are in the same connected component of {p ≥ λ}}.
Then by Claim 2 in the proof of Theorem 1, X i and X j belong to distinct connected components of C(h, λ * + ∆ − a n ). By definition of λ * , this implies λ * + ∆ − a n ≥ λ * , which is a contradiction. This finishes the proof.

B.4 A Side result: consistency of the KDE tree
As a side result, we also compute the upper bound of cluster tree estimators generated by kernel density estimators. We acknowledge that KDE clustering algorithms have been studied by many authors including Rinaldo and Wasserman [2010], Rigollet and Vert [2009] and Kim et al. [2016]. For completeness, we provide δ-consistency results for KDE cluster tree returned by Algorithm 3, but we do not claim the novelty of these results.

Algorithm 3 Clustering based on connected components
and edges (X i , X j ) if X i and X j belong to the same connected component of L(λ).
We start by showing that for generic α > 0, if p ∈ Σ(L, α), level sets of KDE estimator are good approximations of the corresponding population quantities.
Lemma 6. Assume that p ∈ Σ(L, α), where α > 0, and let K be a α-valid kernel. Then, there exist constants C 1 and C 2 , depending on p ∞ , K, L and d such that if h = C 1 1 n 1/(2α+d) , then with probability 1 − 1/n, uniformly over all λ > 0, As a direct corollary of Lemma 6, we show that algorithm 3 is consistent with the optimal rate.
Corollary 3. Let h be chosen as in Lemma 6. Under the assumptions of Lemma 6, the cluster tree returned by Algorithm 3 is δ-consistent with probability at least 1 − 1/n, where with C 2 = C 2 ( p ∞ , K, L, d) a constant independent of n and δ.
We remark that Algorithm 3 is computationally infeasible even in small dimensions. This is mainly because it requires to compute the level set {x : p h (x) ≥ λ} exactly to determine the clustering structure of the data points. However Algorithm 3 does not require additional regularity conditions such as S(α) and C to attain the minimax optimal rates.

B.4.1 Proofs in Appendix B.4
Proof of lemma 6. For any x ∈ R d , with probability at least 1 − 1/n where the second inequality follows from proposition 7 and standard calculations for the bias. By taking in (47), This completes the proof. A and A are in the same connected components of {p > λ}. This is a contradiction.
Step 1. Suppose A 2h ⊂ C i . Then A ⊂ C i,−2h . Then by Lemma 8, one has A ⊂ C i,−2h ⊂L(λ). Since data points in connected components ofL(λ) have the same label, and A is contained in only one connected components ofL(λ), points in A ∩ {X i } n i=1 have the same labels.
Denote h = C( log(n) Consequently λ is well defined and one has λ * + a n ≤ λ < λ * − a n . By lemma 7, the nodes of G h,k are contained in S h . Thus By lemma 8, Since h 0 ≥ h using assumption A3 then

C.3 Proof of Proposition 6
We begin by constructing of a well-behaved class of sets satisfying the boundary regularity condition (R). These sets will then be used to define high-density clusters in the proof of Proposition 6. Sets satisfying the properties given in the next definition are well known in the literature on support estimation: see, e.g., Korostelev and Tsybakov [1993]. For completeness we also show that they satisfy the boundary regularity condition (R).
Lemma 9. There exist a constants h 0 only depending only on L such that for any Ω ∈ G d (L), one has for any 0 ≤ h ≤ h 0 , where Ω h = x∈Ω B(x, h), Ω −h = {x ∈ Ω : B(x, h) ⊂ Ω} and C 0 is some constant depending on d.
Proof of lemma 9. Given Ω ∈ G d (L), let g be the corresponding map as in definition 13. Denote x be a generic point in R d−1 . Consider the change of coordinate map φ : R d → R d defined as φ(x, x d ) = (x, x d g(x)).

The inverse map
) is also well defined as g > 0.
Observe that φ([0, 1] d ) = Ω, and there exists a constant C(d) depending only on d such that [0, 1] d satisfies condition A3 with h 0 = 1/2 and C 0 = C(d). Thus in order to justify the lemma, it suffices to show that the maps φ and φ −1 only distort the distance and volume by factors depending on L only.
To be more precise, it suffices to show that for some constant L depending on L and some absolute constant C, Since the calculations of φ are similar to that of φ −1 , only the former one is shown in this case.
Step 1. To show that φ(x) is Lipschitz, it suffices to bound ∇φ op .
Proof of Proposition 6. Let 0 < δ ≤ 1/16 be depending on which will be specified later. For some constant depending C(d) only depending on d, it is desired to construct {S i } M i=1 ∈ G d (C(d)) such that L(S i S j ) ≥ δ and that M is of order δ −d+1 . Step defines a region of hyper cone in R d and C(d) is set so that the cone volume [−δ/2,δ/2] d−1 g(x)dx = δ d .
Let g 0 i and g 1 i be the corresponding map on R 0 i and R 1 i , as the later ones are copies of [−δ/2, δ/2] d−1 .
Step 3. Let {f j } M j=1 be such that Since 1 = f j = a d /4 + (1/4 + )(3/4) d ≤ a d /4 + (1/2)(3/4) d , a has to be greater than 1. Thus S j ⊂ [0, a] d and so S j can be viewed as the support of f i at the gap.
Step 5. For any i and j Since f i and f j are only possibly different on {C 0 k ∪ C 1 k } N k=1 . Also f i = f j within C 0 k ∪ C 1 k if and only if w i k = w j k . Thus the KL(f i , f j ) is determined by (1/4 + ) log 1/4 + 1/4 + (1/4) log 1/4 1/4 + ≤ 4δ d 2 .
Step 6. To apply Fano's lower bound lemma (see Tsybakov [2009]) it suffices to have max i =j KL(P i , P j ) ≤ log M 16n Since M ≥ 2 N /8 it suffices to have nN δ d 2 ≤ N log(2)/128. Thus it suffices to have δ d = min{a 1 n 2 , 1/16} for some absolute constant a.
Step 7. By Fano's lemma, the minimax rate is bounded from below above by L(S i S j ) = H(w i , w j )2L(C) ≥ (N/8)2δ d = cδ, for some absolute constant c.

C.4 Lower bounds of clustering at the Gap
We cite Theorem VI.1 of Chaudhuri et al. [2014] to demonstrate that the scaling in Proposition 4 is minimax optimal.
Proposition 8. Consider a finite family of density functions F = {f j }. Suppose all f j ∈ F have gap of size > 0 at level λ * . This means that for any j, {f j ≥ λ * + } ∪ {f j ≤ λ * } = R d . For any j, let {C i j } I j i=1 be the connected components of {f j ≥ λ * + } and d(C i j , C i j ) ≥ σ for i = i . There exists subsets A j and A j for density f j such that A j,σ ⊂ C i j and A j,σ ⊂ C i j with the following additional property.
Consider any algorithm that is given n ≥ 100 i.i.d. samples {X i } n i=1 from some f j ∈ F and, with probability at least 3/4, outputs a tree in which the smallest cluster containing A j ∩ {X i } n i=1 is disjoint from the smallest cluster containing A j ∩ {X i } n i=1 . Then there exists a constant C(d) only depending on d such that The proof of the proposition can be found in Theorem VI.1 of Chaudhuri et al. [2014]. We omit the details of the proof for brevity.

D A Cluster Consistency Resut for General Densities
The type of cluster consistency result we have obtained for densities with gaps can be easily generalized to arbitrary densities. To that end, we will introduce the notion of ( , σ)-separated clusters and of h-thick clusters, where , σ and h are positive numbers..

Definition 14.
Let and σ be positive numbers. Two connected subsets A and A of the support of P are said to be ( , σ)-separated when • they belong to different connected components of L(λ * − ), where λ * = inf x∈A∪A f (x) > , and • min k =l dist(C k , C l ) > σ, where C 1 , . . . , C m are the connected components of L(λ * − ).
In addition to being well-separated, we further require the clusters to be thick, in a sense made precise below.

Definition 15. A subset
Remark 2. Comparison with the separation criterion of Chaudhuri et al. [2014]. The notion of ( , σ)-separated clusters is analogous to the corresponding notion of separated clusters introduced in Chaudhuri et al. [2014], with and σ quantifying the degree of "vertical" and "horizontal" separation among clusters. There are however, two main differences. First, in our definition the parameter is on the same scale as the density p and, therefore, represents vertical separation among level sets in an additive and not multiplicative way. Secondly, we use different parameters to measure the degree of horizontal separation among clusters (σ) and the degrees of thickness of the clusters (h); in contrast, Chaudhuri et al. [2014] rely on just one parameter (σ in their notation) to express both separation and thickness.
With these general notions of thick and well-separated clusters in place, we provide the following uniform consistency results for clustering, which applies to arbitrary densities.
Corollary 4. Let {X 1 , . . . , X n } be an i.i.d. sample from a probability distribution P with an arbitrary density p and let > 0 and σ > 0. Set a n = C 1 log(n)+log(1/h) nh d as in (7) and suppose the input parameters h satisfying σ/4 ≥ h ≥ C log(n) n 2 1/d and, for any C > 0 such that 2a n < . Then with probability at least 1 − 1/n, uniformly over all clusters A and A that are h thick and ( , σ) separated, i. A −h ∩ { X 1 , . . . , X n } and A −h ∩ { X 1 , . . . , X n }, if non-empty, belong to distinct connected components of G k,h ; ii. all the sample points in A −h , if any, belong to the same connected component of G k,h where k = nh d V d λ , with λ ∈ (λ * − + a n , λ * − a n ] and λ * = inf xA∪A f (x).
The proof of the previous corollary is almost the identical to the proof of Chaudhuri et al. [2014] and is omitted.
Remark 3. Optimality. The scaling of the parameters ( , σ) is minimax optimal, since the construction used in Chaudhuri et al. [2014] yields ( , σ)-separated clusters that are also h thick with h = σ/4, so that the resulting lower bound applies to this case as well. Thus, DBSCAN delivers nearly minimax optimal cluster consistency with respect to our definitions of separated and thick clusters.