---
abstract: 'We introduce the [*diffusion $K$-means*]{} clustering method on Riemannian submanifolds, which maximizes the within-cluster connectedness based on the diffusion distance. The diffusion $K$-means constructs a random walk on the similarity graph with vertices as data points randomly sampled on the manifolds and edges as similarities given by a kernel that captures the local geometry of manifolds. Thus the diffusion $K$-means is a multi-scale clustering tool that is suitable for data with non-linear and non-Euclidean geometric features in mixed dimensions. Given the number of clusters, we propose a polynomial-time convex relaxation algorithm via the semidefinite programming (SDP) to solve the diffusion $K$-means. In addition, we also propose a nuclear norm (i.e., trace norm) regularized SDP that is adaptive to the number of clusters. In both cases, we show that exact recovery of the SDPs for diffusion $K$-means can be achieved under suitable between-cluster separability and within-cluster connectedness of the submanifolds, which together quantify the hardness of the manifold clustering problem. We further propose the [*localized diffusion $K$-means*]{} by using the local adaptive bandwidth estimated from the nearest neighbors. We show that exact recovery of the localized diffusion $K$-means is fully adaptive to the local probability density and geometric structures of the underlying submanifolds.'
address:
- 'Department of StatisticsUniversity of Illinois at Urbana-ChampaignS. Wright Street, Champaign, IL 61820: <xhchen@illinois.edu>: <http://publish.illinois.edu/xiaohuichen/> '
- 'Department of StatisticsUniversity of Illinois at Urbana-ChampaignS. Wright Street, Champaign, IL 61820: <yy84@illinois.edu>: <https://sites.google.com/site/yunyangstat/> '
author:
- Xiaohui Chen
- Yun Yang
bibliography:
- 'clustering\_sdp.bib'
date: 'First arXiv version: March 11, 2019. This version: '
title: 'Diffusion $K$-means clustering on manifolds: provable exact recovery via semidefinite relaxations'
---

[^1]

Introduction {#sec:introduction}
============

This article studies the clustering problem of partitioning $n$ data points to $K$ disjoint (smooth) Riemannian submanifolds with $1 {\leqslant}K {\leqslant}n$.

Problem formulation
-------------------

Let ${\mathcal{D}}_{k},k=1,\dots,K$ be compact and connected Riemannian manifolds of dimension $q_{k}$. Suppose that ${\mathcal{D}}_{k}$ can be embedded as a [*submanifold*]{} of an ambient Euclidean space ${\mathbb{R}}^{p}$ equipped with the Euclidean metric $\|\cdot\|$ (i.e., there is an immersion $\varphi_{k}: {\mathcal{D}}_{k} \to {\mathbb{R}}^{p}$ such that the differential ${\mathrm{d}}\varphi_{x}$ is injective for all $x \in {\mathcal{D}}_{k}$ and $\varphi_{k}$ is a homeomorphism onto $\varphi_{k}({\mathcal{D}}_{k}) \subset {\mathbb{R}}^{p}$; cf. [@doCarmo1992_RG]). In our clustering setting, we work with [*disjoint*]{} submanifolds ${\mathcal{D}}_{1},\dots,{\mathcal{D}}_{K}$ in ${\mathbb{R}}^{p}$ and denote $S = \bigsqcup_{k=1}^{K} {\mathcal{D}}_{k}$ as their disjoint union. Each smooth submanifold ${\mathcal{D}}_{k}$ is endowed with the Riemannian metric $\rho_{k}$ induced from $\|\cdot\|$, and we denote ${\mathscr{D}}_{k}$ as the Borel $\sigma$-algebra on ${\mathcal{D}}_{k}$ (i.e., the $\sigma$-algebra generated by the open balls in ${\mathcal{D}}_{k}$ with respect to $\rho_{k}$). Let $X_{1}^{n} := \{X_{1},\dots,X_{n}\}$ be a sequence of independent random variables taking values in $S$. Suppose that there exists a clustering structure $G_{1}^{*},\dots,G_{K}^{*}$ (i.e., a partition on $[n] := \{1,\dots,n\}$ satisfying $\bigsqcup_{k=1}^{K} G_{k}^{*} = [n]$) such that each of the $n$ data points belongs to one of the $K$ clusters: if $i \in G_{k}^{*}$, then $X_{i} \sim \mu_{k}$ for some probability distribution $\mu_{k}$ supported on ${\mathcal{D}}_{k}$. Given the observations $X_{1}^{n}$, the task of this paper is to develop computationally tractable algorithms with strong theoretical guarantees for recovering the true clustering structure $G_{1}^{*},\dots,G_{K}^{*}$.

![Comparison of the $K$-means and the SDP relaxed diffusion $K$-means clustering methods on a synthetic data sampled from three clusters with one disk and two annuli.[]{data-label="fig:kmeans_demo"}](kmeans_demo.pdf "fig:")\
![Comparison of the $K$-means and the SDP relaxed diffusion $K$-means clustering methods on a synthetic data sampled from three clusters with one disk and two annuli.[]{data-label="fig:kmeans_demo"}](diffusion_kmeans_demo.pdf "fig:")

Classical clustering methods such as $K$-means [@MacQueen1967_kmeans] and mixture models [@FraleyRaftery2002_JASA] assume that data points from each cluster are sampled in the neighborhood (with the same dimension) of a [*centroid*]{}, where ${\mathcal{D}}_{k}$ contains only one point in ${\mathbb{R}}^{p}$. Such methods are effective for partitioning data with ellipsoidal contours, which implicitly implies that the similarity (or affinity) criteria of centroid-based clustering methods target on some notions of “compactness". In modern applications such as image processing and computer vision [@ShiMalik2000_IEEEPAMI; @SouvenirPless2005_ICCV; @ElhmifarVidal2011_NIPS], structured data with geometric features are commonly seen as clusters without necessarily being close together and having the same dimension. Figure \[fig:kmeans\_demo\] is an illustration for such observation on a synthetic data sampled from a noisy version of three clusters with one disk and two annuli. In this example, it is visually clear to distinguish the three clusters, however the $K$-means method fails to correctly cluster the data points. There are two main reasons for the failure of $K$-means. First, the north pole and south pole in the outer annulus have the largest Euclidean distance among all data points, even though they belong to the same cluster. Second, the annuli and the disk live in different dimensions. In particular, the annulus is a one-dimensional circle in ${\mathbb{R}}^{2}$ that is locally isometric to the real line and the disk has dimension two. Thus these geometric concerns motivate us to seek a more natural and flexible notion of closeness for clustering analysis. In this paper, we shall focus on the clustering criterion based on the [*connectedness*]{}, which is suitable for simultaneously addressing the two issues. First, connectedness is a graph property that does not rely on the physical distance: two vertices are connected if there is a path joining them. This extends the closeness from the local neighborhood to the global sense. Second, connectivity is a viable notion for clustering components of mixed dimensions, as long as all clusters live in the same ambient space where the graph connectivity weights can be computed.

In the population version, a clustering component can be viewed as a smooth submanifold, embedded in ${\mathbb{R}}^{p}$. In Riemannian geometry, a Riemannian submanifold ${\mathcal{M}}$ in ${\mathbb{R}}^{p}$ is said to be [*connected*]{} if for any $x, y \in {\mathcal{M}}$, there is a parameterized regular curve joining $x$ and $y$. Thus an appealing notion of ${\mathcal{M}}$ for being a cluster is that ${\mathcal{M}}$ is a compact and connected component in ${\mathbb{R}}^{p}$. In our setting, a clustering model is the union of $K$ disjoint submanifolds ${\mathcal{D}}_{1},\dots,{\mathcal{D}}_{K}$, and each ${\mathcal{D}}_{k}$ is equipped with a probability distribution $\mu_{k}$. Thus for the underlying true clustering model, there are $K$ connected graphs that do not overlap. In the sample version, data points are randomly generated from $\{({\mathcal{D}}_{k}, \mu_{k})\}_{i=1}^{k}$ with a clustering structure $\{G_{k}^{*}\}_{k=1}^{K}$. Typically, weighted graphs computed from the observed data points are fully connected (e.g., based on the Gaussian kernel). Thus a fundamental challenge of clustering analysis is to recover the true clustering structure from a noisy and fully connected weighted graph on the data.

Our contributions
-----------------

In this paper, we propose a new clustering method, termed as the [*diffusion $K$-means*]{}, for manifold clustering. The diffusion $K$-means contains two key ingredients. First, it constructs a random walk (i.e., a Markov chain) on the weighted random graph with data points $X_{1}^{n}$ as vertices and edge weights computed from a kernel representing the similarity of data in a local neighborhood. By running the Markov chain forward in time, the local geometry (specified by the kernel bandwidth) will be integrated at multiple time scales to reveal global (topological) structures such as the connectedness properties of the graph. In the limiting case as the sample size tends to infinity and the bandwidth tends to zero, the random walk becomes a diffusion process over the the manifold. By looking at the spectral decomposition of this limiting diffusion process, the evaluations of the eigenfunctions at vertices $X_{1}^{n}$ can be viewed as a continuous embedding of the data, called [*diffusion map*]{}, into a higher-dimensional Euclidean space. Second, once the diffusion map is obtained, we can compute the diffusion distance [@coifman2006diffusion] and the $K$-means algorithm (with the Euclidean metric) can be naturally extended with the diffusion affinity as the similarity measure. Since the diffusion distance/affinity captures the connectedness among vertices on the weighted random graph, the diffusion $K$-means aims to maximize the within-cluster connectedness, which can be recast as an [*assignment*]{} problem via a 0-1 integer program.

Because 0-1 integer programming problems with a non-linear objective function is generally $\mathsf{NP}$-hard, solving the diffusion $K$-means is computationally intractable, i.e., polynomial-time algorithms with exact solutions only exists in special cases. This motivates us to consider semidefinite programming (SDP) relaxations. We propose two versions of SDP relaxations of the diffusion $K$-means. The first one requires the knowledge of the number of clusters, and it can be viewed as an extension from Peng and Wei’s SDP relaxation [@PengWei2007_SIAMJOPTIM] for the $K$-means (as well as Chen and Yang’s SDP relaxation [@ChenYang2018] for the generalized $K$-means for non-Euclidean data in an inner product space) to the manifold clustering setting with diffusion distances. Figure \[fig:kmeans\_demo\] (on the right) shows that the SDP relaxed diffusion $K$-means can correctly identify the three clusters in the previous example. The second SDP relaxation does not require the number of clusters as an input. The idea is to drop the constraint on the trace of the clustering membership matrix (which involves number of clusters $K$), and to add a penalization term on the diffusion $K$-means objective function. Thus it can be seen as a nuclear norm [*regularized*]{} version of the SDP for diffusion $K$-means that is adaptive to the number of clusters. For both SDP relaxations of the diffusion $K$-means, we show that exact recovery can be achieved when the underlying submanifolds are well separated and subsamples within each submanifold are well connected.

Since the diffusion $K$-means and its regularized version have only one (non-adaptive) bandwidth parameter to control the local geometry, they may fail for clustering problems with unbalanced sizes, mixed dimensions, and different densities. In such situations, a random walk on the vertices sampled from regions of low density mixes slower than that from regions of high density. This motivates us to consider a variant of diffusion $K$-means, termed as the [*localized diffusion $K$-means*]{}, by using data-dependent local bandwidth. We adopt the self-tuning procedure from [@zelnik2005self] where local adaptive bandwidth is estimated from the nearest neighbors and we show that the localized diffusion $K$-means is adaptive to the local geometry and the local sampling density for the purpose of exact recovery of the true clustering structure.

To summarize, our contributions are listed as below.

1.  We introduce the diffusion $K$-means clustering method for manifold clustering, which integrates the nonlinear embedding via the diffusion maps and the $K$-means clustering.

2.  We propose two versions of the SDP relaxations of the diffusion $K$-means: one requires to know the number of clusters, and the other one does not require such knowledge as an input (and thus it is adaptive to the unknown number of clusters).

3.  We derive the exact recovery property of the SDP relaxed diffusion $K$-means in terms of two hardness parameters of the clustering problem: one reflects the separation of the submanifolds, and the other one quantifies the degree of connectedness of the submanifolds.

4.  We combine the local scaling procedures with the diffusion $K$-means and its regularized version, and derive their adaptivity when the clustering problems have unbalanced sizes, mixed dimensions, and different densities.

Related work
------------

There is a large collection of clustering methods and algorithms in literature, which can be broadly classified into two categories: hierarchical clustering and partition-based clustering. Hierarchical clustering recursively divides data points into groups in either a top-down or bottom-up way. Such algorithms are greedy and they often get stuck into local optimal solutions.

Partition-based clustering methods such as $K$-means clustering [@MacQueen1967_kmeans] and spectral clustering [@vanLuxburg2007_spectralclustering] directly assign each data point with a group membership. Perhaps one of the most widely used clustering methods is the $K$-means method, due to the existence of algorithms with linear sample complexity (such as Lloyd’s algorithm [@Lloyd1982_TIT]). However, the $K$-means clustering converges locally to a stationary point that depends on the initial partition. Recent theoretical studies in [@LuZhou2016] show that, given a proper initialization (such as spectral clustering), Lloyd’s algorithm for optimizing the $K$-means objective function can consistently recover the clustering structures. Exact and approximate recovery of various convex relaxations for the $K$-means and mixture models are studied in literature [@PengWei2007_SIAMJOPTIM; @LiLiLingStohmerWei2017; @FeiChen2018; @Royer2017_NIPS; @BuneaGiraudRoyerVerzelen2016]. To the best of our knowledge, existing theoretical guarantees developed for the convex relaxed $K$-means clustering assumes that the clusters are sampled in a neighborhood of a centroid. Thus results derived for $K$-means in literature cannot be directly compared with our results.

On the other hand, spectral clustering methods [@ShiMalik2000_IEEEPAMI; @NgJordanWeiss2001_NIPS] take the similarity matrix as the input and solve the clustering problem by applying $K$-means to top eigenvectors of the graph Laplacian matrix or its normalized versions [@Chung1996_SpectralGraphTheory]. In essence, spectral clustering contains two steps: (i) the Laplacian eigenmaps embed data into feature spaces, and (ii) $K$-means on top eigenvectors serves as a rounding procedure to obtain the true clustering structure [@vanLuxburg2007_spectralclustering]. Conventional intuition for spectral clustering is that the embedding step (i) often “magnifies" the cluster structure from the dataset to the feature space such that it can be revealed by a relatively simple algorithm (such as $K$-means) in step (ii). However, theoretical guarantees (such as exact recovery) for the spectral clustering is rather vague in literature, partially due to its two-step nature which complicates its theoretical analysis. For instance, [@vonLuxburgBelkinBousquet2008_AoS] study the convergence of spectral properties of random graph Laplacian matrices constructed from sample points and they establish the consistency of the spectral clustering in terms of eigenvectors. However, they do not address the problem of the exact recovery property of the clustering structure. Similar results along this direction can be found in [@Rosasco2010_JMLR; @schiebinger2015; @TrillosHoffmannHosseini2019]. [@LingStrohmer2019] propose similar SDP relaxations for the spectral clustering as in the present paper with the diffusion distance metric replaced with the graph Laplacian. Specifically, it is shown in [@LingStrohmer2019] that those SDP relaxations can exactly recover the true clustering structure under a spectral proximity condition. Such condition is deterministic and difficult to check for general data generation models. (A particular checkable random model is the stochastic ball model [@LingStrohmer2019].) During the preparation of this work, we notice a recent work [@maggioni2018learning] which proposes a similar idea of applying the diffusion distance as the similarity metric for clustering based on fast search and find of density peaks clustering (FSFDPS) [@rodriguez2014clustering]. To prove exact recovery, [@maggioni2018learning] requires strong deterministic assumptions on the Markov transition matrix associated with the diffusion process that could be difficult to check under their stochastic clustering model.

Literature on theoretical guarantees for manifold clustering is rather scarce, with a few exceptions [@Arias-Castro2011_IEEETIT; @LittleMaggioniMurphy2017]. Near-optimal recovery of some emblematic clustering methods based on pairwise distances of data is derived under a condition that the [*minimal*]{} signal separation strength over all pairs of submanifolds is larger than a threshold. Compared with our diffusion $K$-means with local scaling, results established in [@Arias-Castro2011_IEEETIT] are non-adaptive to the local density and (geometric) structures of the submanifolds (cf. Theorem \[thm:main\_adaptive\_h\] and \[thm:main\_adaptive\] ahead). [@LittleMaggioniMurphy2017] derive recovery guarantees for manifold clusters using a data-dependent metric called the longest-leg path distance (LLPD) that adapts to the geometry of data, where the data points are drawn from a mixture of uniform distributions on disjoint low-dimensional geometric objects.

Notation
--------

For a matrix $A\in{\mathbb{R}}^{n\times n}$ and index subsets $G,G'\subset [n]$, we use notation $A_{GG'}$ to denote the submatrix of $A$ with rows being selected by $G$ and columns by $G'$, and $\mbox{diag}(A)$ the $n$-dimensional vector composed of all diagonal entries of $A$. Let $\|A\|_{\infty} =\max_{1 {\leqslant}i,j {\leqslant}n} |A_{ij}|$ and $\|A\|_1=\sum_{i,j=1}^{n} |A_{ij}|$ denote the $\ell_\infty$ and the $\ell_1$ norm of the vectorization $\mbox{vec}(A)$ of matrix $A$. Let ${{\left\vert\kern-0.25ex\left\vert\kern-0.25ex\left\vert A 
    \right\vert\kern-0.25ex\right\vert\kern-0.25ex\right\vert}}_{\ast}$ and ${{\left\vert\kern-0.25ex\left\vert\kern-0.25ex\left\vert A 
    \right\vert\kern-0.25ex\right\vert\kern-0.25ex\right\vert}}_{\mbox{\scriptsize op}}$ denote the nuclear norm and the operator norm of matrix $A$. We shall use $c, c', c_{1}, c_{2},\dots,C,C', C_{1},C_{2},\dots$ to denote positive and finite (non-random) constants whose values may depend on the submanifolds $\{{\mathcal{D}}_{k}\}_{k=1}^{K}$ and the probability distributions $\{\mu_{k}\}_{k=1}^{K}$ supported on $\{{\mathcal{D}}_{k}\}_{k=1}^{K}$ and whose values may vary from place to place.

The rest of the paper is organized as follows. In Section \[sec:prelims\], we discuss some related background on diffusion distances and nonlinear embeddings in Euclidean spaces, as well as the Laplace-Beltrami operator for the heat diffusion process on Riemannian manifolds. In Section \[sec:diffusion\_Kmeans\], we introduce the diffusion $K$-means and its SDP relaxations. Regularized and localized diffusion $K$-means clustering methods are also proposed in this section. In Section \[sec:main\_results\], we present our main results on the exact recovery property of the SDP relaxed diffusion $K$-means. Simulation studies are presented in Section \[sec:simulations\]. Proofs are relegated to Section \[sec:proofs\].

Preliminaries {#sec:prelims}
=============

Let $S \subset {\mathbb{R}}^{p}$ and $\mu$ be a probability distribution on $S$. Let $S_n=\{X_1,X_2,\ldots,X_n\}$ be $n$ i.i.d. random variables in $S$ sampled from $\mu$, and $\mu_n =n^{-1} \sum_{i=1}^n \delta_{X_i}$ the empirical distribution. In Section \[sec:prelims\], we discuss the Euclidean embedding via the diffusion distance in the general setting. Thus in this section, we do not assume $S$ to be a disjoint union of $K$ submanifolds in ${\mathbb{R}}^{p}$ and the sample $S_{n}$ does not necessarily have a clustering structure.

Euclidean embedding and diffusion distances {#subsec:Euclidean_embedding_diffusion_dist}
-------------------------------------------

Let $\kappa : S \times S \to {\mathbb{R}}$ be a positive semidefinite kernel that satisfies:

symmetry: $\kappa(x, y) = \kappa(y, x)$,

positivity preserving: $\kappa(x, y) {\geqslant}0$.

A kernel is a similarity measure between points of $S$. A widely used example is the Gaussian kernel: $$\label{eqn:gaussian_kernel}
\kappa(x, y) = \exp \left( -{ \|x-y\|^{2} \over 2 h^{2}} \right),$$ where $h > 0$ is the bandwidth parameter that captures the local similarity of points in $S$. Given a kernel $\kappa$ with property (i) and (ii), we can define a reversible Markov chain on $S$ via the normalized graph Laplacian constructed as follows. Specifically, for any $x \in S$, let $$d(x) = \int_{S} \kappa (x, y)\,  {\mathrm{d}}\mu(y)$$ be the degree function of the graph on $S$. For simplicity, we assume $d(x)>0$ for all $x\in S$. Define $$\label{eqn:transition_kernel}
p(x, y) = {\kappa(x, y) \over d(x)},$$ which satisfies the positivity preserving property (ii) and the conservation property $$\int_{S} p(x, y) \, {\mathrm{d}}\mu(y) = 1.$$ Thus $p(x, y)$ can be viewed as the one-step transition probability of a (stationary) Markov chain on $S$ from $x$ to $y$. We shall write this Markov chain (i.e., random walk) as ${\mathcal{W}}= (S, \mu, p)$, where $p(\cdot, \cdot)$ is called the [*transition kernel*]{} of ${\mathcal{W}}$. Equivalently, we can describe ${\mathcal{W}}$ by the bounded linear operator $P : L^{2}({\mathrm{d}}\mu) \to L^{2}({\mathrm{d}}\mu)$ defined as $$Pf(x) = \int_{S} p(x, y) f(y) \, {\mathrm{d}}\mu(y).$$ Here $L^{2}({\mathrm{d}}\mu) := L^{2}(S, {\mathrm{d}}\mu)$ is the class of squared integrable functions on $S$ with respect to $\mu$. In literature, $P$ is often called the [*diffusion operator*]{} for the following reason. If we denote $p_{t}(x, y)$ as the $t$-step transition probability of the Markov chain ${\mathcal{W}}$ from $x$ to $y$ in $S$, then $$P_{t}f(x) = \int_{S} p_{t}(x, y) f(y) \, {\mathrm{d}}\mu(y),\qquad t=1,2,\ldots,$$ form a semi-group of bounded linear operators on $L^{2}({\mathrm{d}}\mu)$. Let $\Pi$ be a stationary distribution of the Markov chain ${\mathcal{W}}$ over $S$. Then $\Pi$ is absolutely continuous with respect to $\mu$, and the probability density function $\pi$ of $\Pi$ with respect to $\mu$ is given by the Radon-Nikodym derivative $$\label{eqn:stationary_dist}
\pi(x) = \frac{{\mathrm{d}}\Pi}{{\mathrm{d}}\mu} (x) = { d(x) \over  \int_{S} d(y)\, {\mathrm{d}}\mu(y)}.$$ Since $\Pi$ is the stationary measure of the Markov chain ${\mathcal{W}}$ with transition $P$, we have $$\Pi(P_{t}f) = \Pi(f)$$ for all bounded measurable functions $f$, where $\Pi(f) := \int_{S} f(x) \, {\mathrm{d}}\Pi(x)$. Note that, since the kernel $\kappa$ is symmetric, ${\mathcal{W}}$ is reversible and satisfies the detailed balance condition: $$\pi(x)\, p(x, y) = \pi(y) \,p(y, x),\quad\forall x,y\in S.$$

\[lem:spectral\_decomposition\_Markov\_chain\] Let $$R(x,y) = {\kappa(x,y) \over \sqrt{\pi(x)} \, \sqrt{\pi(y)}},\quad\forall x,y\in S.$$ If $$\label{eqn:kernel_integrability_condition}
\int_{S} \int_{S} R(x,y)^{2} \, {\mathrm{d}}\mu(x) \, {\mathrm{d}}\mu(y) < \infty,$$ then the following statements hold.

1.  There exists a sequence of nonnegative eigenvalues $\lambda_{0} {\geqslant}\lambda_{1} {\geqslant}\cdots {\geqslant}0$ such that $$R(x,y) = \sum_{j=0}^{\infty} \lambda_{j} \phi_{j}(x) \phi_{j}(y),$$ where $\{\phi_{j}\}_{j=0}^{\infty}$ is the set of associated eigenfunctions to $\{\lambda_{j}\}_{j=0}^{\infty}$, and $\{\phi_{j}\}_{j=0}^{\infty}$ forms an orthonormal basis of $L^{2}({\mathrm{d}}\mu)$.

2.  The transition probability $p(x,y)$ admits the following decomposition $$p(x,y) = \sum_{j=0}^{\infty} \lambda_{j} \psi_{j}(x) \varphi_{j}(y),$$ where $\psi_{j}(x) = \phi_{j}(x) / \sqrt{\pi(x)}$ and $\varphi_{j}(x) = \phi_{j}(x) \sqrt{\pi(x)}$.

3.  The diffusion operator $P$ satisfies $$P\, \psi_{j} = \lambda_{j} \,\psi_{j}, \quad j = 0, 1, \dots.$$ In addition, $\lambda_0=1$ and $\psi_0\equiv 1$.

The proof of Lemma \[lem:spectral\_decomposition\_Markov\_chain\] is given in Appendix \[app:A\], and our argument is similar to Lemma 12.2 in [@levin2017markov] in the finite-dimensional setting. If ${\mathcal{W}}$ is irreducible (i.e., the graph on $S$ is connected in that for all $x,y \in S$, there is some $t>0$ such that $p_{t}(x,y) > 0$), then the stationary distribution $\pi$ is unique. Thus if we run this Markov chain ${\mathcal{W}}$ forward in time, then the local geometry (captured by the kernel $\kappa$ which is parameterized by the bandwidth $h$) will be integrated to reveal global structures of $S$ at multiple (time) scales. In particular, we can define a class $\{D_{t}\}_{t \in {\mathbb{N}}_{+}}$ of [*diffusion distances*]{} [@coifman2006diffusion] on $S$ by $$D_{t}(x, y) := \|\, p_{t}(x, \cdot) - p_{t}(y, \cdot)\,\|_{L^{2}({\mathrm{d}}\mu/\pi)} = \left\{ \int_{S} [\, p_{t}(x, z) - p_{t}(y, z)]^{2}\,  {{\mathrm{d}}\mu(z) \over \pi(z)} \right\}^{1/2}.$$ Roughly speaking, for each $t\in {\mathbb{N}}_{+}$ and $x,y\in S$, the diffusion distance $D_{t}(x,y)$ quantifies the the total number of paths with length $t$ connecting $x$ and $y$ (see Figure \[fig:diffussion\_dist\]), thereby reflecting the local connectivity at the time scale $t$.

![Illustration of the diffusion distance between two red dots as the total number of paths connecting them. The region on the left panel (the Cheeger dumbbell) is “less" connected than the region on the right as there are fewer paths in the former due to the narrow bottleneck in the middle. In particular, the second smallest eigenvalue associated with the Laplace-Beltrami operator (or the Cheeger isoperimetric constant) of the left region is smaller that of the right.[]{data-label="fig:diffussion_dist"}](examples.pdf "fig:") ![Illustration of the diffusion distance between two red dots as the total number of paths connecting them. The region on the left panel (the Cheeger dumbbell) is “less" connected than the region on the right as there are fewer paths in the former due to the narrow bottleneck in the middle. In particular, the second smallest eigenvalue associated with the Laplace-Beltrami operator (or the Cheeger isoperimetric constant) of the left region is smaller that of the right.[]{data-label="fig:diffussion_dist"}](examples_2.pdf "fig:")

\[lem:spectral\_representation\_diffusion\_distances\] If the Markov chain ${\mathcal{W}}= (S, \mu, p)$ is irreducible, then we have $$D_{t}^2(x, y) = \sum_{j=0}^{\infty} \lambda_{j}^{2t} \, [\psi_{j}(x) - \psi_{j}(y)]^{2}$$ for all $t\in{\mathbb{N}}_{+}$ and $x,y\in S$.

The proof of Lemma \[lem:spectral\_representation\_diffusion\_distances\] is given in Appendix \[app:A\]. For an irreducible Markov chain, the spectral gap is strictly positive (i.e., $|\lambda_{j}| < 1$ for all $j > 0$). Based on the spectral decomposition in Lemma \[lem:spectral\_representation\_diffusion\_distances\] and noting that $\psi_{0} \equiv 1$, we see that the diffusion distance can be written as $$\begin{aligned}
\label{Eqn:Spectral_rep}
D_{t}(x, y) = \left\{ \sum_{j=1}^{\infty} \lambda_{j}^{2t} \, [\psi_{j}(x) - \psi_{j}(y)]^{2} \right\}^{1/2}.\end{aligned}$$ In this case, the diffusion distance $D_{t}(x, y)$ decays to zero as $t$ increases, provided that $x$ and $y$ belong to a connected component of the graph on $S$. In particular, the decay rate of the spectrum quantifies the connectivity of points in the graph on $S$. Given a positive integer $q \in {\mathbb{N}}_{+}$, the diffusion maps $\{\Psi_{t}\}_{t \in {\mathbb{N}}}$ are defined as $$\Psi_{t}^{(q)}(x) = (\lambda_{1}^{t} \psi_{1}(x), \dots, \lambda_{q}^{t} \psi_{q}(x))^{T},$$ where the $\ell$-th component $\Psi_{t\ell}^{(q)}(x)$ is the $\ell$-th diffusion coordinate in ${\mathbb{R}}^{q}$. Thus we obtain an embedding of $(S, \mu)$ into the Euclidean space ${\mathbb{R}}^{q}$ in the limiting sense that $$D_{t}(x, y) = \lim_{q \to \infty} \|\Psi_{t}^{(q)}(x) - \Psi_{t}^{(q)}(y)\|_{2}.$$

Empirical diffusion embedding {#subsec:empirical_diffusion_embedding}
-----------------------------

Recall that $S_n=\{X_1,X_2,\ldots,X_n\}$ are $n$ i.i.d. random variables in $S$ sampled from $\mu$, and $\mu_n =n^{-1} \sum_{i=1}^n \delta_{X_i}$ is the empirical distribution. Given $S_n$, we can consider finite sample approximations $\{D_{n,t}\}_{t\in{\mathbb{N}}_{+}}$ to the underlying population level quantities $\{D_{t}\}_{t\in{\mathbb{N}}_{+}}$. More precisely, consider a weighted graph with nodes corresponding to the elements in $S_n$, where the weight between a pair $(X_i,X_j)$ of nodes is $\kappa(X_i,X_j)$, for $i,j\in [n]$. Define the (rescaled) empirical degree function $d_n:\, S_n\to {\mathbb{R}}_{+}$ by $$\begin{aligned}
d_n(x) = n\,\int_{S_n} \kappa(x, y)\, {\mathrm{d}}\mu_n (y) =\sum_{i=1}^n \kappa(x, X_i),\quad \forall x\in S_n,\end{aligned}$$ where we added an extra $n$-factor so that $d_n(X_i)$ is also the degree of node $X_i$ in the weighted graph. Let $D_n$ denote the $n$-by-$n$ diagonal matrix whose $i$-th diagonal entry is $d_n(X_i)$. Consider the (empirical) random walk ${\mathcal{W}}_n=(S_n, \mu_n, P_n)$ over $S_n$ with transition probability $$\begin{aligned}
 P_n (x, y) = \frac{\kappa(x,y)}{d_n(x)}\quad\forall x,y\in S_n.\end{aligned}$$ The (empirical) stationary distribution $\pi_n$ of the random walk ${\mathcal{W}}_n$ over $S_n$ becomes $$\begin{aligned}
\pi_n(x) = \frac{d_n(x)}{\sum_{i=1}^{n} d_n(X_i)} \quad \forall x\in S_n.\end{aligned}$$ For any vector $v\in{\mathbb{R}}^n_{+}$, let $L^2(v)=\{u=(u_1,\ldots,u_n)\in{\mathbb{R}}^n:\, \|u\|_{L^2(v)} = \sum_{i=1}^n v_i\, u_i^2\}$ denote a weighted $L^2$ space over $S_n$. We define the [*empirical diffusion distances*]{} $\{D_{n,t}\}_{t\in {\mathbb{N}}_{+}}$ as $$\begin{aligned}
D_{n,t}(x,y) =\|P^t_n(x,\cdot) - P^t_n(y,\cdot)\|_{L^2(\mbox{diag}(D_n^{-1}))} = \left\{ \sum_{i=1}^n [\, P_{n}^t(x, X_i) - P^t_n(y, X_i)]^{2}\,  {1 \over d_n(X_i)} \right\}^{1/2},\end{aligned}$$ for all $x,y\in S_n$ and $t\in{\mathbb{N}}_{+}$. Roughly speaking, $\sqrt{n^{-1}\sum_{i=1}^{n} d_n(X_i)}\,D_{n,t}$ provides an empirical estimate to $D_t$. Similar to the spectral representation  for $D_t$, we also have the following spectral representation of $D_{n,t}$ (see Appendix \[app:B\]), $$\begin{aligned}
D_{n,t}(x, y)& = \left\{ \sum_{j=0}^{n-1} \lambda_{n, j}^{2t} \, [\psi_{n,j}(x) - \psi_{n,j}(y)]^{2} \right\}^{1/2},
\quad\forall t\in{\mathbb{N}}_{+} \mbox{ and }x,y\in S_n,\end{aligned}$$ where $1=\lambda_{n,0}{\geqslant}\lambda_{n,1} {\geqslant}\cdots {\geqslant}\lambda_{n,n-1} {\geqslant}0$ are the nonnegative eigenvalues (due to the positive semidefiniteness of the kernel $\kappa$) of the transition probability operator $P_n$, which can be identified with a matrix in ${\mathbb{R}}^{n\times n}$ with $[P_{n}]_{ij} = P_n(X_i,X_j)$ as its $(i,j)$-th element, and $\psi_{n,0},\psi_{n,1},\ldots,\psi_{n,n-1}:\,S_n \to{\mathbb{R}}$ are the associated eigen-functions on $S_n$ with unit $L^2(\mbox{diag}(D_n))$ norm, which can be identified with vectors in ${\mathbb{R}}^n$ with $[\psi_{n,j}]_i = \psi_{n,j}(X_i)$ as the $i$-th element of $\psi_{n,j}$ for $i\in [n]$ and $j =0,1\ldots,n-1$. The empirical diffusion distance $D_{n,t}(X_i, X_j)$ between two nodes $X_i$ and $X_j$ is also the Euclidean distance between their embeddings $\Psi_{n,t}(X_i)$ and $\Psi_{n,t}(X_j)$ via the empirical diffusion map $$\begin{aligned}
\Psi_{n,t}:\, S_n \to {\mathbb{R}}^{n},\quad x\mapsto \big(\lambda_{n,1}^t \psi_{n,1}(x),\ldots,\lambda_{n,n}^t\psi_{n,n}(x)\big)^T.\end{aligned}$$

The Laplace-Beltrami operator on Riemannian manifolds {#subsec:Laplace-Beltrami_operator}
-----------------------------------------------------

The Laplace-Beltrami operator on Riemannian manifolds is a generalization of the Laplace operator on Euclidean spaces. Let $f : {\mathcal{M}}\to {\mathbb{R}}$ be an (infinitely) differentiable function with continuous derivatives on a $q$-dimensional compact and smooth Riemannian manifold and $\nabla_{{\mathcal{M}}} f$ be the gradient vector field on ${\mathcal{M}}$ (i.e., $\nabla_{{\mathcal{M}}} f(x)$ is the deepest direction of ascent for $f$ at the point $x \in {\mathcal{M}}$). The Laplace-Beltrami operator $\Delta_{{\mathcal{M}}}$ is defined as the divergence of the gradient vector $$\Delta_{{\mathcal{M}}} f = -\mbox{div}(\nabla_{{\mathcal{M}}} f),$$ where the $\mbox{div}$ operator is relative to the volume form $\mbox{Vol}_{{\mathcal{M}}}$ of ${\mathcal{M}}$. Here we adopt the convention with the minus sign of the divergence such that $\Delta_{{\mathcal{M}}}$ is a positive-definite operator. With integration-by-parts, we have for any two differentiable functions $f$ and $g$, $$\int_{{\mathcal{M}}} g(x) \Delta_{{\mathcal{M}}} f \,{\mathrm{d}}\mbox{Vol}_{{\mathcal{M}}}(x) = \int_{{\mathcal{M}}} \langle \nabla_{{\mathcal{M}}} g(x), \nabla_{{\mathcal{M}}} f(x) \rangle \,{\mathrm{d}}\mbox{Vol}_{{\mathcal{M}}}(x),$$ where the inner product is taken in the $q$-dimensional tangent space of ${\mathcal{M}}$ (at the point $x$). In a Euclidean space (i.e., ${\mathcal{M}}= {\mathbb{R}}^{q}$), the Laplace-Beltrami operator is the usual Laplace operator $$\Delta f = -\sum_{j=1}^{q}{\partial^{2}f \over \partial x_{j}^{2}}.$$ On a general $q$-dimensional Riemannian manifold ${\mathcal{M}}$, the Laplace-Beltrami operator in a local coordinate system $(e^{1},\dots,e^{q})$ with a metric tensor ${\mathbf{G}}= (g_{ij})_{i,j=1}^{q}$ is given by $$\Delta_{{\mathcal{M}}} f = -{1 \over \sqrt{\det({\mathbf{G}})}} \sum_{j=1}^{q} {\partial \over \partial e^{j}} \left( \sqrt{\det({\mathbf{G}})} \sum_{i=1}^{q} g^{ij} {\partial f \over \partial e^{i}} \right),$$ where $g^{ij}$ are the entries of ${\mathbf{G}}^{-1}$. In the special case ${\mathcal{M}}= {\mathbb{R}}^{q}$, ${\mathbf{G}}$ is the $q \times q$ identity matrix. Note that $\Delta_{{\mathcal{M}}}$ is a self-adjoint positive-definite compact operator, its spectrum contains a sequence of nonnegative eigenvalues $0 {\leqslant}\lambda_{0} {\leqslant}\lambda_{1} {\leqslant}\cdots$. If in addition ${\mathcal{M}}$ is connected, then the second smallest eigenvalue $\lambda_{1} > 0$. As we will show, $\lambda_{1}$ depends on the connectivity of the manifold (Figure \[fig:diffussion\_dist\]), thus characterizing the limiting mixing time of the empirical random walk ${\mathcal{W}}_n$ over the $S_n$ as $n\to \infty$ and $h\to 0^{+}$, when $S_n$ is sampled from the manifold ${\mathcal{M}}$.

Diffusion $K$-means {#sec:diffusion_Kmeans}
===================

Recall that in our clustering model, $S_n=\{X_{1},X_2,\ldots,X_n\}$ is a sample of independent random variables taking values in $S$, where $S$ is the union of $K$ disjoint Riemannian submanifolds ${\mathcal{D}}_{1},\dots,{\mathcal{D}}_{K}$ embedded in the ambient space ${\mathbb{R}}^p$. The clustering problem is to divide these $n$ data points into $K$ clusters, so that points in the same cluster belongs to the same connected component in $S$, based on certain similarity measures between the points. In particular, the (classical) $K$-means clustering method minimizes the total intra-cluster squared Euclidean distances in ${\mathbb{R}}^p$ $$\min_{G_{1},\dots,G_{K}} \sum_{k=1}^{K} {1 \over |G_{k}|} \sum_{i,j \in G_{k}} \|X_{i}-X_{j}\|^{2}$$ over all possible partitions on $[n]$, where $|G_{k}|$ is the cardinality of $G_{k}$. Dropping the sum of squared norms $\sum_{i=1}^{n} \|X_{i}\|^{2}$, we see that the $K$-means clustering is equivalent to the maximization of the total within-cluster covariances $$\max_{G_{1},\dots,G_{K}} \sum_{k=1}^{K} {1 \over |G_{k}|} \sum_{i,j \in G_{k}} a_{ij}, \quad\mbox{with }a_{ij} = X_{i}^{T} X_{j}.$$ Here, $a_{ij}=X_{i}^{T} X_{j}$ can be viewed as a similarity measure specified by the Euclidean space inner product $\langle X_{i}, X_{j}\rangle_{{\mathbb{R}}^p}$. In general, we can replace the Euclidean inner product with any other inner product over $S_n$ [@ChenYang2018]. For manifold clustering, we replace it with the inner product induced from the empirical diffusion distance, that is, $$\begin{aligned}
\langle x,\, y\rangle_{D_{n,t}} = \langle \Psi_{n,t}(x), \,\Psi_{n,t}(y) \rangle_{{\mathbb{R}}^{n}}
=\sum_{j=1}^{n} \lambda_{n,j}^{2t} \,\psi_{n,j}(x) \, \psi_{n,j}(y),\quad \forall x,y\in S_n.\end{aligned}$$ Henceforth, we will refer to $\langle \cdot,\, \cdot\rangle_{D_{n,t}}$ as the [*diffusion affinity*]{}. Interestingly, we can obtain this diffusion affinity value without explicitly conducting eigen-decomposition (spectral decomposition) to the transition probability matrix $P_n=D_n^{-1} K_n$ (or the symmetrized matrix $D_n^{-1/2} K_n D_n^{-1/2}$), where recall that $D_n=\mbox{diag}\big(d_n(X_1),\ldots,d_n(X_n)\big)\in{\mathbb{R}}^n$ is the degree diagonal matrix, and $K_n=\big[\kappa(X_i,X_j)\big]_{n\times n}\in{\mathbb{R}}^{n\times n}$ is the empirical kernel matrix. In fact, we may use the following relation that links the empirical diffusion affinity with entries in matrix $P_n$ raising to power $2t$ (see Appendix \[app:B\] for details), $$\begin{aligned}
\langle x,\, y\rangle_{D_{n,t}} = \sum_{j=1}^{n} \lambda_{n,j}^{2t} \,\psi_{n,j}(x) \, \psi_{n,j}(y)=[P_n^{2t}D_n^{-1}](x,y).\end{aligned}$$ This motivates a $K$-means clustering method via diffusion distances, referred to as the *diffusion $K$-means* as $$\begin{aligned}
\label{Eqn:Diffussion_K_Means}
\max_{G_{1},\dots,G_{K}} \sum_{k=1}^{K} {1 \over |G_{k}|} \sum_{i,j \in G_{k}} [P_n^{2t}D_n^{-1}]_{ij},\end{aligned}$$ for the tuning parameter $t$ interpreted as the number of steps in the empirical random walk ${\mathcal{W}}_n$. Note that here the affinity matrix $P_n^{2t}D_n^{-1}= D_n^{-1/2} (D_n^{-1/2} K_n D_n^{-1/2})^{2t} D_n^{-1/2} \in{\mathbb{R}}^{n\times n}$ is symmetric. In light of the connections between the diffusion distance and the random walk ${\mathcal{W}}_n$ over $S_n$ in Section \[subsec:empirical\_diffusion\_embedding\], the diffusion $K$-means attempts to maximize the total within-cluster connectedness.

\[rem:intution\_DKM\] In Section \[subsec:Euclidean\_embedding\_diffusion\_dist\], we see that, on a connected submanifold ${\mathcal{D}}_{k}$, the (population) diffusion process  converges to the stationary distribution : $$p_{t}(x,y) \to \pi(y) = {\int_{{\mathcal{D}}_{k}} \kappa(x,y) \,  {\mathrm{d}}\mu(x) \over \iint_{{\mathcal{D}}_{k} \times {\mathcal{D}}_{k}} \kappa(x,z) \,  {\mathrm{d}}\mu(x)\,  {\mathrm{d}}\mu(z)} \quad \text{as } t \to \infty.$$ In fact, since the kernel $\kappa$ is positive semidefinite, this convergence holds at a geometric rate governed by the spectral gap of the Laplace-Beltrami operator on ${\mathcal{D}}_{k}$ (cf.  in the proof of Lemma \[Lem:T\_2\]). Thus the empirical version of the diffusion (i.e., the Markov chain on the random graph generated by $X_{1}^{n}$ and $\kappa$) obeys $${P^{t}_{n}(X_{i}, X_{j}) \over \sum_{\ell \in G_{k}^{*}} \kappa(X_{\ell}, X_{j})} \approx {1 \over \sum_{\ell,\ell' \in G_{k}^{*}} \kappa(X_{\ell}, X_{\ell'})}$$ for any two data points $X_{i}, X_{j} \in {\mathcal{D}}_{k}$. On the other hand, if the separation between the submanifolds is large enough and $t$ is not so large, then the probability to diffuse from one cluster to another one is small (cf. Lemma \[lem:between\_cluster\_random\_walk\]). Thus we expect that $${P^{t}_{n}(X_{i}, X_{j}) \over \sum_{\ell \in G_{k}^{*}} \kappa(X_{\ell}, X_{j})} \approx 0$$ for any two data points $X_{i} \in {\mathcal{D}}_{k}$ and $X_{j} \in {\mathcal{D}}_{m}$ such that $k \neq m$. This means that the within-cluster entries of the empirical diffusion affinity are larger than the between-cluster entries. In particular, for suitably large $t \in {\mathbb{N}}_{+}$, the empirical diffusion affinity matrix $A_{n} := A_{n,t} = P_{n}^{2t} K_{n}^{-1}$ tends to become close to a block-diagonal matrix $$\begin{aligned}
\label{Eqn:approx_form_A_n}
A_n \approx \begin{pmatrix} 
\displaystyle \frac{1}{N_1} \mathbf{1}_{G_1^\ast} \mathbf{1}^T_{G_1^\ast} & 0 & \cdots & 0\\
0 & \displaystyle \frac{1}{N_2} \mathbf{1}_{G_2^\ast} \mathbf{1}^T_{G_2^\ast} & \cdots & 0\\
\vdots & \vdots & \ddots & \vdots \\
0 & \cdots & 0 & \displaystyle \frac{1}{N_K} \mathbf{1}_{G_K^\ast} \mathbf{1}^T_{G_K^\ast}
\end{pmatrix},\end{aligned}$$ where $N_{k} = \sum_{\ell,\ell' \in G_{k}^{*}} \kappa(X_{\ell}, X_{\ell'})$. Since each diagonal block of $A_{n}$ tends to be a constant matrix, if we run the Markov chain for a suitably long time, then this block-diagonal structure in the limit precisely conveys the true clustering structure in that $i, j \in G_{k}^{*}$ if and only if $\lim_{t \to \infty} [A_{n,t}]_{i,j} = N_{k}^{-1} > 0$. The trade-off regime of $t$ (cf.  in Theorem \[thm:main\]) is determined by the non-asymptotic bounds on the convergence of the empirical diffusion maps to its population version (cf. Lemma \[lem:within\_cluster\_random\_walk\] and \[lem:between\_cluster\_random\_walk\]), as well as the submanifolds separation.

Note that, for every partition $G_{1},\dots,G_{K}$, there is a one-to-one $n \times K$ [*assignment matrix*]{} $H = (h_{ik}) \in \{0,1\}^{n \times K}$ such that $h_{ij} = 1$ if $i \in G_{k}$ and $h_{ij} = 0$ if $i \notin G_{k}$. Thus the diffusion $K$-means clustering problem can be recast as a 0-1 integer program: $$\label{eqn:kernel_Kmeans_integer_program}
\max \left\{ \langle P_n^{2t}D_n^{-1}, H B H^{T} \rangle : H \in \{0,1\}^{n \times K}, H {\mathbf{1}}_{K} = {\mathbf{1}}_{n} \right\},$$ where ${\mathbf{1}}_{n}$ denotes the $n \times 1$ vector of all ones and $B = {\text{diag}}(n_{1}^{-1},\dots,n_{K}^{-1})$, where $n_{k}=|G_{k}|$ for $k=1,\ldots,K$ is the size of the $k$-th cluster.

The diffusion $K$-means clustering problem (\[eqn:kernel\_Kmeans\_integer\_program\]) is often computationally intractable, namely, polynomial-time algorithms with exact solutions only exist in special cases [@SongSmolaGrettonBorgwardt2007_ICML]. For instances, the (classical) $K$-means clustering is an $\mathsf{NP}$-hard integer programming problem with a non-linear objective function [@PengWei2007_SIAMJOPTIM]. Exact and approximate recovery of various SDP relaxations for the $K$-means [@PengWei2007_SIAMJOPTIM; @LiLiLingStohmerWei2017; @FeiChen2018; @Royer2017_NIPS; @GiraudVerzelen2018] are studied in literature. However, it remains a challenging task to provide statistical guarantees for clustering methods that can capture non-linear features of data taking values on manifolds.

Semidefinite programming relaxations
------------------------------------

We consider the SDP relaxations for the diffusion $K$-means clustering. Note that every partition $G_{1},\dots,G_{K}$ of $[n]$ can be represented by a partition function $\sigma : [n] \to [K]$ via $G_{k}=\sigma^{-1}(k), k=1,\dots,n$. If we change the variable $Z = H B H^{T}$ in the 0-1 integer program formulation (\[eqn:kernel\_Kmeans\_integer\_program\]) of the diffusion $K$-means, then $Z$ satisfies the following properties: $$\label{eqn:constraints_clustering_generic_integer_program}
Z^{T} = Z, \quad Z \succeq 0, \quad \operatorname{tr}(Z) = \sum_{k=1}^{K} n_{k} b_{kk}, \quad (Z {\mathbf{1}}_{n})_{i} = \sum_{k=1}^{K} n_{k} b_{\sigma(i)k}, \; i=1,\dots,n.$$ For the diffusion $K$-means $B = {\text{diag}}(n_{1}^{-1},\dots,n_{K}^{-1})$, the last constraint in (\[eqn:constraints\_clustering\_generic\_integer\_program\]) reduces to $Z {\mathbf{1}}_{n} = {\mathbf{1}}_{n}$, which does not depend on the partition function $\sigma$. Thus we can relax the diffusion $K$-means clustering to the SDP problem: $$\label{eqn:clustering_Kmeans_sdp}
\begin{gathered}
\hat{Z} = \operatorname{argmax}\left\{ \langle A, Z \rangle : Z \in {\mathscr{C}}_K \right\} \\
\qquad \mbox{with } {\mathscr{C}}_K = \{Z \in {\mathbb{R}}^{n \times n} : Z^{T} = Z, Z \succeq 0, \operatorname{tr}(Z) = K, Z {\mathbf{1}}_{n} = {\mathbf{1}}_{n}, Z {\geqslant}0 \}, 
\end{gathered}$$ where $Z \succeq 0$ means that $Z$ is positive semidefinite and $Z {\geqslant}0$ means that all entries of $Z$ are non-negative, and matrix $A=[a_{ij}]:=A_{n}=P_n^{2t}D_n^{-1}\in{\mathbb{R}}^{n\times n}$. We shall use $\hat{Z}$ to estimate the true “membership matrix" $Z^{*}$, where $$\label{eqn:Kmeans_true_membership_matrix}
Z_{ij}^{*} = \left\{
\begin{array}{cc}
1/n_{k} & \text{if } i, j \in G_{k}^{*} \\
0 & \text{otherwise} \\
\end{array}
\right. .$$ Note that $Z^{*}$ is a block diagonal matrix (up to a permutation) of rank $K$. If $X_{1},\dots,X_{n} \in {\mathbb{H}}$ (i.e., ${\mathbb{S}}= {\mathbb{H}}$) for some Hilbert space ${\mathbb{H}}$ and $a_{ij} = \langle X_{i}, X_{j} \rangle_{{\mathbb{H}}}$ is the inner product between $X_i$ and $X_j$, then (\[eqn:clustering\_Kmeans\_sdp\]) is the SDP for kernel $K$-means proposed in [@ChenYang2018]. In particular, [@PengWei2007_SIAMJOPTIM] consider the special case for the (Euclidean) $K$-means, where ${\mathbb{H}}= {\mathbb{R}}^{p}$ and $a_{ij} = X_{i}^{T} X_{j}$. Observe that the SDP relaxation (\[eqn:clustering\_Kmeans\_sdp\]) does not require the knowledge of the cluster sizes other than the number of clusters $K$. Thus it can handle the general case for unequal cluster sizes.

Regularized diffusion $K$-means {#subsec:regularized_diffusion_Kmeans}
-------------------------------

In practice, the number $K$ of clusters is rarely known. Note that the SDP problem  depends on $K$ only through the constraint $\operatorname{tr}(Z) = K$. Therefore we propose a [*regularized diffusion $K$-means*]{} estimator by dropping the constraint on the trace and penalizing $\operatorname{tr}(Z)$ as follows, $$\label{eqn:clustering_Kmeans_sdp_unknown_K}
\begin{gathered}
\tilde{Z} := \tilde{Z}_{\lambda} = \operatorname{argmax}\left\{ \langle A, Z \rangle - n\,\lambda \operatorname{tr}(Z) : Z \in {\mathscr{C}}\right\} \\
\mbox{with } {\mathscr{C}}= \{Z \in {\mathbb{R}}^{n \times n} : Z^{T} = Z, Z \succeq 0,\, Z {\mathbf{1}}_{n} = {\mathbf{1}}_{n}, Z {\geqslant}0 \},
\end{gathered}$$ where $\lambda>0$ is the regularization parameter. Recall that ${{\left\vert\kern-0.25ex\left\vert\kern-0.25ex\left\vert Z 
    \right\vert\kern-0.25ex\right\vert\kern-0.25ex\right\vert}}_{\ast}$ denotes the nuclear norm of a matrix $Z$ (i.e., ${{\left\vert\kern-0.25ex\left\vert\kern-0.25ex\left\vert Z 
    \right\vert\kern-0.25ex\right\vert\kern-0.25ex\right\vert}}_{\ast}$ is the sum of the singular values of $Z$). Since ${{\left\vert\kern-0.25ex\left\vert\kern-0.25ex\left\vert Z 
    \right\vert\kern-0.25ex\right\vert\kern-0.25ex\right\vert}}_{\ast} = \operatorname{tr}(Z)$ for $Z \in {\mathscr{C}}$, it is interesting to note that  is the same as the nuclear norm penalized diffusion $K$-means $$\label{eqn:clustering_Kmeans_sdp_unknown_K_nuclear-norm_form}
\begin{gathered}
\tilde{Z} = \operatorname{argmax}\left\{ \langle A, Z \rangle - n\,\lambda {{\left\vert\kern-0.25ex\left\vert\kern-0.25ex\left\vert Z 
    \right\vert\kern-0.25ex\right\vert\kern-0.25ex\right\vert}}_{\ast} : Z \in {\mathscr{C}}\right\}.
\end{gathered}$$ Recall that the true membership matrix $Z^{*}$ has a block diagonal structure with rank $K$, the nuclear norm penalized diffusion $K$-means  can be thought as an $\ell^{1}$ norm convex relaxation of the $\mathsf{NP}$-hard rank minimization problem (i.e., minimizing the number of non-zero eigenvalues). Thus the parameter $K$ in the clustering problem plays a similar role as the sparsity (or low-rankness) parameter in the matrix completion context [@CandesRecht2009_FoCM]. Hence the SDP problem  can be viewed as a (further) convex relaxation of the infeasible SDP problem  when $K$ is unknown. Note that similar regularizations have been considered in [@BuneaGiraudRoyerVerzelen2016] for the $G$-latent clustering models and in [@YanSarkarCheng2018_AISTATS] for stochastic block models.

It remains a question to choose the value of $\lambda$. Larger values of $\lambda$ will lead to solutions containing less number of clusters (with larger sizes). In particular, when matrix $A$ is positive-definite, the following Lemma \[lem:feasibility\_SDP\_lambda\_infinity\] shows that the solution reduces to a rank one matrix that assigns all points into a giant cluster when $\lambda$ is large enough, and becomes the identity matrix that assigns $n$ points into $n$ distinct clusters when $\lambda$ is small enough. In addition, the trace $\operatorname{tr}(\tilde Z_\lambda)$ of the solution is nonincreasing in $\lambda>0$.

\[lem:feasibility\_SDP\_lambda\_infinity\] Suppose $A$ is a positive definite matrix, and let $\lambda_{\max}(A)$ and $\lambda_{\min}(A)$ denote its respective largest and smallest eigenvalues. (1) If $n \lambda > \lambda_{\max}(A)$, then $Z^{\diamond} = n^{-1} J_{n}$, where $J_{n}$ is the $n \times n$ matrix of all ones, is the unique solution of the SDP . (2) If $n \lambda < \lambda_{\min}(A)$, then $Z^{\dagger} = I_n$, the $n \times n$ identity matrix, is the unique solution of the SDP . (3) If $\tilde Z_{\lambda_1}$ and $\tilde Z_{\lambda_2}$ are two solutions of the SDP  with the regularization parameter taking values $\lambda_1$ and $\lambda_2$, respectively. If $\lambda_1 < \lambda_2$, then $\operatorname{tr}(\tilde Z_{\lambda_1}){\geqslant}\operatorname{tr}(\tilde Z_{\lambda_2})$. Furthermore, if at least one of the two SDPs has a unique solution, then $\operatorname{tr}(\tilde Z_{\lambda_1})> \operatorname{tr}(\tilde Z_{\lambda_2})$.

According to the interpretation of the SDP , the trace $\operatorname{tr}(Z)$ of the solution can be viewed as the fitted number of clusters. Consequently, Lemma \[lem:feasibility\_SDP\_lambda\_infinity\] implies that smaller values of $\lambda$ will result in more clusters (with smaller sizes) in $\tilde{Z}_\lambda$. In practice, we need to properly select the tuning parameter $\lambda$. We propose the following decision rule for this purpose. For each $\lambda$, we run the SDP problem  and extract the value of $\operatorname{tr}(\tilde{Z}_\lambda)$. Then we plot the solution path $\operatorname{tr}(\tilde{Z}_\lambda)$ versus $\log(\lambda)$ and pick the values of $\lambda$ which spend the longest time (on the logarithmic scale) with a flat value of $\operatorname{tr}(\tilde{Z}_\lambda)$. Here we recommend using the logarithmic scale since values of $\lambda$ with non-trivial solutions $\operatorname{tr}(\tilde Z_\lambda)$ tends to be close to zero. Algorithm \[alg1\] below summarizes this decision rule.

\[alg1\] Set an increasing sequence $\{\lambda_j\}_{j=1}^J$ of candidate values for $\lambda$, for example, a geometric sequence in the interval $[n^{-1}\lambda_{\min}(A),\,n^{-1}\lambda_{\max}(A)]$. Set an upper bound $K_{\max}$ of $K$ and a tolerance level $\varepsilon\in (0,1/2)$.\

Figure \[fig:diffusion\_kmeans\_lambda\_demo\] shows the empirical result on the three clusters (one disk and two annuli) example in Section \[sec:introduction\]. According to Lemma \[lem:feasibility\_SDP\_lambda\_infinity\], the estimated number of clusters, proxied by $\operatorname{tr}(\tilde{Z}_\lambda)$, is a non-increasing function of $\lambda$. In particular, the trace $\operatorname{tr}(\tilde Z_\lambda)$ in the solution path in the upper left panel of Figure \[fig:diffusion\_kmeans\_lambda\_demo\] stabilizes around $2$ and $3$, indicating that both $2$ and $3$ are candidate values for the number of clusters. In particular, the interval of $\lambda$ (on the logarithmic scale) corresponding to value $3$ is much larger than that to value $2$, indicating that $3$ is more likely to be the true number of clusters (cf. the (correct) case in Figure \[fig:diffusion\_kmeans\_lambda\_demo\]). In Section \[sec:main\_results\], we will use our theory to explain this stabilization phenomenon, which partially justifies our $\lambda$ selection rule.

In addition, as we can see from the rest three panels in Figure \[fig:diffusion\_kmeans\_lambda\_demo\], by gradually increasing $\lambda$, the adaptive diffusion $K$-means method produces a hierarchical clustering structure. Unlike the top-down or bottom-up clustering procedures which are based on certain greedy rule and can incur inconsistency, the hierarchical clustering structure produced by our approach is consistent — it does not depend on the order of partitioning or merging due to the uniqueness of the global solution from the convex optimization via the SDP. Similar observations can be drawn on another example shown in Figure \[fig:diffusion\_kmeans\_lambda\_demo\_DGP2\] containing a uniform sample on three rectangles (see DGP 2 in our simulation studies Section \[sec:simulations\] for details).

Further, it is interesting to observe in Figure \[fig:diffusion\_kmeans\_lambda\_demo\] that the regularized diffusion $K$-means tuned with two clusters yields a merge between the outer annulus and the disk, which gives the largest total diffusion affinity in the objective function  among the three possible combinations of the true clusters. Since diffusion affinity decays exponentially fast to zero in the squared Euclidean distance (for the Gaussian kernel), the diffusion affinity matrix $A = P_{n}^{2t} D_{n}^{-1}$ tends to have a block diagonal structure, as weights between points belonging to different clusters are exponentially small (cf.  and Lemma \[Lemma:total\_degree\]). Thus running SDP for examples with relatively well separated clusters, such as the one in Figure \[fig:diffusion\_kmeans\_lambda\_demo\], tends to merge two clusters with largest within-cluster diffusion affinities that is irrespective of the between-cluster Euclidean distances. This may lead to a visually less appealing merge as in the Euclidean distance case (cf. the (under) case in Figure \[fig:diffusion\_kmeans\_lambda\_demo\]). On the other hand, the regularized diffusion $K$-means is able to produce more reasonable partition in splitting the clusters (cf. the bottom-left panel in Figure \[fig:diffusion\_kmeans\_lambda\_demo\]). In particular, if the regularization parameter $\lambda$ is chosen such that the corresponding number $\hat{K}$ of clusters in the SDP solution is greater than $K$, then this will cause a split in one of the true clustering structures that minimizes the between-cluster diffusion affinities after the splitting. Moreover, in our simulation studies (setup DGP 3 in Section \[sec:simulations\]), we observe that the SDP relaxed regularized diffusion $K$-means performs much better in harder cases than the spectral clustering methods when the true clusters are not well separated.

![Plot of the estimated trace norms along the path of tuning parameter $\lambda$ (on the log-scale) in the SDP relaxed regularized diffusion $K$-means clustering method  on the synthetic data in Figure \[fig:kmeans\_demo\]. The clustered data are shown for estimated number of clusters 2 (under), 3 (correct), 4 (over).[]{data-label="fig:diffusion_kmeans_lambda_demo"}](diffusion_kmeans_lambda_demo.pdf "fig:") ![Plot of the estimated trace norms along the path of tuning parameter $\lambda$ (on the log-scale) in the SDP relaxed regularized diffusion $K$-means clustering method  on the synthetic data in Figure \[fig:kmeans\_demo\]. The clustered data are shown for estimated number of clusters 2 (under), 3 (correct), 4 (over).[]{data-label="fig:diffusion_kmeans_lambda_demo"}](diffusion_kmeans_adaptive_correct_demo "fig:")\
![Plot of the estimated trace norms along the path of tuning parameter $\lambda$ (on the log-scale) in the SDP relaxed regularized diffusion $K$-means clustering method  on the synthetic data in Figure \[fig:kmeans\_demo\]. The clustered data are shown for estimated number of clusters 2 (under), 3 (correct), 4 (over).[]{data-label="fig:diffusion_kmeans_lambda_demo"}](diffusion_kmeans_adaptive_over_demo "fig:") ![Plot of the estimated trace norms along the path of tuning parameter $\lambda$ (on the log-scale) in the SDP relaxed regularized diffusion $K$-means clustering method  on the synthetic data in Figure \[fig:kmeans\_demo\]. The clustered data are shown for estimated number of clusters 2 (under), 3 (correct), 4 (over).[]{data-label="fig:diffusion_kmeans_lambda_demo"}](diffusion_kmeans_adaptive_under_demo "fig:")

![Plot of the estimated trace norms along the path of tuning parameter $\lambda$ (on the log-scale) in the SDP relaxed regularized diffusion $K$-means clustering method  for DGP=2. The clustered data are shown for estimated number of clusters 2 (under), 3 (correct), 4 (over).[]{data-label="fig:diffusion_kmeans_lambda_demo_DGP2"}](diffusion_kmeans_lambda_demo_DGP2.pdf "fig:") ![Plot of the estimated trace norms along the path of tuning parameter $\lambda$ (on the log-scale) in the SDP relaxed regularized diffusion $K$-means clustering method  for DGP=2. The clustered data are shown for estimated number of clusters 2 (under), 3 (correct), 4 (over).[]{data-label="fig:diffusion_kmeans_lambda_demo_DGP2"}](diffusion_kmeans_adaptive_correct_demo_DGP2 "fig:")\
![Plot of the estimated trace norms along the path of tuning parameter $\lambda$ (on the log-scale) in the SDP relaxed regularized diffusion $K$-means clustering method  for DGP=2. The clustered data are shown for estimated number of clusters 2 (under), 3 (correct), 4 (over).[]{data-label="fig:diffusion_kmeans_lambda_demo_DGP2"}](diffusion_kmeans_adaptive_over_demo_DGP2 "fig:") ![Plot of the estimated trace norms along the path of tuning parameter $\lambda$ (on the log-scale) in the SDP relaxed regularized diffusion $K$-means clustering method  for DGP=2. The clustered data are shown for estimated number of clusters 2 (under), 3 (correct), 4 (over).[]{data-label="fig:diffusion_kmeans_lambda_demo_DGP2"}](diffusion_kmeans_adaptive_under_demo_DGP2 "fig:")

![Plots of the SDP diffusion $K$-means clustering method without (left) and with (right) local scaling for the data generation mechanism DGP=3 in the simulation studies Section \[sec:simulations\].[]{data-label="fig:diffusion_kmeans_local_scaling_demo"}](diffusion_kmeans_no_local_scaling_demo.pdf "fig:") ![Plots of the SDP diffusion $K$-means clustering method without (left) and with (right) local scaling for the data generation mechanism DGP=3 in the simulation studies Section \[sec:simulations\].[]{data-label="fig:diffusion_kmeans_local_scaling_demo"}](diffusion_kmeans_local_scaling_demo.pdf "fig:")

Localized diffusion $K$-means {#subsec:localized_diffusion_Kmeans}
-----------------------------

For clustering problems with different sizes, dimensions and densities, the diffusion $K$-means may have limitations since only one bandwidth parameter $h$ is used to control the local geometry on the domain. More precisely, according to our theory (for example, Theorem \[thm:main\] below), the optimal choice of the bandwidth parameter for a $q$-dimensional submanifold as one connected component in our clustering model is $h\asymp (\log \tilde{n}/\tilde{n})^{1/q}$, where $\tilde n$ corresponds to the sample size within this cluster and thus depends on the local cluster size or density level. Figure \[fig:diffusion\_kmeans\_local\_scaling\_demo\] demonstrates such an example for a mixture of three bivariate Gaussians, which consist of one larger Gaussian component with low density and two smaller Gaussian components with high density. Empirically, the diffusion $K$-means fails on this example (even after tuning) for the reason that the larger and smaller clusters have very different local densities. This motivates us to consider a variant of diffusion $K$-means, termed as *localized diffusion $K$-means*, by using local adaptive bandwidth $h_i=h(X_i)$ for each $X_i$, $i\in[n]$. In particular, we adopt the self-tuning procedure from [@zelnik2005self] by setting $h_i$ to be $\|X_i-X_i^{(k_0)}\|$, where $X_i^{(k_0)}$ denotes the $k_0$-th nearest neighbor to $X_i$, and replacing $K_n$ with $K_n^\dagger=[K^\dagger(X_i,X_j)]_{n\times n}$ (and accordingly replacing $D_n$ with $D_n^\dagger$ corresponding to the diagonal degree matrix associated with $K^\dagger_n$) given by $$\begin{aligned}
K^\dagger_n (X_i,X_j) = \exp\Big(-\frac{\|X_i-X_j\|^2}{2h_ih_j}\Big),\end{aligned}$$ in the SDP . Note that $K^\dagger_n$ is generally no longer a positive semidefinite matrix. Intuitively for $i \in G_{k}^{*}$, the local scaling $h_{i}$ automatically adapts to the local density $p_{k}(X_{i})$ about $X_{i}$, the cluster size $n_k$ and the dimension $q_{k}$ for the $k$-th Riemannian submanifold. Specifically, for each cluster $k=1,\ldots,K$, the $n_k$-by-$n_k$ submatrix $[K_n^\dagger]_{G^\ast_kG^\ast_k}$ resembles the a Gaussian kernel matrix with a homogeneous bandwidth $h_k \asymp (\log  n_k/n_k)^{1/q_k}$ that adapts to the local geometry in ${\mathcal{D}}_k$. For points $X_i$ and $X_j$ belonging to distinct clusters that are properly separated, $K^\dagger_n (X_i,X_j)$ tends to be close to zero and is less affected by the choice of $h_i$ and $h_j$. Heuristically, $h_{i}$ is larger for lower density regions where the degree function of $X_{i}$ is smaller so that the random walk can speed up mixing at such lower density regions. Overall, such a locally adaptive choice of bandwidth improves the mixing time of the random walk within each cluster, while leaves the between cluster jumping probabilities remaining small. As a consequence, the pairwise diffusion affinity matrix $A$ in our SDP formulation  tends to exhibit a clearer block form reflecting the clustering structure. To compute $h_{i}$, we only need to specify $k_{0}$ to replace the (non-adaptive) bandwidth parameter $h$ whose value depend on the unknown cluster sizes $n_{k}$, dimensions $q_{k}$ of submanifolds ${\mathcal{D}}_{k}$, and the underlying probability density functions $p_{k}$ on ${\mathcal{D}}_{k}$. In contrast, the simple choice $k_{0} = \lfloor C \log{n} \rfloor$ guarantees that the local scaling $h_{i}$ adapts to the local density (cf. Theorem \[thm:main\_adaptive\_h\] in Section \[sec:main\_results\]).

Main results {#sec:main_results}
============

In this section, we assume each ${\mathcal{D}}_k$ is a compact connected $q_k$-dimensional Riemannian submanifold embedded in ${\mathbb{R}}^p$ with bounded diameter, absolute sectional curvature value, and injectivity radius. Throughout the rest of the paper, we assume that each $\mu_k$ has a Lipschitz density function $p_k$ with respect to the Riemannian volume measure on ${\mathcal{D}}_k$, such that $$\begin{aligned}
\label{Eqn:density_condition}
c{\leqslant}p_k(x) {\leqslant}\frac{1}{c}\quad \mbox{for all }x\in {\mathcal{D}}_k,\end{aligned}$$ for some constant $c>0$.

Exact recovery of diffusion $K$-means
-------------------------------------

Let $\delta = \min_{1{\leqslant}k\neq k'{\leqslant}K} \|{\mathcal{D}}_k-{\mathcal{D}}_{k'}\|$, where $\|A-B\|=\inf_{x\in A, y\in B} \|x-y\|$ denote the (Euclidean) distance between two disjoint sets $A$ and $B$. Recall that the size of the true cluster $n_{k} =|G_{k}^{*}|$ for $k=1,\ldots,K$ and let $\underline{n} = \min_{1 \le k \le K} n_{k}$ denote the minimal cluster size.

\[thm:main\] Let $c_1,c_2, c_3,c_4,C_1,C_2$ be some positive constants only depending on $S=\bigsqcup_{k=1}^K {\mathcal{D}}_k$, and $c$ some constant that depends on $\max_{1 \le k \le K}q_k$. If $$\label{eqn:bandwidth_condition_nonadaptive}
c_1 (\log n_k/ n_k)^{1/q_k}\,(\log n_k)^{1(q_k=2)/4}{\leqslant}h {\leqslant}c_2 \quad \mbox{for each } k\in[K]$$ for some sufficiently large constant $c_{1}$ and sufficiently small constant $c_{2}$, then we can achieve exact recovery, that is $\hat Z= Z^\ast$, with probability at least $1- c_3K\,\underline{n}^{-c_4}$ as long as $$\begin{aligned}
\label{eqn:exact_recovery_condition_SDP_diffusion_Kmeans_LB_eigenval}
C_1\,nt\, \exp\Big\{-\frac{\delta^2}{2h^2}\Big\} +C_1\,\exp\Big\{-c\, \min_{1 {\leqslant}k {\leqslant}K}\{\lambda_1({\mathcal{D}}_k)\}\, h^2 t\Big\} <  \frac{C_2}{n\, \max_{1 {\leqslant}k {\leqslant}K} \{n_k h^{q_k}\}},\end{aligned}$$ where $\lambda_1({\mathcal{D}}_k)>0$ denotes the second smallest eigenvalue of the Laplace-Beltrami operator (with the minus sign) on ${\mathcal{D}}_k$.

A proof of this theorem is provided in Section \[Sec:proof\_thm\_main\]. A crucial step in the proof is bounding from below the absolute spectral gap of the transition matrix associated with the restricted random walk $\mathcal W_n$ onto each submanifold $\mathcal D_k$ for $k=1,\ldots,K$. We do so by applying a comparison theorem of Markov chains to connect this spectral gap with the eigensystem of the Laplace-Beltrami operator over the submanifold ${\mathcal{D}}_k$ that captures the diffusion geometry. In particular, our proof borrows existing results [@burago2014graph; @trillos2018error] on error estimates of using the spectrum of a random geometric graph to approximate the eigensystem of the Laplace-Beltrami operator in the numerical analysis literature.

\[rem:comments\_condition\_main\_thm\] We begin with comments on the second term on the left hand side of . We point out that this is essentially a mixing condition on random walks over the $K$ submanifolds. In particular, it is due to a relation between the mixing times of the heat diffusion process on each submanifold and its discretized random walk ${\mathcal{W}}_n$ over vertices sampled from the submanifold.

For simplicity, we illustrate this relation for $K = 1$ and ${\mathcal{D}}_{1} = {\mathbb{S}}^{1}$, where ${\mathbb{S}}^{1}$ is the unit circle in ${\mathbb{R}}^{2}$. As a one-dimensional compact smooth manifold (without boundary), ${\mathbb{S}}^{1}$ can be parametrized by the angle $\theta \in [-\pi, \pi)$. Under this parametrization, the density function $u(\tau,\theta)$ of the heat diffusion process on ${\mathbb{S}}^{1}$, as a function of time $\tau$ and location $\theta$, is determined by the corresponding heat equation, $$\label{eqn:heat_eq}
{\partial \over \partial \tau}u(\tau,\theta) + \Delta u(\tau,\theta) = 0, \quad (\tau, \theta) \in (0,\infty) \times {\mathbb{S}}^{1},$$ where $\Delta$ is the Laplace-Beltrami operator on ${\mathbb{S}}^{1}$. Under the same parametrization, the Laplace operator $\Delta = -{{\mathrm{d}}^{2} \over {\mathrm{d}}\theta^{2}}$ on ${\mathbb{S}}^{1}$ (with the minus sign) admits the following eigen-decomposition $$\Delta e^{\iota n \theta} = n^{2} e^{\iota n \theta}, \quad n=0,\pm1,\pm2,\dots,$$ where $\iota = \sqrt{-1}$. That is, $(\lambda_{n}({\mathbb{S}}^{1}), e_{n}) := (n^{2}, e^{\iota n \theta})$ is an eigen-pair of $\Delta$, which implies that $\Delta$ is a positive semidefinite and unbounded operator on $L^{2}({\mathbb{S}}^{1})$ functions.

Now we can solve the heat equation  by expanding it with respect to this orthonormal basis. More precisely, for any $f \in L^{2}({\mathbb{S}}^{1})$, the Fourier transform of $f$ is given by $$f(\theta) = \sum_{n=-\infty}^{\infty} a_{n} e_{n} := \sum_{n=-\infty}^{\infty} \langle f, e_{n} \rangle e_{n},$$ where $\langle f, g \rangle = (2\pi)^{-1} \int_{{\mathbb{S}}^{1}} f(\theta) \overline{g(\theta)} \, {\mathrm{d}}\theta$ is the standard inner product on ${\mathbb{S}}^{1}$. Then the solution to heat equation with the initial distribution $u(0,\theta) = f(\theta)$ is given by $$u(\tau,\theta) = \sum_{n=-\infty}^{\infty} a_{n} e^{-n^{2}\tau} e_{n}.$$ So if ${\mathbb{S}}^{1}$ is insulated, then as $\tau \to \infty$ the heat flow has a constant equilibrium state with the value equal to the average of the initial heat distribution, namely $\lim_{\tau\to\infty} u(\tau,\theta) = (2\pi)^{-1} \int_{{\mathbb{S}}^{1}} f(\theta)\,{\mathrm{d}}\theta$. In particular, the second smallest eigenvalue $\lambda_{1}({\mathbb{S}}^{1})=1$ characterizes the mixing rate of the heat diffusion process.

Now we consider the “inverse Fourier transform" by expressing the solution $u$ in terms of Green’s function, also called the heat kernel, on ${\mathbb{S}}^{1}$ as $$\label{eqn:heat_kernel_unit_circle}
K_{{\mathbb{S}}^{1}}(\tau, \theta, \varphi) = \sum_{n=-\infty}^{\infty}  e^{-n^{2}\tau} {\tilde{e}}^{\iota n (\theta-\varphi)},$$ where $ {\tilde{e}}^{\iota n \theta} = e_{n} / \sqrt{2\pi}$ is the rescaled orthonormal basis of $L^{2}({\mathbb{S}}^{1})$. Then we obtain that $$u(\tau,\theta) = {\mathcal{K}}_{{\mathbb{S}}^{1}}^{\tau} f (\theta), \mbox{ where }  {\mathcal{K}}_{{\mathbb{S}}^{1}}^{\tau} f (\theta) := \int_{{\mathbb{S}}^{1}} K_{{\mathbb{S}}^{1}}(\tau, \theta, \varphi) f(\varphi) \,{\mathrm{d}}\varphi$$ defines an (integral) heat diffusion operator on ${\mathbb{S}}^{1}$. Then the Laplace operator on ${\mathbb{S}}^{1}$ can be seen as the generator of the heat diffusion process: $$\Delta f(\theta) = - \left.{\partial \over \partial \tau}u(\tau,\theta) \right|_{\tau=0} = - \left.{\partial \over \partial \tau}{\mathcal{K}}_{{\mathbb{S}}^{1}}^{\tau}f(\theta) \right|_{\tau=0} = \lim_{\tau \to 0^{+}} {f(x) - {\mathcal{K}}_{{\mathbb{S}}^{1}}^{\tau} f(x) \over \tau}.$$ Similarly, the normalized graph Laplacian $L_n = I_n - P_n = I_n- D_n^{-1} K_n$ corresponding to the random walk ${\mathcal{W}}_n$ over a random sample of $S_n$ on ${\mathbb{S}}^{1}$ can also be seen as a discrete generator of ${\mathcal{W}}_n$.

Recall that in the heat diffusion process, the second smallest eigenvalue $\lambda_{1}({\mathbb{S}}^{1})$ of its generator, i.e., the Laplace-Beltrami operator, characterizes the mixing rate of the heat diffusion process. Similarly, in the random walk ${\mathcal{W}}_n$ (as a discretization of the heat process), the second smallest eigenvalue $\lambda_{j}(L_n)$ of its discrete generator, i.e., the normalized graph Laplacian operator $L_n$, characterizes its mixing rate. From Lemma \[lem:eigenval\_convergence\_normalized\_graph\_Laplacian\], the spectrum of these two operators are related in the sense that for each $j=1,2\dots,$ with probability at least $1-c_{1} n^{-c_{2}}$, $$\lambda_{j}({\mathbb{S}}^{1}) \asymp h^{2} \lambda_{j}(L_n),$$ where $\lambda_{j}({\mathbb{S}}^{1})$ is the $j$-th eigenvalue of $\Delta$ and $\lambda_{j}(L_n)$ is the $j$-th eigenvalue of the normalized graph Laplacian. This means that we must change the time clock unit of the random walk on the graph by multiplying a factor of $h^{2}$ to approximate its underlying heat diffusion process. Thus the term $h^{2}t$ in the second term of is the right time scale $\tau$ for running the heat diffusion process on the manifold, and we need $h^{2}t \to \infty$ for the heat diffusion process converges to an equilibrium distribution. On finite data, this means that the random walk converges to its stationary distribution over the points $S_n$ sampled from the submanifold. Using this correspondence, the second term on the left hand side of is a mixing condition on random walks over the $K$ submanifolds.

The first term on the left hand side of can be seen as a separation requirement of the $K$ disjoint submanifolds ${\mathcal{D}}_{1},\dots,{\mathcal{D}}_{K}$. In particular, if $t = n^{\epsilon}$ for some $\epsilon > 0$ (i.e., we run the random walk in polynomial times/steps), then the minimal separation should obey $$\label{eqn:lower_bound_Delta}
\delta \gtrsim h \sqrt{\log n}$$ in order to achieve the exact recovery for the manifold clustering problem.

Combining the two terms of , we see that steps of the random walk must be properly balanced: we would like the random walk on the similarity graph to sufficiently mix within each cluster (second term of ), while it does not overly mix to merge the true clusters (first term of ). This reflects the [*multi-scale*]{} property of the diffusion $K$-means.

\[rem:thresholding\] In view of the approximation property  of the empirical diffusion affinity matrix $A_{n} = P_{n}^{2t} K_{n}^{-1}$ to a block-diagonal matrix in Remark \[rem:intution\_DKM\], one can show that a simple thresholding of the matrix $A_{n}$ also yields the exact recovery for a properly chosen threshold. Indeed, by the triangle inequality, we have for any $i,j \in G_k^\ast$ in the same cluster, $$[A_n]_{ij} {\geqslant}N_{k}^{-1}  -\max_{1 {\leqslant}k {\leqslant}K} \big\|\,[A_n]_{G_k^\ast G_k^\ast}- N_k^{-1} \mathbf{1}_{G_k^\ast}\mathbf{1}_{G_k^\ast}^T\,\big\|_\infty.$$ Choosing a threshold value $\gamma$ such that $$\label{eqn:thresholding_value}
\max_{1 {\leqslant}k\neq m {\leqslant}K} \|[A_n]_{G_k^\ast G_m^\ast}\|_\infty < \gamma < \min_{1{\leqslant}k{\leqslant}K}\Big\{\frac{1}{N_k}\Big\} - \max_{1 {\leqslant}k {\leqslant}K} \big\|\,[A_n]_{G_k^\ast G_k^\ast}- N_k^{-1} \mathbf{1}_{G_k^\ast}\mathbf{1}_{G_k^\ast}^T\,\big\|_\infty,$$ one can completely separate the block-diagonal entries from the off-diagonal ones, thus achieving exact recovery. This argument leads to the following lemma.

\[lem:thresholding\_master\_bound\] If $$\label{eqn:thresholding_exact_recover_master_condition}
\max_{1 {\leqslant}k\neq m {\leqslant}K} \|[A_n]_{G_k^\ast G_m^\ast}\|_\infty + \max_{1 {\leqslant}k {\leqslant}K} \big\|\,[A_n]_{G_k^\ast G_k^\ast}- N_k^{-1} \mathbf{1}_{G_k^\ast}\mathbf{1}_{G_k^\ast}^T\,\big\|_\infty < \min_{1{\leqslant}k{\leqslant}K}\Big\{\frac{1}{N_k}\Big\},$$ then thresholded estimator on the empirical diffusion affinity matrix $A_{n}$ with the threshold value satisfying  yields exact recovery.

Note that condition  in Lemma \[lem:thresholding\_master\_bound\] is slightly weaker than the master condition  of the SDP relaxed diffusion $K$-means in Lemma \[lem:DKM\_SDP\_master\_bound\] (up to a factor of $K^{-1}$ for balanced clusters, say). On the other hand, thresholding has a tuning parameter $\gamma$ and it is unclear how to develop a principled procedure to choose the threshold value satisfying . On the contrary, our SDP relaxed diffusion $K$-means only requires the knowledge of the number of cluster $K$ and it is tuning-free in that sense.

It is worthy to note that the second smallest eigenvalue of the Laplace-Beltrami operator in condition of Theorem \[thm:main\] can be regarded as characterizations of the connectedness of the submanifolds, where the latter can be formally quantified by the Cheeger isoperimetric constant defined as follows.

Let ${\mathcal{M}}$ be a $q$-dimensional compact Riemannian manifold. Let $\mbox{Vol}({\mathcal{A}})$ denote the volume of a $q$-dimensional submanifold ${\mathcal{A}}\subset {\mathcal{M}}$ and $\mbox{Area}({\mathcal{E}})$ denote the $(q-1)$-dimensional area of a submanifold ${\mathcal{E}}$. The [*Cheeger isoperimetric constant*]{} of ${\mathcal{M}}$ is defined to be $${\mathfrak{h}}({\mathcal{M}}) = \inf_{{\mathcal{E}}} \left\{ \frac{\mbox{Area}({\mathcal{E}})}{\min(\mbox{Vol}({\mathcal{M}}_{1}), \mbox{Vol}({\mathcal{M}}_{2}))} \right\},$$ where the infimum of the normalized manifold cut (in the curly brackets) is taken over all smooth $(q-1)$-dimensional submanifolds ${\mathcal{E}}$ of ${\mathcal{M}}$ that cut ${\mathcal{M}}$ into two disjoint submanifolds ${\mathcal{M}}_{1}$ and ${\mathcal{M}}_{2}$ such that ${\mathcal{M}}= {\mathcal{M}}_{1} \bigsqcup {\mathcal{M}}_{2}$.

In words, ${\mathfrak{h}}({\mathcal{M}})$ quantifies the minimal area of a hypersurface that bisects ${\mathcal{M}}$ into two disjoint pieces (cf. Figure \[fig:diffussion\_dist\]). Smaller values of ${\mathfrak{h}}({\mathcal{M}})$ mean that ${\mathcal{M}}$ is less connected – in particular, ${\mathfrak{h}}({\mathcal{M}}) = 0$ implies that there are two disconnected components in ${\mathcal{M}}$. The Cheeger isoperimetric constant may also be analogously defined for a graph and its value (i.e., the conductance of the graph) is closely related to the normalized graph cut problem. Suppose we have an i.i.d. sample $X_{1},\dots,X_{n}$ drawn from the uniform distribution on ${\mathcal{M}}$ and ${\mathcal{G}}_{n}$ is the neighborhood random graph with an edge between $X_{i}$ and $X_{j}$ if $\|X_{i}-X_{j}\| \le h$. It is shown in [@Arias-CastroPelletierPudlo2012_AAP] that the normalized graph cut (after a suitable normalization) converges to the normalized manifold cut, yielding an asymptotic upper bound on the conductance of ${\mathcal{G}}_{n}$ based on ${\mathfrak{h}}({\mathcal{M}})$. See also [@Trillos:2016_JMLR] for improved results.

\[cor:main\] Under the setting of Theorem \[thm:main\], if $$\begin{aligned}
\label{eqn:exact_recovery_condition_SDP_diffusion_Kmeans_Cheeger}
C_1\,nt\, \exp\Big\{-\frac{\delta^2}{2h^2}\Big\} +C_1\,\exp\Big\{-c\, \underline{{\mathfrak{h}}}^{2}\, h^2 t\Big\} <  \frac{C_2}{n\,\max_{1 {\leqslant}k {\leqslant}K} \{n_kh^{q_k}\}},\end{aligned}$$ where $\underline{{\mathfrak{h}}} = \min_{1 {\leqslant}k {\leqslant}K} {\mathfrak{h}}({\mathcal{D}}_k)$, then $\hat Z= Z^\ast$ with probability at least $1- c_3K\,\underline{n}^{-c_4}$.

Since $\delta$ reflects the separation of the submanifolds of $S = \bigsqcup_{k=1}^{K} {\mathcal{D}}_{k}$ and ${\mathfrak{h}}({\mathcal{D}}_k)$ reflects the degree of connectedness of the submanifold ${\mathcal{D}}_{k}$, the (overall) hardness of the manifold clustering problem is determined by $(\delta, \underline{{\mathfrak{h}}})$. In particular, if $t = n^{\epsilon}$ for some $\epsilon > 0$, then we require that $$\underline{{\mathfrak{h}}} \gtrsim {1 \over h} \sqrt{\log n \over n^{\epsilon}},$$ in addition to . Our results in the rest subsections can also be stated via this geometric quantity of the Cheeger isoperimetric constant.

\[rem:kernel\_choice\] In Theorem \[thm:main\] and Corollary \[cor:main\], the kernel $k$ is assumed to be the Gaussian kernel in . However, these exact recovery results do not rely on the particular choice of the Gaussian kernel. Specifically, Theorem \[thm:main\] and Corollary \[cor:main\] still hold, as long as the kernel is isotropic and satisfies the exponential decay in the squared Euclidean distance. For the heat kernel on ${\mathbb{R}}$ (i.e., Green’s function associated with the heat equation on ${\mathbb{R}}$) $$\label{eqn:heat_kernel_real_line}
H(\tau,x,y) = (4\pi \tau)^{-1/2} e^{-{(x-y)^{2} \over 4\tau}}, \quad x,y \in {\mathbb{R}},$$ it can be viewed as an approximation to the short time dynamics of the heat kernel  on ${\mathbb{S}}^{1}$ in Remark \[rem:comments\_condition\_main\_thm\] as $\tau \to 0^{+}$ (cf. Chapter 1 in [@Rosenberg1997]). Hence, we can approximate the short time behavior of the heat flow on the compact manifold ${\mathbb{S}}^{1}$ by that of the non-compact manifold ${\mathbb{R}}$, where the latter is governed by the Gaussian heat kernel on ${\mathbb{R}}$. Setting $h^{2} = 2\tau$ in and noticing that the normalization $(4\pi \tau)^{-1/2}$ does not affect the results in Theorem \[thm:main\] and Corollary \[cor:main\] since the SDP solution in is invariant under scaling. Thus the bandwidth parameter in the Gaussian kernel in has the time scale interpretation in terms of the heat flow dynamics, in addition to capturing the local neighborhood geometry of the submanifolds.

Exact recovery of the regularized and localized diffusion $K$-means
-------------------------------------------------------------------

In this subsection, we extend the exact recovery results to the two variants of the diffusion $K$-means. First, we consider the regularized diffusion $K$-means  that does not require knowledge of the true number of clusters $K$.

\[thm:main\_adaptive\_lambda\] Suppose all conditions in Theorem \[thm:main\] are true. In addition, if the regularization parameter satisfies $$\begin{aligned}
\label{Eqn:lambda_condition}
C_1\,nt\, \exp\Big\{-\frac{\delta^2}{2h^2}\Big\} &+C_1\,\exp\Big\{-c\, \min_{1 {\leqslant}k {\leqslant}K}\{\lambda_1({\mathcal{D}}_k)\}\, h^2 t\Big\} < \lambda {\leqslant}\frac{C_2}{n\max_{1 {\leqslant}k {\leqslant}K}\{n_kh^{q_k}\}},\end{aligned}$$ then we can achieve exact recovery for $\tilde{Z}$ from the regularized diffusion $K$-means with probability at least $1- c_3K\,\underline{n}^{-c_4}$.

Condition , as a sufficient condition for the exact recovery, provides some justification of our $\lambda$ selection Algorithm \[alg1\], in particular, the reason of why using the logarithmic scale. More precisely, we observe from Lemma \[lem:feasibility\_SDP\_lambda\_infinity\] that an upper bound for $\lambda$ to produce non-trivial clustering is $n^{-1}$ times the largest eigenvalue of the affinity matrix $A$ in the SDP, which is of order $n^{-1}\max_{k}\{n_kh^{q_k}\}^{-1} =\mathcal O((n\log n)^{-1})$ (from the approximating form  and Lemma \[Lemma:total\_degree\] in the proof of Theorem \[thm:main\]). As a consequence, in the original scale, the interval length of those $\lambda$ that underestimates $K$ is of order $(n\log n)^{-1}$, which is comparable to the range of $\lambda$ corresponding to exact recovery (correct $K$) implied by  as $(n\log n)^{-1}$. On the other hand, the range of $\lambda$ corresponding to exact recovery will dominate if we instead consider the logarithmic scale. Precisely, on the logarithmic scale, the interval length for underestimating $K$ is of order $\log n$, while the range of $\log \lambda$ implied by  becomes $\log n - C'\,\big(\log n - \min\big\{\delta^2/(2h^2), \min_{1 {\leqslant}k {\leqslant}K}\{\lambda_1({\mathcal{D}}_k)\}\, h^2 t\big\}\big)$, which is of order $\Omega(n^{\iota})$ for some constant $C'>0$ and $\iota>0$ as long as both $\delta^2/h^2$ and $h^2t$ are bounded below by $n^{\iota}$. (The latter requirement can be easily satisfied, for example, in our simulations the choice of $t=n^{1.2}$ is good enough to produce robust results.) In particular, this suggests that the interval length of $\log \lambda$ for exact recovery is proportional to $\delta^2/h^2$, which can be viewed as a signal-to-noise ratio characteristic.

Now let us turn to the localized diffusion $K$-means that locally selects the node-wise bandwidth adapting to the local geometric structure.

\[thm:main\_adaptive\_h\] Let $\delta_{kk'}=\|{\mathcal{D}}_k-{\mathcal{D}}_{k'}\|$. If the number of neighbor parameter $k_0$ satisfies $k_0=\lfloor C\log n\rfloor$ for some constant $C>0$, and $$\delta_{kk'} {\geqslant}C'\, \max\{(\log n/ n_k)^{1/q_k},(\log n/ n_{k'})^{1/q_{k'}}\}$$ for each distinct $k,k'\in[K]$, then with probability at least $1- c_3K\,\underline{n}^{-c_4}$, the followings are true. (1) For each $i\in G^\ast_k$, its local bandwidth parameter $h_i$ satisfies $$\begin{aligned}
\label{Eqn:local_h_nounds}
c_1 (\log n/ n_k)^{1/q_k}{\leqslant}h_i {\leqslant}c_2 (\log n/ n_k)^{1/q_k}.\end{aligned}$$ (2) We can achieve exact recovery for $\tilde{Z}$ from the localized diffusion $K$-means as long as $$\begin{aligned}
&C_1\,nt\, \exp\Big\{-c\,\Big(\min_{k,k'\in[K]}\frac{\delta_{kk'}}{\max\{(\log n/ n_k)^{1/q_k},(\log n/ n_{k'})^{1/q_{k'}}\}}\Big)^2\Big\}\notag \\
&\qquad\qquad\qquad+C_1\,\exp\Big\{-c\, \min_{1 {\leqslant}k {\leqslant}K}\{\lambda_1({\mathcal{D}}_k)\, (\log n/ n_k)^{2/q_k}\}\, t\Big\} <  \frac{C_2}{n\log n}.\label{eqn:local_condition}\end{aligned}$$

\[rem:localization\] The first result  Part (1) in Theorem \[thm:main\_adaptive\_h\] shows that our localized selection scheme via nearest neighbors truly leads to bandwidth adaptation to the unknown submanifold dimension $q_k$ and the unknown true cluster size $n_k$, by only sacrificing a $\log n$ term (from $\log n_k$ to $\log n$ as compared with the optimal bandwidth choice $(\log n_k/ n_k)^{1/q_k}$ from Theorem \[thm:main\]). The second result Part (2) in Theorem \[thm:main\_adaptive\_h\] indicates the advantages of using the localized node-wise bandwidth, by comparing the condition   with those in Theorem \[thm:main\]. In particular, in order for the lower bound condition on the global bandwidth $h$ in Theorem \[thm:main\] to hold, the smallest $h$ would be $\max_{k} h_k$, where $h_k=(\log n_k/n_k)^{q_k}$ denotes the optimal bandwidth in the $k$-th cluster ${\mathcal{D}}_k$. Note that this lower bound on $h$ is uniformly larger than the magnitudes of localized bandwidth provided in . As a consequence, this large $h$ would require the same separation condition as $\delta_{kk'} {\geqslant}\max_{k}h_k$ for each pair $({\mathcal{D}}_k,{\mathcal{D}}_{k'})$ of distinct clusters. In comparison, the new sufficient condition  for exact recovery only needs a cluster-dependent separation condition as $\delta_{kk'} {\geqslant}\max\{h_k,h_{k'}\}$, which can be substantially weaker than $\delta_{kk'} {\geqslant}\max_{k}h_k$ if clusters are highly unbalanced with unequal sizes and mixed dimensions.

Finally, we can further combine the regularized diffusion $K$-means with local adaptive bandwidths into the *localized and regularized diffusion $K$-means*. The following result is an immediate consequence by combining the proofs of Theorem \[thm:main\_adaptive\_lambda\] and Theorem \[thm:main\_adaptive\_h\], and thus its proof is omitted.

\[thm:main\_adaptive\] Suppose all conditions in Theorem \[thm:main\] and Theorem \[thm:main\_adaptive\_h\] are true. In addition, if the regularization parameter satisfies $$\begin{aligned}
&C_1\,nt\, \exp\Big\{-c\,\Big(\min_{k,k'\in[K]}\frac{\delta_{kk'}}{\max\{(\log n/ n_k)^{1/q_k},(\log n/ n_{k'})^{1/q_{k'}}\}}\Big)^2\Big\} \notag\\
&\qquad\qquad\qquad+C_1\,\exp\Big\{-c\, \min_{1 {\leqslant}k {\leqslant}K}\{\lambda_1({\mathcal{D}}_k)\, (\log n/ n_k)^{2/q_k}\}\, t\Big\}< \lambda {\leqslant}\frac{C_2}{n\log n},\label{Eqn:local_lambda_condition}\end{aligned}$$ then we can achieve exact recovery for $\tilde{Z}$ from the localized and regularized diffusion $K$-means with probability at least $1- c_3K\,\underline{n}^{-c_4}$.

\[rem:bandwidth\_adaptivity\] It is interesting to note the signal separation and random walk mixing of the localized diffusion $K$-means and its regularized version are adaptive to local probability density and local geometric structures of the Riemannian submanifolds. In [@Arias-Castro2011_IEEETIT], nearly-optimal exact recovery of a collection of clustering methods based on pairwise distances of data is derived under a condition that the [*minimal*]{} signal separation strength over all pairs of submanifolds is larger than a threshold (even for their local scaling version, cf. Proposition 3 therein). Thus results established in [@Arias-Castro2011_IEEETIT] are non-adaptive to the local density and (geometric) structures of the submanifolds. In addition, the $\max_k\{n_k h_k^{q_k}\}$ on the right hand side of now reduces to $\log(n)$ as in . This means that the localized diffusion $K$-means tends to increase the signal-to-noise ratio (cf. Remark \[rem:localization\]) as well as the upper bound on $\lambda$ for exact recovery, thereby widening the interval length of $\log(\lambda)$ corresponding to the true clustering structure and improves the performance of the $\lambda$ selection Algorithm \[alg1\].

Simulations {#sec:simulations}
===========

In this section, we assess the empirical performance of the diffusion $K$-means on some simulation examples. We generate $n=768$ data points from the following three data generation mechanisms (DGPs).

The clustering structure contains three disjoint submanifolds:

-   ${\mathcal{D}}_{1} = \mbox{unit disk}$ and $n/4$ data points are uniformly sampled on ${\mathcal{D}}_{1}$,

-   ${\mathcal{D}}_{2} = \mbox{annulus with radius } 2.5$ and $n/4$ data points are uniformly sampled on ${\mathcal{D}}_{2}$,

-   ${\mathcal{D}}_{3} = \mbox{annulus with radius } 4$ and $n/2$ data points are uniformly sampled on ${\mathcal{D}}_{3}$,

where all ${\mathcal{D}}_{1},{\mathcal{D}}_{2},{\mathcal{D}}_{3}$ are centered at the origin $(0,0)$.

The clustering structure contains three disjoint rectangles:

-   ${\mathcal{D}}_{1} = \{(-15,-8), (-15,8), (-8,8), (8,8)\}$,

-   ${\mathcal{D}}_{2} = \{(10,3), (10,8), (15,3), (15,8)\}$,

-   ${\mathcal{D}}_{3} = \{(10,-8), (10,-3), (15,-8), (15,-3)\}$,

where data points are uniformly distributed on ${\mathcal{D}}_{1} \bigsqcup {\mathcal{D}}_{2} \bigsqcup {\mathcal{D}}_{3}$.

The clustering structure is a mixture of three bivariate Gaussians: $$\alpha_{1} N(\mu_{1}, \sigma_{1}^{2} {\text{Id}}_{2}) + \alpha_{2} N(\mu_{2}, \sigma_{2}^{2} {\text{Id}}_{2}) + \alpha_{3} N(\mu_{3}, \sigma_{3}^{2} {\text{Id}}_{2}),$$ where $(\alpha_{1}, \alpha_{2}, \alpha_{3}) = (1/3, 1/3, 1/3)$, $\mu_{1} = (-6,0), \mu_{2} = (0,0), \mu_{3} = (2.5,0)$, $\sigma_{1} = 2$, and $\sigma_{2} = \sigma_{3} = 0.5$.

Our simulation setups are similar to [@zelnik2005self; @NadlerGalun2006_NIPS]. Note that the sampling density in DGP 1 and 2 is uniform on the disjoint submanifolds, the hardness of the problems is mainly determined by the geometry, and we thus expect the diffusion $K$-means and its localized version can both succeed in these two cases. In addition, since DGP 1 contains two annuli that are less connected than the rectangles and ellipsoids, we expect that, for the localized diffusion $K$-means (with self-tuned bandwidths), more random walk steps are needed for DGP 1 to correctly identify the clusters than those for DGP 2 and DGP 3. In our simulation studies, we use $t = n^{2}$ for DPG 1 and $t = n^{1.2}$ for both DGP 2 and DGP 3 (all with local scaling). Further, DGP 3 has a mixture of Gaussian densities, the local scaling is expected to improve the performance of the diffusion $K$-means. In fact, we have observed in Figure \[fig:diffusion\_kmeans\_local\_scaling\_demo\] that the diffusion $K$-means without local scaling does not work for DGP 2. It is also known that spectral clustering methods fail on such setup [@NadlerGalun2006_NIPS]. Thus we do not report results on DGP 2 without local scaling for all competing methods since it does not provide meaningful comparisons with other setups.

For the SDP relaxed diffusion $K$-means clustering methods, we report the $\ell^{1}$ estimation error for estimating the true clustering membership $Z^{*}$ and the (normalized) Hamming distance error for classifying the clustering labels. In each setup, our results are reported on 1,000 simulations. For brevity, DKM stands for the diffusion $K$-means, RDKM for the (nuclear norm) regularized diffusion $K$-means, LDKM for the localized diffusion $K$-means, and LRDKM for the localized and regularized diffusion $K$-means. In the cases of no local scaling, the steps of random walks is fixed as $t = n^{1.2}$ in all setups. In the cases of local scaling, the nearest neighborhood size is chosen as $\lfloor \log{n} \rfloor$ for DPG 1 and DGP 3, and as $\lfloor 0.5 \log{n} \rfloor$ for DGP 2.

For the comparison purpose, we also include three spectral clustering methods: the unnormalized spectral clustering (SC-UN), the random walk normalized spectral clustering (SC-RWN) [@ShiMalik2000_IEEEPAMI], a symmetrically normalized spectral clustering (SC-NJW) proposed in [@NgJordanWeiss2001_NIPS]. For each spectral clustering method, we also consider their localized versions (LSC-UN, LSC-RWN, LSC-NJW) by replacing the kernel matrix $K_{n}$ with $K^{\dagger}_{n}$.

We can draw several observations from the simulation studies. First, the estimation error agrees well with our exact recovery theory for SDP relaxed DKM and LDKM, given the number of clusters (cf. Table \[tab:estimation\_errors\]). Second, all methods works relatively better for DGP 1 and DGP 2 since the separation signal strength is stronger than DGP 3 (cf. Table \[tab:classification\_errors\]). Third, the RDKM and LRDKM perform well in selecting the true number of clusters (cf. Table \[tab:percentages\_correctly\_estimated\_noc\]).

We also modify DGP 3 to make the problem harder. We consider the mixture of three Gaussian with parameters $(\alpha_{1}, \alpha_{2}, \alpha_{3}) = (1/4, 1/4, 1/2)$, $\mu_{1} = (-6,0), \mu_{2} = (0,0), \mu_{3} = (1.45,0)$, $\sigma_{1} = 2$, and $\sigma_{2} = \sigma_{3} = 0.5$. This setup is denoted as DGP 3’. For DGP 3’, LDKM has much smaller classification errors than all spectral methods with local scaling (i.e., LSC-UN, LSC-RWN, LSC-NJW); see last column of Table \[tab:classification\_errors\].

  ------ ------------------------- ------------------------- -----------
                                                             
                   DGP=1                     DGP=2              DGP=3
   DKM    $4.7642 \times 10^{-6}$   $3.3258 \times 10^{-4}$   [**–**]{}
   LDKM   $5.2835 \times 10^{-5}$           0.0049             0.0451
  ------ ------------------------- ------------------------- -----------

  : $\ell^{1}$ estimation errors of the SDP solutions of various diffusion $K$-means clustering methods.[]{data-label="tab:estimation_errors"}

  --------- ------- ------------------------- ----------- -----------
                                                          
             DGP=1            DGP=2              DGP=3      DGP=3’
     DKM       0     $1.3021 \times 10^{-4}$   [**–**]{}   [**–**]{}
    SC-UN      0                0              [**–**]{}   [**–**]{}
   SC-RWN      0                0              [**–**]{}   [**–**]{}
   SC-NJW      0                0              [**–**]{}   [**–**]{}
    LDKM       0             0.0018             0.0086      0.0594
   LSC-UN      0     $4.7917 \times 10^{-4}$    0.0098      0.0801
   LSC-RWN     0             0.0016             0.0105      0.0802
   LSC-NJW     0             0.0399             0.0084      0.0884
  --------- ------- ------------------------- ----------- -----------

  : Classification errors of various diffusion $K$-means and spectral clustering methods.[]{data-label="tab:classification_errors"}

   Method   DGP=1    DGP=2      DGP=3
  -------- -------- -------- -----------
    RDKM    94.30%   95.10%   [**–**]{}
   LRDKM    99.20%   83.10%    97.70%

  : Percentages of correctly estimated number of clusters by the regularized diffusion $K$-means and its local scaling version.[]{data-label="tab:percentages_correctly_estimated_noc"}

Proofs {#sec:proofs}
======

Recall that $n_k=|G_k^\ast|$ is the size of $k$-th true cluster index set $G_k^\ast$, and let $N_k = \sum_{i,j\in G_k^\ast} \kappa(X_i,\,X_j)$ denote the total within-weight in $G_k^\ast$. For any subset $G\subset [n]$, we use $\mathbf{1}_{G}$ to denote the all-one vector whose size equal to the size of $G$.

Proof of Theorem \[thm:main\] {#Sec:proof_thm_main}
-----------------------------

For simplicity of notation, we use $A:=A_n$ to denote the empirical diffusion affinity matrix $P_n^{2t}D_n^{-1}$ in the proof, and recall $$\begin{gathered}
\hat{Z} = \operatorname{argmax}\left\{ \langle A, Z \rangle : Z \in {\mathscr{C}}_K \right\} \\
\qquad \mbox{with } {\mathscr{C}}_K = \{Z \in {\mathbb{R}}^{n \times n} : Z^{T} = Z, Z \succeq 0, \operatorname{tr}(Z) = K, Z {\mathbf{1}}_{n} = {\mathbf{1}}_{n}, Z {\geqslant}0 \}, 
\end{gathered}$$ At a high level, our strategy is to show that for suitably large $t\in{\mathbb{N}}_{+}$, the matrix $A_n$ tends to become close to a block-diagonal matrix, where each diagonal block tends to be a constant matrix (cf. equation ). Based on this approximation, we expect the global optimum $\hat Z$ to share a similar block-diagonal structure, thereby recovers the true membership matrix $Z^\ast$ in  which takes the form of $$\begin{aligned}
Z^\ast = \begin{pmatrix} 
\displaystyle \frac{1}{n_1} \mathbf{1}_{G_1^\ast} \mathbf{1}^T_{G_1^\ast} & 0 & \cdots & 0\\
0 & \displaystyle \frac{1}{n_2} \mathbf{1}_{G_2^\ast} \mathbf{1}^T_{G_2^\ast} & \cdots & 0\\
\vdots & \vdots & \ddots & \vdots \\
0 & \cdots & 0 & \displaystyle \frac{1}{n_K} \mathbf{1}_{G_K^\ast} \mathbf{1}^T_{G_K^\ast}
\end{pmatrix}.\end{aligned}$$

To put this intuition in a technical form, since $Z^\ast$ defined in  is also a feasible solution belonging to the convex set ${\mathscr{C}}_K$, we have by the optimality of $\hat Z$ that $$\begin{aligned}
\label{Eqn:basic_ineq}
0{\leqslant}\langle A_n,\, \hat Z - Z^\ast\rangle =\sum_{1{\leqslant}k\neq m{\leqslant}K} \big\langle\, [A_n]_{G_k^\ast G_m^\ast},\, [\hat Z - Z^\ast]_{G_k^\ast G_m^\ast}\,\big\rangle + \sum_{k=1}^K \big\langle\, [A_n]_{G_k^\ast G_k^\ast},\, [\hat Z - Z^\ast]_{G_k^\ast G_k^\ast}\,\big\rangle.\end{aligned}$$ We analyze the two sums separately as follows.

[**The first sum:**]{} By noticing that $Z^\ast_{G_k^\ast G_m^\ast}$ is a zero matrix for each pair $k\neq m \in [K]$, we have the following bound $$\begin{aligned}
&\sum_{1{\leqslant}k\neq m{\leqslant}K} \big\langle\, [A_n]_{G_k^\ast G_m^\ast},\, [\hat Z - Z^\ast]_{G_k^\ast G_m^\ast}\,\big\rangle \notag \\
= &\,\sum_{1{\leqslant}k\neq m{\leqslant}K} \big\langle\, [A_n]_{G_k^\ast G_m^\ast},\, \hat Z_{G_k^\ast G_m^\ast}\,\big\rangle 
{\leqslant}\max_{1{\leqslant}k\neq m{\leqslant}K} \|[A_n]_{G_k^\ast G_m^\ast}\|_\infty \, \sum_{1{\leqslant}k\neq m{\leqslant}K} \|\hat Z_{G_k^\ast G_m^\ast}\|_1,\label{eqn:k_neq_m}\end{aligned}$$ where the leading factor $\max_{k\neq m} \|[A_n]_{G_k^\ast G_m^\ast}\|_\infty$ is expected to be small due to the approximating structure .

[**The second sum:**]{} Since we expect the $k$th block $[A_n]_{G_k^\ast G_k^\ast}$ of $A_n$ in the diagonal to be close to $N_k^{-1} \mathbf{1}_{G_k^\ast} \mathbf{1}^T_{G_k^\ast}$, we can subtract and add the same term to decompose it into $$\begin{aligned}
&\sum_{k=1}^K \big\langle\, [A_n]_{G_k^\ast G_k^\ast},\, [\hat Z - Z^\ast]_{G_k^\ast G_k^\ast}\,\big\rangle\\
= &\, \sum_{k=1}^K \big\langle\, [A_n]_{G_k^\ast G_k^\ast} - N_k^{-1} \mathbf{1}_{G_k^\ast}\mathbf{1}_{G_k^\ast}^T,\, [\hat Z - Z^\ast]_{G_k^\ast G_k^\ast}\,\big\rangle
+ \sum_{k=1}^K N_k^{-1} \,\big\langle\, \mathbf{1}_{G_k^\ast}\mathbf{1}_{G_k^\ast}^T,\, [\hat Z - Z^\ast]_{G_k^\ast G_k^\ast}\,\big\rangle.\end{aligned}$$ The first term on the right hand side can be bounded by applying Hölder’s inequality, $$\begin{aligned}
\sum_{k=1}^K& \big\langle\, [A_n]_{G_k^\ast G_k^\ast} - N_k^{-1} \mathbf{1}_{G_k^\ast}\mathbf{1}_{G_k^\ast}^T,\, [\hat Z - Z^\ast]_{G_k^\ast G_k^\ast}\,\big\rangle \\
&\,{\leqslant}\max_{1 {\leqslant}k {\leqslant}K} \big\|\,[A_n]_{G_k^\ast G_k^\ast}- N_k^{-1} 1_{G_k^\ast}1_{G_k^\ast}^T\,\big\|_\infty \, \sum_{k=1}^K \big\|\, [\hat Z -Z^\ast]_{G_k^\ast G_k^\ast}\big\|_1,\end{aligned}$$ where again the leading factor $\max_{k} \big\|\,[A_n]_{G_k^\ast G_k^\ast}- N_k^{-1} \mathbf{1}_{G_k^\ast}\mathbf{1}_{G_k^\ast}^T\,\big\|_\infty $ is expected to be small due to the approximating structure . Now consider the second term. By the definition of ${\mathscr{C}}_K$, the sums of entries in each row of $\hat Z$ and $Z^\ast$ are equal (to one), we have for fixed $k\in[K]$ and each $i\in G^\ast_k$, $$\begin{aligned}
\sum_{j\in G_k^\ast} [\hat Z - Z^\ast]_{ij} + \sum_{j\not\in G_k^\ast} [\hat Z - Z^\ast]_{ij}=0.\end{aligned}$$ Since $Z^\ast_{ij}=0$ for each pair $(i,j)$ with $i\in G_k^\ast$ and $j\notin G_k^\ast$, and $\hat Z$ has nonnegative entries, we can sum up the preceding display over all $i\in G_k^\ast$ to obtain $$\begin{aligned}
\big\langle\, \mathbf{1}_{G_k^\ast}\mathbf{1}_{G_k^\ast}^T,\, [\hat Z - Z^\ast]_{G_k^\ast G_k^\ast}\,\big\rangle = - \sum_{m:\,m\neq k} \|\hat Z_{G_k^\ast G_m^\ast}\|_1,\quad \forall k\in[K].\end{aligned}$$ Putting pieces together, we obtain $$\label{Eqn:k_eq_m}
\begin{aligned}
&\sum_{k=1}^K \big\langle\, [A_n]_{G_k^\ast G_k^\ast},\, [\hat Z - Z^\ast]_{G_k^\ast G_k^\ast}\,\big\rangle  \\
{\leqslant}&\, \max_{1 {\leqslant}k {\leqslant}K} \big\|\,[A_n]_{G_k^\ast G_k^\ast}- N_k^{-1} \mathbf{1}_{G_k^\ast}\mathbf{1}_{G_k^\ast}^T\,\big\|_\infty \, \sum_{k=1}^K \big\|\, [\hat Z -Z^\ast]_{G_k^\ast G_k^\ast}\big\|_1- \sum_{1{\leqslant}k\neq m{\leqslant}K} \frac{1}{N_k}\|\hat Z_{G_k^\ast G_m^\ast}\|_1. 
\end{aligned}$$ Now by combining inequalities , and , we can reach the following inequality $$\label{Eqn:key_ineq}
\begin{aligned}
&\sum_{1{\leqslant}k\neq m{\leqslant}K} \frac{1}{N_k}\|\hat Z_{G_k^\ast G_m^\ast}\|_1 {\leqslant}\max_{1 {\leqslant}k\neq m {\leqslant}K} \|[A_n]_{G_k^\ast G_m^\ast}\|_\infty \, \sum_{1{\leqslant}k\neq m{\leqslant}K} \|\hat Z_{G_k^\ast G_m^\ast}\|_1\\
&\qquad \qquad\qquad +\max_{1 {\leqslant}k {\leqslant}K} \big\|\,[A_n]_{G_k^\ast G_k^\ast}- N_k^{-1} \mathbf{1}_{G_k^\ast}\mathbf{1}_{G_k^\ast}^T\,\big\|_\infty \, \sum_{k=1}^K \big\|\, [\hat Z -Z^\ast]_{G_k^\ast G_k^\ast}\big\|_1.
\end{aligned}$$ Since $\hat{Z} \in {\mathscr{C}}_{K} \subset {\mathscr{C}}$, according to inequalities - in Lemma \[lem:some\_ineq\_feasible\_set\] in Appendix C, $$\begin{aligned}
\label{eqn:DKM_SDP_another_core_inequality}
\sum_{1{\leqslant}k\neq m{\leqslant}K} \frac{1}{n_k}\|\hat Z_{G_k^\ast G_m^\ast}\|_1 {\geqslant}\frac{1}{n}\,\big\|\hat Z - Z^\ast\big\|_1.\end{aligned}$$ The last two displays  and  imply the exact recovery $\hat Z=Z^\ast$ as long as $$\label{eqn:DKM_SDP_exact_recover_master_condition}
\max_{1 {\leqslant}k\neq m {\leqslant}K} \|[A_n]_{G_k^\ast G_m^\ast}\|_\infty + \max_{1 {\leqslant}k {\leqslant}K} \big\|\,[A_n]_{G_k^\ast G_k^\ast}- N_k^{-1} \mathbf{1}_{G_k^\ast}\mathbf{1}_{G_k^\ast}^T\,\big\|_\infty < \frac{1}{n}\,\min_{1{\leqslant}k{\leqslant}K}\Big\{\frac{n_k}{N_k}\Big\}.$$

\[lem:DKM\_SDP\_master\_bound\] If  holds, then we can achieve exact recovery $\hat{Z} = Z^{*}$.

To further proceed, we will make use of following two lemmas to provide high probability bounds for the empirical diffusion affinity entries deviating from their expectations. Proofs of Lemma \[lem:within\_cluster\_random\_walk\] and \[lem:between\_cluster\_random\_walk\] are deferred to the following subsections.

\[lem:within\_cluster\_random\_walk\] Let $\kappa = \max_{1{\leqslant}k\neq k'{\leqslant}K}\sup_{x\in {\mathcal{D}}_k,\,x'\in {\mathcal{D}}_{k'}} \kappa(x,\,x')$ and $\tau = \inf_{x,y\in S:\, \|x-y\| {\leqslant}h} \kappa(x,y)$. If $c_1 (\log n_k/ n_k)^{1/q_k}\,(\log n_k)^{1(q_k=2)/4}{\leqslant}h$, then it holds with probability at least $1-c_2\,n_k^{-c_3}$ that $$\begin{aligned}
\big\|\,[A_n]_{G_k^\ast G_k^\ast}- N_k^{-1} \mathbf{1}_{G_k^\ast}\mathbf{1}_{G_k^\ast}^T\,\big\|_\infty {\leqslant}C_0\, t\,(n_k\, h^{q_k})^{-2} \,n\,\kappa+ C_0\, (n_k\,h^{q_k})^{-1}\, e^{-2t\,\gamma(P_{n,k})},\end{aligned}$$ where the spectral gap $\gamma(P_{n,k})$, defined as one minus the second largest eigenvalue of $P_{n,k}$, satisfies $$\begin{aligned}
\label{Eqn:Spectral_gap_lower}
\gamma(P_{n,k}) {\geqslant}\bigg(1- C\,\Big(c_1^{-1}+(\sqrt{\lambda_1({\mathcal{D}}_k)} + 1)\,h+ h^2\Big)\bigg)\,\tau \,  C_k \, \lambda_1({\mathcal{D}}_k)\,h^2,\end{aligned}$$ for some constants $C_0,C>0$ that only depends on ${\mathcal{D}}_k$ and $p_k$ and $C_k$ only depends on $q_k$. Here $\lambda_1({\mathcal{D}}_k)>0$ is the second smallest eigenvalue of the Laplace-Beltrami operator on ${\mathcal{D}}_k$ (cf. Section \[subsec:Laplace-Beltrami\_operator\]).

\[lem:between\_cluster\_random\_walk\] Let $\kappa = \max_{1{\leqslant}k\neq k'{\leqslant}K}\sup_{x\in {\mathcal{D}}_k,\,x'\in {\mathcal{D}}_{k'}} \kappa(x,\,x')$. Suppose conditions  and  in Theorem \[thm:main\] are satisfied. Then it holds with probability at least $1 - c_2 K\, \underline{n}^{-c_3}$ that $$\begin{aligned}
\|[A_n]_{G_k^\ast G_m^\ast}\|_\infty {\leqslant}C\, t \, (n_k h^{q_k}\,n_m h^{q_m})^{-1}\,n\,\kappa,
\quad\forall k\neq m \in[K],\end{aligned}$$ where recall $\underline n = \min_{k\in [K]} n_k$ and $C$ is a constant only depending on $\{{\mathcal{D}}_k, \mu_k\}_{k = 1}^{K}$.

Recall that $\kappa(x,y) = \exp\{-\|x-y\|^2/(2h^2)\}$ is the Gaussian kernel. Consequently, we may choose $\kappa = \exp\{-\delta^2/(2h^2)\}$ and $\tau = e^{-1/2}$ in these two lemmas. By Weyl’s law for the growth of eigenvalues of the Laplace-Beltrami operator (cf. Remark 6 in [@trillos2018error]), we have $\lambda_{j}({\mathcal{D}}_{k}) \sim j^{2/q_{k}}$. Thus $\lambda_1({\mathcal{D}}_k)$ is bounded. Since the bandwidth parameter satisfies $c_1 (\log n_k/ n_k)^{1/q_k}\,(\log n_k)^{1(q_k=2)/4}{\leqslant}h {\leqslant}c_2$ for some sufficient large constant $c_1$ and sufficiently small constant $c_2$ for all $k \in[K]$, inequality  in Lemma \[lem:within\_cluster\_random\_walk\] becomes $$\begin{aligned}
\gamma(P_{n,k}) {\geqslant}C_k \, \lambda_1({\mathcal{D}}_k)\,h^2,\quad\forall k\in[K],\end{aligned}$$ for some constant $C_k$ only depending on $q_k$. Therefore, the following two bounds hold with probability at least $1 - c_2 K\, \underline{n}^{-c_3}$, $$\begin{aligned}
\max_{1 {\leqslant}k {\leqslant}K} \big\|\,[A_n]_{G_k^\ast G_k^\ast}- N_k^{-1} \mathbf{1}_{G_k^\ast}\mathbf{1}_{G_k^\ast}^T\,\big\|_\infty &{\leqslant}C\, nt\,\exp\Big\{-\frac{\delta^2}{2h^2}\Big\}+ C\,  \exp\Big\{-c\, \min_{1 {\leqslant}k {\leqslant}K}\{\lambda_1({\mathcal{D}}_k)\}\, h^2 t\Big\},\\
\max_{1{\leqslant}k\neq m{\leqslant}K}\|[A_n]_{G_k^\ast G_m^\ast}\|_\infty & {\leqslant}C\,nt\,\exp\Big\{-\frac{\delta^2}{2h^2}\Big\},\end{aligned}$$ for some constant $C$ only depending on $\{{\mathcal{D}}_k, \mu_k\}_{k = 1}^{K}$ and $c$ only on $\{q_k\}_{k=1}^K$. The last two inequalities combining with Lemma \[lem:DKM\_SDP\_master\_bound\] imply the exact recovery $\hat Z=Z^\ast$ as long as $$\begin{aligned}
C\,nt\, \exp\Big\{-\frac{\delta^2}{2h^2}\Big\} +C\,\exp\Big\{-c\, \min_{1 {\leqslant}k {\leqslant}K}\{\lambda_1({\mathcal{D}}_k)\} \, h^2 t\Big\} < \frac{1}{n}\,\min_{1{\leqslant}k{\leqslant}K}\Big\{\frac{n_k}{N_k}\Big\}. \end{aligned}$$ Finally, the claimed result follows from the preceding display and the following lemma of a high probability bound on $N_k$, whose proof is postponed to Section \[Sec:Proof\_total\_degree\].

\[Lemma:total\_degree\] Suppose the density $p_{k}$ satisfies  and the bandwidth $h {\leqslant}c$ for some constant $c>0$. Then it holds with probability at least $1-c_2\,n_k^{-c_3}$ that $$\begin{aligned}
\bigg| \frac{N_k}{n_k} - (\sqrt{2\pi}\, h)^{q_k} \,n_k \beta_k\bigg| {\leqslant}C \left(  n_{k} h^{q_{k}+1} + \sqrt{n_kh^{q_k}\log n_k} \right), \end{aligned}$$ where $\beta_k = \mathbb E_{X\sim p_k}[p_k(X)]$ and $C>0$ is a constant depends only on $p_{k}, {\mathcal{D}}_{k}$, and $c$.

Proof of Corollary \[cor:main\]
-------------------------------

Corollary \[cor:main\] follows from Theorem \[thm:main\] and the Cheeger inequality [@Cheeger1970]: $$\lambda_{1}({\mathcal{D}}_{k}) {\geqslant}\frac{{\mathfrak{h}}({\mathcal{D}}_{k})^{2}}{4}.$$

Proof of Theorem \[thm:main\_adaptive\_lambda\] {#Sec:proof_thm_main_adaptive}
-----------------------------------------------

Similar to the proof of Theorem \[thm:main\] in Section \[Sec:proof\_thm\_main\], we can use the optimality of $\tilde Z$ and the feasibility of $Z^\ast$ for the SDP program  to obtain the following basic inequality, $$\begin{aligned}
0&{\leqslant}\langle A_n,\, \tilde Z - Z^\ast\rangle + n \lambda\big(\operatorname{tr}(Z^\ast) - \operatorname{tr}(\tilde Z)\big) \notag \\
&=\sum_{1{\leqslant}k\neq m{\leqslant}K} \big\langle\, [A_n]_{G_k^\ast G_m^\ast},\, [\tilde Z - Z^\ast]_{G_k^\ast G_m^\ast}\,\big\rangle + \sum_{k=1}^K \big\langle\, [A_n]_{G_k^\ast G_k^\ast},\, [\tilde Z - Z^\ast]_{G_k^\ast G_k^\ast}\,\big\rangle \notag\\
&\qquad\qquad\qquad+ n\,\lambda\,\big(\operatorname{tr}(Z^\ast) - \operatorname{tr}(\tilde Z)\big).\label{Eqn:basic_inequality_adaptive}\end{aligned}$$ Since the only place where we used the constraint $\operatorname{tr}(Z) =K$ in Section \[Sec:proof\_thm\_main\] is Lemma \[lem:some\_ineq\_feasible\_set\] in Appendix C, the analysis of the first two sums in  still apply, leading to $$\label{Eqn:final_bound_adaptive}
\begin{aligned}
 \sum_{1{\leqslant}k\neq m{\leqslant}K} \frac{1}{N_K}\|\tilde Z_{G_k^\ast G_m^\ast}\|_1 
{\leqslant}&\, C\,\bigg( nt\, \exp\Big\{-\frac{\delta^2}{2h^2}\Big\} +\exp\Big\{-c\, \min_{1 {\leqslant}k {\leqslant}K}\{\lambda_1({\mathcal{D}}_k)\}\, h^2 t\Big\}\bigg)\, \big\|\tilde Z - Z^\ast\big\|_1\\
&\,\qquad + n\,\lambda\,\big(\operatorname{tr}(Z^\ast) - \operatorname{tr}(\tilde Z)\big),
\end{aligned}$$ which holds with probability at least $1-c_3K\,\underline{n}^{-c_3}$.

Now we apply Lemma \[lem:some\_ineq\_feasible\_set\_adaptive\] in Appendix C to obtain $$\begin{aligned}
n\, \lambda\, \big(\operatorname{tr}(Z^\ast) - \operatorname{tr}(\tilde Z)\big) {\leqslant}4n\,\lambda\sum_{1{\leqslant}k\neq m{\leqslant}K} \frac{1}{n_k}\|\tilde Z_{G_k^\ast G_m^\ast}\|_1-\lambda\,\big\|\tilde Z - Z^\ast\big\|_1.\end{aligned}$$ Combining this inequality with , we obtain $$\begin{aligned}
 \bigg(\lambda - C\,\Big( nt\, \exp\Big\{-\frac{\delta^2}{2h^2}\Big\} &+\exp\Big\{-c\, \min_{1 {\leqslant}k {\leqslant}K}\{\lambda_1({\mathcal{D}}_k)\}\, h^2 t\Big\}\Big)\bigg)\, \big\|\tilde Z - Z^\ast\big\|_1\\
 &\qquad\qquad+\,\bigg(1-4n\lambda \max_{1{\leqslant}k{\leqslant}K}\Big\{\frac {N_k}{n_k}\Big\}\bigg)\,\sum_{1{\leqslant}k\neq m{\leqslant}K} \frac{1}{N_k}\|\tilde Z_{G_k^\ast G_m^\ast}\|_1
{\leqslant}0.\end{aligned}$$ This implies the exact recovering $\tilde Z=Z^\ast$ provided that $$\begin{aligned}
C_1\, \Big( nt\, \exp\Big\{-\frac{\delta^2}{2h^2}\Big\} &+\exp\Big\{-c\, \min_{1 {\leqslant}k {\leqslant}K}\{\lambda_1({\mathcal{D}}_k)\}\, h^2 t\Big\}\Big) < \lambda {\leqslant}\frac{C_2}{n}\,\min_{1{\leqslant}k{\leqslant}K}\Big\{\frac{n_k}{N_k}\Big\}.\end{aligned}$$ Finally, the claimed result follows by combining the above with Lemma \[Lemma:total\_degree\].

Proof of Lemma \[lem:within\_cluster\_random\_walk\]
----------------------------------------------------

We consider a fixed $k\in[K]$ throughout this proof. Recall that $P_n=D_n^{-1} K_n$ defines the random walk ${\mathcal{W}}_n$ over $S_n=\{X_1,X_2,\ldots,X_n\}$, and $A_n = P_n^{2t} D_n^{-1}$. Now consider a new random walk ${\mathcal{W}}_{n,k}$ over the $k$th cluster $G_k^\ast$ defined in the following way. For simplicity of notation, we may rearrange the nodes order so that $G_k^\ast = \{1,2,\ldots,n_k\}$. Then the transition probability matrix $P_{n,k}\in{\mathbb{R}}^{n_k\times n_k}$ of ${\mathcal{W}}_{n,k}$ is defined as $$\begin{aligned}
[P_{n,k}]_{ij} =\frac{\kappa(X_i,\,X_j)}{d_{n,k}(X_i)},\quad \forall i,j\in G_k^\ast,\quad \mbox{where } d_{n,k}(x) = \sum_{j\in G_k^\ast} \kappa(x,\,X_j)\end{aligned}$$ is the induced degree function within cluster $G_k^\ast$. Similar to the diagonal degree matrix $D_n$, we denote by $D_{n,k}\in{\mathbb{R}}^{n_k\times n_k}$ the diagonal matrix whose $i$th diagonal entry is $d_{n,k}(X_i)$ for $i\in[n_k]$. Note that $N_k=\sum_{i\in G_k^\ast} d_{n,k}(X_i)$ the total degrees within $G_k^\ast$ so that $N_k {\geqslant}n_k \min_{i\in G^\ast_k} d_{n,k}(X_i)$. It is easy to see that the limiting distribution of ${\mathcal{W}}_{n,k}$ is $\pi_{n,k} = N_k^{-1} \mbox{diag}(D_{n,k})\in{\mathbb{R}}^{n_k}$. Under the separation condition on $\delta$ in the lemma, the probability of moving out from $G_k^\ast$ is exponentially small, suggesting that we may approximate the sub-matrix $[P_n^{2t}]_{G_k^\ast G_k^\ast} $ of $P_n^{2t}$ with $P_{n,k}^{2t}$. We will formalize this statement in the rest of the proof.

First, we apply the triangle inequality to obtain $$\begin{aligned}
&\big\|\,[A_n]_{G_k^\ast G_k^\ast} - N_k^{-1} \mathbf{1}_{G_k^\ast}\mathbf{1}_{G_k^\ast}^T\,\big\|_\infty \notag\\
& {\leqslant}\big\| \,[P_n^{2t}]_{G_k^\ast G_k^\ast} [D_{n}]_{G_k^\ast G_k^\ast}^{-1} - P_{n,k}^{2t} D_{n,k}^{-1}\big\|_\infty + \big\| \,P_{n,k}^{2t} D_{n,k}^{-1} - N_k^{-1} \mathbf{1}_{G_k^\ast} \mathbf{1}_{G_k^\ast}^T \big\|_\infty =: T_1 + T_2,\label{Eqn:within_random_walk}\end{aligned}$$ where $T_1$ captures the difference between $[P_{n}^{2t}]_{G_k^\ast G_k^\ast}$ and $P_{n,k}^{2t}$, and $T_2$ characterizes the convergence of the Markov chain ${\mathcal{W}}_{n,k}$ to its limiting distribution $\pi_{n,k}$ after $2t$ steps. Recall that $\kappa = \max_{1{\leqslant}k\neq k'{\leqslant}K}\sup_{x\in {\mathcal{D}}_k,\,x'\in {\mathcal{D}}_{k'}} \kappa(x,\,x')$ is the minimal between-cluster affinity. The first term $T_1$ and the second term $T_2$ can be bounded via two lemmas below.

\[Lem:T\_1\] If $n \kappa {\leqslant}\min_{i \in G_{k}^{*}} d_{n,k}(X_{i})$, then $$\begin{aligned}
T_1 {\leqslant}(2t+1)\,n\,\kappa\,\max_{i\in[n]}d_{n,k}^{-2}(X_i). \end{aligned}$$

\[Lem:T\_2\] Let $\tau = \inf_{x,y\in S:\, \|x-y\| {\leqslant}h} \kappa(x,y)$. For each $i\in G_k^\ast$, let $d_{k}^\dagger(X_{i})$ denote total number of points in $\{X_j\}_{j\in G_k^\ast}$ inside the $d$-ball centered at $X_i$ with radius $h$. If $c_1 (\log n_k/ n_k)^{1/q_k}\,(\log n_k)^{1(q_k=2)/4}{\leqslant}h$, then it holds with probability at least $1-c_2\,n_k^{-c_3}$ that $$\begin{aligned}
T_2 {\leqslant}e^{-2t\,\gamma(P_{n,k})} \,\max_{i\in G_k^\ast} d_{n,k}^{-1}(X_i),\quad\forall t=1,2,\ldots,\end{aligned}$$ where $$\begin{aligned}
\label{Eqn:spectral_gap_bound}
\gamma(P_{n,k}) {\geqslant}\bigg(1- C\,\Big(c_1^{-1}+(\sqrt{\lambda_1({\mathcal{D}}_k)} + 1)\,h+ h^2\Big)\bigg) \,\bigg[\min_{i\in G_k^\ast}  \frac{d_{k}^\dagger(X_{i})}{d_{n,k}(X_i)}\bigg]\,\tau\,  C_k \, \lambda_1({\mathcal{D}}_k)\,h^2,\end{aligned}$$ where recall that $\lambda_1({\mathcal{D}}_k)>0$ denotes the second smallest eigenvalue of the Laplace-Beltrami operator on ${\mathcal{D}}_k$.

Proofs of these two lemmas are provided in Sections \[Sec:Proof\_T\_1\] and \[Sec:Proof\_T\_2\].

Combining upper bounds for the two terms in inequality  together, we can reach $$\begin{aligned}
\big\|\,[A_n]_{G_k^\ast G_k^\ast}- N_k^{-1} \mathbf{1}_{G_k^\ast}\mathbf{1}_{G_k^\ast}^T\,\big\|_\infty {\leqslant}(2t+1)\,n\,\kappa\, \max_{i\in[n]}d_{n,k}^{-2}(X_i) + e^{-2t\,\gamma(P_{n,k})}\,\max_{i\in[n]}d_{n,k}^{-1}(X_i),\end{aligned}$$ where the spectral gap $\gamma(P_{n,k})$ satisfies  . It remains to prove some high probability bounds for $d_{n,k}(X_i)$ and $d_{k}^\dagger(X_i)$, which are summarized in the following lemma.

\[lem:node\_degree\] Suppose the density $p_{k}$ satisfies  and the bandwidth $h {\leqslant}c$ for some constant $c>0$. Then it holds with probability at least $1-c_2\,n_k^{-c_3}$ that $$\begin{aligned}
\max_{i\in G_k^\ast} \bigg|\,\frac{d_{n,k}(X_i)}{n_k\,(\sqrt{2\pi} \,h)^{q_k}}  - p_k(X_i) \bigg| &{\leqslant}C\bigg( h + \sqrt{\frac{\log n_k}{n_k h^{q_{k}}}}\,\bigg), \quad \mbox{and} \\
\max_{i\in G_k^\ast} \bigg|\,\frac{d_{k}^\dagger(X_i)}{n_k\,\nu_{q_k}\,h^{q_k}}  - p_k(X_i) \bigg| &{\leqslant}C\bigg( h^2 + \sqrt{\frac{\log n_k}{n_k h^{q_{k}}}}\,\bigg),\end{aligned}$$ where $\nu_{q_k}$ denotes the volume of an unit ball in ${\mathbb{R}}^{q_k}$, and $C>0$ is some constant depends only on $p_{k}, {\mathcal{D}}_{k}$, and $c$.

A proof of this lemma is deferred to Section \[Sec:Proof\_lem:node\_degree\].

Finally, by combining this lemma with the last display, and applying the uniform boundedness condition  on $p_k$, we obtain $$\begin{aligned}
\big\|\,[A_n]_{G_k^\ast G_k^\ast}- N_k^{-1} \mathbf{1}_{G_k^\ast}\mathbf{1}_{G_k^\ast}^T\,\big\|_\infty {\leqslant}C_0\,n\,t\,\kappa\, (n_k\,h^{q_k})^{-2}+ C_0\, (n_k\,h^{q_k})^{-1}\, e^{-2t\,\gamma(P_{n,k})}\end{aligned}$$ with probability at least $1-c_{2} \, n_{k}^{-c_{3}}$, where the spectral gap $\gamma(P_{n,k})$ satisfies $$\begin{aligned}
\gamma(P_{n,k}) {\geqslant}\bigg(1- C\,\Big(c_1^{-1}+(\sqrt{\lambda_1(D_k)} + 1)\,h+ h^2\Big)\bigg)\,\tau \,  C_1 \, \lambda_1(D_k)\,h^2,\end{aligned}$$ for some constants $C_1,C_2,C>0$ that only depends on ${\mathcal{D}}_k$ and $p_k$.

Proof of Lemma \[lem:between\_cluster\_random\_walk\]
-----------------------------------------------------

For each indices $i$ and $j$ that belong to two difference clusters $G_k^\ast$ and $G_m^\ast$ with $k \neq m$, we have $$\begin{aligned}
[A_n]_{ij}= [P_{n}^{2t}]_{ij} \cdot d_n(X_j)^{-1}.\end{aligned}$$ Let ${\mathcal{W}}_n=\{Y_t:\,t{\geqslant}0\}$, with $Y_t$ denote the state of the Markov chain ${\mathcal{W}}_n$ at time $t$. Define $T_k(i)=\min\big\{t \in {\mathbb{N}}_{+}:\, Y_t \not\in G_k^\ast, \, Y_{0} = i\big\}$ denote the first exit time from $G_k^\ast$ of ${\mathcal{W}}_n$ starting from $Y_0=i$. Then it is easy to see that $$\begin{aligned}
[P_{n}^{2t}]_{ij} = {\mathds{P}}(Y_0=i,\,Y_{2t} = j) {\leqslant}{\mathds{P}}(T_k(i) {\leqslant}2t) = 1 - {\mathds{P}}(T_k(i) > 2t).\end{aligned}$$ Since for each $i\in G_k^\ast$, the one-step transition probability of moving out from $G_k^\ast$ is bounded by $n\,\kappa\,\max_{i\in G_k^\ast} d_{n}^{-1}(X_i)$, we have $$\begin{aligned}
{\mathds{P}}(T_k(i) > 2t) {\geqslant}(1-n\,\kappa\,\max_{i\in G_k^\ast} d_{n}^{-1}(X_i))^{2t} {\geqslant}1-2n\,t \,\kappa\,\max_{i\in G_k^\ast} d_{n,k}^{-1}(X_i), \end{aligned}$$ provided that $n\,\kappa {\leqslant}\min_{i\in G_k^\ast} d_{n}(X_i)$. Therefore, for each $i\in G_k^\ast$ and $j\in G_m^\ast$ with $k\neq m$, we have $$\begin{aligned}
\big|[A_n]_{ij}\big|  {\leqslant}2n\,t \,\kappa\,\max_{i'\in G_k^\ast} d_{n,k}^{-1}(X_{i'}) \,\max_{j'\in G_m^\ast} d_{n,m}^{-1}(X_{j'}).\end{aligned}$$ By Lemma \[lem:node\_degree\] and , we have that with probability at least $1-c_{2}n^{-c_{3}}$, $C_{1} n_{k} h^{q_{k}} {\leqslant}d_{n,k}(X_{i}) {\leqslant}C_{2} n_{k} h^{q_{k}}$ for some constants $C_1$ and $C_{2}$. Note that condition  in Theorem \[thm:main\] yields that $n \kappa = n e^{-\delta^{2} / (2h^{2})} {\leqslant}C n_{k} h^{q_{k}}$. Then the claimed bound is implied by the above combined with the union bound.

Proof of Lemma \[Lem:T\_1\] {#Sec:Proof_T_1}
---------------------------

By adding and subtracting the same term we obtain $$\begin{aligned}
T_1 {\leqslant}&\,  \big\| \big([P_n^{2t}]_{G_k^\ast G_k^\ast} - P_{n,k}^{2t} \big)\,D_{n,k}^{-1}\big\|_\infty +\big\| \,[P_n^{2t}]_{G_k^\ast G_k^\ast}\,\big( [D_{n}]_{G_k^\ast G_k^\ast}^{-1} - D_{n,k}^{-1}\big)\big\|_\infty \notag \\
{\leqslant}&\, \big\| \,[P_n^{2t}]_{G_k^\ast G_k^\ast} - P_{n,k}^{2t} \big\|_\infty \,\|D_{n,k}^{-1}\|_\infty+ \big\|  [D_{n}]_{G_k^\ast G_k^\ast}^{-1} - D_{n,k}^{-1}\big\|_\infty \notag \\
= &\, \big\| \,[P_n^{2t}]_{G_k^\ast G_k^\ast} - P_{n,k}^{2t} \big\|_\infty \,\max_{i\in G_k^\ast} d_{n,k}^{-1}(X_i)+\max_{i\in G_k^\ast} |d_n^{-1}(X_i)-d_{n,k}^{-1}(X_i)| \notag\\
{\leqslant}&\, \big\| \,[P_n^{2t}]_{G_k^\ast G_k^\ast} - P_{n,k}^{2t} \big\|_\infty \,\max_{i\in G_k^\ast}d_{n,k}^{-1}(X_i) +\max_{i\in G_k^\ast} |d_n(X_i)-d_{n,k}(X_i)|\,\max_{i\in G_k^\ast}d_{n,k}^{-2}(X_i),\label{Eqn:T_1_bound}\end{aligned}$$ where the second inequality is due to the fact that each row sum of $[P_n^{2t}]_{G_k^\ast G_k^\ast}$ is at most one.

Now we consider the first term in . Recall that ${\mathcal{W}}_n=\{Y_t:\,t{\geqslant}0\}$, where $Y_t$ is the state of the Markov chain ${\mathcal{W}}_n$ at time $t$. Note that for each $i,j\in G_k^\ast$, we have $$\begin{aligned}
[P_{n,k}]_{ij} =\frac{\kappa(X_i, X_j)}{\sum_{j\in G_k^\ast} \kappa(X_i,X_j)}= \frac{{\mathds{P}}(Y_{2t}=j\,|\, Y_{2t-1}=i)}{{\mathds{P}}(Y_{2t}\in G_k^\ast\,|\, Y_{2t-1}=i)} = {\mathds{P}}(Y_{2t}=j\, |\,Y_{2t-1}=i,\,Y_{2t}\in G_k^\ast).\end{aligned}$$ As a consequence, we have by the law of total probability and the Markov property of ${\mathcal{W}}_n$ that for each $i,j\in G_k^\ast$ and $s\in{\mathbb{N}}_{+}$, $$\begin{aligned}
[P_n^{s}]_{ij} &= {\mathds{P}}(Y_{s} = j \,|\, Y_0 =i) \\
&=\sum_{\ell\in G_k^\ast} {\mathds{P}}(Y_{s} = j \,|\, Y_{s-1} =\ell,\, Y_0=i, \,Y_{s}\in G_k^\ast) \\
& \qquad \ \ \ \  \cdot {\mathds{P}}(Y_{s}\in G_k^\ast \,|\, Y_{s-1} =\ell,\, Y_0=i)\cdot {\mathds{P}}(Y_{s-1} = \ell\,|\, Y_0=i) \\
& \ \ \ \ + \sum_{\ell\not\in G_k^\ast}  {\mathds{P}}(Y_{s} = j\,|\, Y_{s-1} =\ell,\, Y_0=i) \cdot {\mathds{P}}(Y_{s-1} =\ell\,|\, Y_0=i)\\
&= \sum_{\ell\in G_k^\ast} [P_n^{s-1}]_{i\ell} \cdot [P_{n,k}]_{\ell j}\cdot
{\mathds{P}}(Y_{s}\in G_k^\ast \,|\, Y_{s-1} =\ell)\\
& \ \ \ \ + \sum_{\ell\not\in G_k^\ast}  {\mathds{P}}(Y_{s} = j\,|\, Y_{s-1} =\ell) \cdot {\mathds{P}}(Y_{s-1} =\ell\,|\, Y_0=i).\end{aligned}$$ For each pair $(j,\ell)$ belonging to different clusters, noting that $d_{n,k}(X_i) {\leqslant}d_n(X_i)$, we have $$\begin{aligned}
{\mathds{P}}(Y_{s} = j\,|\, Y_{s-1} =\ell) = [P_n]_{\ell j} =\frac{\kappa(X_\ell, X_j)}{d_n(X_\ell)} {\leqslant}\kappa\, \max_{i\in[n]} d_n^{-1}(X_i) {\leqslant}\max_{i\in[n]} d_{n,k}^{-1}(X_i),\end{aligned}$$ which implies that for each $\ell \in G_k^\ast$, $$\begin{aligned}
0{\leqslant}1- {\mathds{P}}(Y_{s}\in G_k^\ast \,|\, Y_{s-1} =\ell) = {\mathds{P}}(Y_{s} \not\in G_{k}^{\ast} \,|\, Y_{s-1}=\ell) {\leqslant}n \,\kappa\, \max_{i\in[n]} d_{n,k}^{-1}(X_i) {\leqslant}1.\end{aligned}$$ Combining the last three displays, we obtain for each $i,j\in G_k^\ast$ and $s\in{\mathbb{N}}^{+}$, $$\begin{aligned}
\big(1- n \,\kappa\, \max_{i\in[n]} d_{n,k}^{-1}(X_i)\big)\,\sum_{\ell\in G_k^\ast} [P_n^{s-1}]_{i\ell} & \cdot [P_{n,k}]_{\ell j} {\leqslant}[P_n^{s}]_{ij} \\ 
{\leqslant}& \sum_{\ell\in G_k^\ast} [P_n^{s-1}]_{i\ell} \cdot [P_{n,k}]_{\ell j} +  n \,\kappa\, \max_{i\in[n]} d_{n,k}^{-1}(X_i),\end{aligned}$$ which can be further simplified into $$\begin{aligned}
\big(1- n \,\kappa\, \max_{i\in[n]} d_{n,k}^{-1}(X_i)\big)\,\big[ [P_n^{s-1}]_{G_k^\ast G_k^\ast} P_{n,k}\big]_{ij} {\leqslant}[P_n^{s}]_{ij}{\leqslant}\big[ [P_n^{s-1}]_{G_k^\ast G_k^\ast} P_{n,k}\big]_{ij} + n \,\kappa\, \max_{i\in[n]} d_{n,k}^{-1}(X_i).\end{aligned}$$ Now we can recursively apply this two-sided inequality to get $$\begin{aligned}
\big(1- n \,\kappa\, \max_{i\in[n]} d_{n,k}^{-1}(X_i)\big)^s\,\big[ P_{n,k}^s]_{ij} {\leqslant}[P_n^{s}]_{ij}{\leqslant}\big[  P_{n,k}^s ]_{ij} + n\, s \,\kappa\, \max_{i\in[n]} d_{n,k}^{-1}(X_i),\quad\forall i,j\in G_k^\ast.\end{aligned}$$ By taking $s=2t$ and applying the inequality $(1-x)^s{\geqslant}1-xs$ for $s\in{\mathbb{N}}_{+}$ and $x\in[0,1]$, the above can be further reduced into $$\begin{aligned}
\label{Eqn:T_1_first_term}
\big\| \,[P_n^{2t}]_{G_k^\ast G_k^\ast} - P_{n,k}^{2t} \big\|_\infty {\leqslant}2n\, t \,\kappa\, \max_{i\in[n]} d_{n,k}^{-1}(X_i).\end{aligned}$$ Then we get $$\big\| \,[P_n^{2t}]_{G_k^\ast G_k^\ast} - P_{n,k}^{2t} \big\|_\infty  \,\max_{i\in G_k^\ast}d_{n,k}^{-1}(X_i) {\leqslant}2n\, t \,\kappa\, \max_{i\in[n]} d_{n,k}^{-2}(X_i).$$ which is an upper bound to the first term in inequality  for $T_1$.

The second term in inequality  can be bounded as $$\begin{aligned}
\label{Eqn:T_1_second_term}
& \max_{i\in G_k^\ast} |d_n(X_i)-d_{n,k}(X_i)| =\max_{i\in G_k^\ast} \sum_{j\not\in G_k^\ast} \kappa(X_i,X_j) {\leqslant}n \kappa.\end{aligned}$$

Finally, by combining , and , we obtain $$\begin{aligned}
T_1 {\leqslant}(2t+1) \, n\,\kappa\,\max_{i\in[n]}d_n^{-2}(X_i).\end{aligned}$$

Proof of Lemma \[Lem:T\_2\] {#Sec:Proof_T_2}
---------------------------

Recall that $\gamma(P_{n,k}) = 1-\lambda_1(P_{n,k})$ denote spectral gap of the transition matrix $P_{n,k}$, where $\lambda_1(P_{n,k})$ denotes the second largest eigenvalue of $P_{n,k}\in {\mathbb{R}}^{n_k\times n_k}$ (due to similar arguments as in Appendix B, $P_{n,k}$ has $n_k$ real eigenvalues with $1$ as the largest one). In addition, since the kernel function $k$ is positive semidefinite, all eigenvalues of $P_{n,k}$ are nonnegative, meaning that $\gamma(P_{n,k})$ is equal to the absolute spectral gap $1-\max\{\lambda_1(P_{n,k}),\, \lambda_{n_k-1}(P_{n,k})\}$ where $\lambda_{n_k-1}(P_{n,k})$ is the $n_k$th (smallest) eigenvalue of $P_{n,k}$.

Therefore, according to the relationship between the mixing time of a Markov chain and its absolute spectral gap (see, for example, equation (12.11) in [@levin2017markov]), we have for each $i,j\in G_k^\ast$, $$\label{eqn:mixing_T2}
\bigg|\frac{[P_{n,k}^{2t}]_{ij}}{[\pi_{n,k}]_j} - 1\bigg| {\leqslant}\frac{e^{-2t\,\gamma(P_{n,k})}}{\min_{\ell \in G_k^\ast} [\pi_{n,k}]_\ell},\quad\forall t=1,2,\ldots,$$ where $\pi_{n,k} =\big(d_{n,k}(X_1)/ N_k,\ldots, d_{n,k}(X_{n_k})/ N_k\big)^T\in{\mathbb{R}}^{n_k}$ is the limiting distribution of induced Markov chain ${\mathcal{W}}_{n,k}$ over $G_k^\ast$ with transition probability matrix $P_{n,k}$. This leads to a bound on $T_2$ as $$\begin{aligned}
T_2 & =  \big\| \,P_{n,k}^{2t} D_{n,k}^{-1} - N_k^{-1} \mathbf{1}_{G_k^\ast} \mathbf{1}_{G_k^\ast}^T \big\|_\infty= \max_{i,j\in G_k^\ast}\frac{1}{N_k}\, \bigg|\frac{[P_{n,k}^{2t}]_{ij}}{[\pi_{n,k}]_j} - 1\bigg| \\
&{\leqslant}\frac{1}{N_k} \, \frac{e^{-2t\,\gamma(P_{n,k})}}{\min_{\ell \in G_k^\ast} [\pi_{n,k}]_\ell}=e^{-2t\,\gamma(P_{n,k})} \,\max_{i\in G_k^\ast} d_{n,k}^{-1}(X_i),\quad\forall t=1,2,\ldots.\end{aligned}$$ Therefore, it remains to provide a lower bound on the spectral gap $\gamma(P_{n,k}) = 1-\lambda_1(P_{n,k})$. We do so by applying a comparison theorem of Markov chains (Lemma 13.22 in [@levin2017markov]), where we compare the spectral gap of $P_{n,k}$ with that of a standard random walk on a random geometric graph over $\{X_i\}_{i\in G_k^\ast}$, where each pair of nodes are connected if and only if they are at most $h$ far away from each other. The spectrum of the normalized graph Laplacian of the latter is known to behave like the eigensystem of the Laplace-Beltrami operator over the submanifold corresponding to the $k$-th connected subset ${\mathcal{D}}_k$. In particular, we will use existing results [@burago2014graph; @trillos2018error] on error estimates by using the spectrum of a random geometric graph to approximate the eigensystem of the Laplace-Beltrami operator in the numerical analysis literature.

Let us first formally define a random geometric graph over $\{X_i\}_{i\in G_k^\ast}$ as i.i.d. samples from the compact connected $q_k$-dimensional Riemannian submanifold ${\mathcal{D}}_k$ in ${\mathbb{R}}^{p}$ with bounded diameter, absolute sectional curvature value, and injective radius. Recall that $\mu_k$ is a probability measure on ${\mathcal{D}}_k$ that has a Lipschitz density $p_k$ with respect to the Riemannian volume measure on ${\mathcal{D}}_k$ satisfying . $\{X_i\}_{i\in G_k^\ast}$ can be viewed as a sequence of i.i.d. samples from $\mu_k$, and without loss of generality, we may assume $G_k^\ast=\{1,2,\ldots,n_{k}\}$. Consider the random geometric graph ${\mathcal{G}}_k^{\dagger}=(V_k, E_k)$, with $V_k=\{X_i\}_{i\in G_k^\ast}$ being its set of vertices and $E_k$ set of edges, constructed by putting an edge between $X_i$ and $X_j$ (write $i\sim j$ and call $X_i$ to be a neighbor of $X_j$) if and only if $\|X_i-X_j\| {\leqslant}h$. We define the natural random walk ${\mathcal{W}}_{k}^\dagger$ as a reversible Markov chain on $V_k$ that moves to neighbors of the current state with equal probabilities. In other words, the transition probability matrix ${\mathcal{P}}_k^{\dagger}\in {\mathbb{R}}^{n_k\times n_k}$ satisfies $$\begin{aligned}
[{\mathcal{P}}_k^{\dagger}]_{ij} = \begin{cases}
\displaystyle (d^{\dagger}_{k,i})^{-1}, & \quad\mbox{if } j\sim i\\
\displaystyle 0, &\quad\mbox{otherwise},
\end{cases}\end{aligned}$$ where $d^\dagger_{k,i} := d^\dagger_{k}(X_{i}) = \sum_{j=1}^{n_k} 1(j\sim i)$ denotes the degree of vertex $X_i$. It is easy to see that $\pi^\dagger_k = (d^\dagger_{k,1}/d^\dagger_k,d^\dagger_{k,2}/d^\dagger_k,\ldots,d^\dagger_{k,n_k}/d^\dagger_k)^T$, where $d^\dagger_k=\sum_{i=1}^{n_k}d^{\dagger}_{k,i}$ denotes the total degree, is the stationary distribution of this random walk. Let $1= \lambda_0( {\mathcal{P}}_k^{\dagger}){\geqslant}\lambda_1({\mathcal{P}}_k^{\dagger}){\geqslant}\ldots{\geqslant}\lambda_{n-1}({\mathcal{P}}_k^{\dagger}){\geqslant}-1$ denote the eigenvalues of matrix ${\mathcal{P}}_k^{\dagger}$, and $\gamma({\mathcal{P}}_k^{\dagger})=1-\lambda_1({\mathcal{P}}_k^{\dagger})$ denote its spectral gap.

Let $L_{{\mathcal{G}}_k^\dagger}=D_k^\dagger - A_k^\dagger\in{\mathbb{R}}^{n_k\times n_k}$ denote the graph Laplacian matrix associated with graph ${\mathcal{G}}_k^\dagger=(V_k,E_k)$, where $D_k^\dagger\in{\mathbb{R}}^{n_k\times n_k}$ is a diagonal matrix with $[D^\dagger_k]_{ii} = d_{k,i}^\dagger$, and $A_k^\dagger\in {\mathbb{R}}^{n_k\times n_k}$ is the adjacency matrix with $[A_k^\dagger]_{ij}=1(i\sim j)$ for all distinct pair $(i,j)\in [n_k]^2$. Define the normalized Laplacian of ${\mathcal{G}}_k^\dagger$ as $L^N_{{\mathcal{G}}_k^\dagger}=(D_k^\dagger)^{-1/2}L_{{\mathcal{G}}_k^\dagger} (D_k^\dagger)^{-1/2}= I -  (D_k^\dagger)^{-1/2} A_k^\dagger (D_k^\dagger)^{-1/2}$, and denote its ordered eigenvalues by $0 {\leqslant}\lambda_0(L^N_{{\mathcal{G}}_k^\dagger}) {\leqslant}\lambda_1(L^N_{{\mathcal{G}}_k^\dagger}){\leqslant}\cdots{\leqslant}\lambda_{n_k-1}(L^N_{{\mathcal{G}}_k^\dagger})$. Since $(D_k^\dagger)^{-1/2} A_k^\dagger (D_k^\dagger)^{-1/2}= (D_k^\dagger)^{1/2} {\mathcal{P}}_k^\dagger (D_k^\dagger)^{-1/2}$ is a similarity transformation of ${\mathcal{P}}_k^\dagger$, they share the same eigenvalues. Therefore, we have the relation $\lambda_j(L^N_{{\mathcal{G}}_k^\dagger}) = 1-\lambda_j({\mathcal{P}}_k^\dagger)$ for all $j=0,1,\ldots,n_k-1$. In particular, by taking $j=1$, we can relate the spectral gap of ${\mathcal{P}}_k^\dagger$ with the second smallest eigenvalue of the normalized Laplacian matrix $L^N_{{\mathcal{G}}_k^\dagger}$ as $\gamma({\mathcal{P}}_k^\dagger) = \lambda_1(L^N_{{\mathcal{G}}_k^\dagger})$.

It is known that the eigenvalues of the normalized Laplacian $L^N_{{\mathcal{G}}_k^\dagger}$ of the geometric random graph ${\mathcal{G}}_k^{\dagger}$ approaches (up to a scaling factor) the eigenvalues of the Laplace-Beltrami operator on ${\mathcal{D}}_k$. More concretely, let $L^2({\mathcal{D}}_k, {\mathrm{d}}\mu_k)$ be the space of all square integrable functions on ${\mathcal{D}}_k$, and $\Delta_{{\mathcal{D}}_k}$ denote the Laplace-Beltrami operator on ${\mathcal{D}}_k$ (cf. Section \[subsec:Laplace-Beltrami\_operator\]). Let $0=\lambda_0({\mathcal{D}}_k){\leqslant}\lambda_1({\mathcal{D}}_k){\leqslant}\cdots$ denote the sequence of nonnegative eigenvalues of $\Delta_{{\mathcal{D}}_k}$. The connectedness of ${\mathcal{D}}_k$ implies that its second smallest eigenvalue $\lambda_1({\mathcal{D}}_k)$ is strictly positive. We will invoke Corollary 2 of [@trillos2018error], which generalizes Theorem 1 of [@burago2014graph] from the uniform density to any Lipschitz continuous density satisfying , for relating the spectrum of the Laplace-Beltrami operator $\Delta_{{\mathcal{D}}_k}$ on ${\mathcal{D}}_k$ with the spectrum of the discrete normalized graph Laplacian $L^N_{{\mathcal{G}}_k^\dagger}$, as summarized in the following.

\[lem:eigenval\_convergence\_normalized\_graph\_Laplacian\] Let $\nu_{q_k}$ to denote the volume of an unit ball in ${\mathbb{R}}^{q_k}$. For each $j=0,1,\ldots$, suppose the radius $h$ and the $\varepsilon_{n,k}$ to be defined below satisfy $(\sqrt{\lambda_j({\mathcal{D}}_k)} + 1)\,h +\varepsilon_{n,k}/h {\leqslant}c_1$. Then it holds with probability at least $1-c_2\,n_k^{-c_3}$ $$\begin{aligned}
\bigg| \frac{2(q_k+2)}{\nu_{q_k} h^2}\cdot\frac{\lambda_j(L^N_{{\mathcal{G}}_k^\dagger})}{\lambda_j({\mathcal{D}}_k)} - 1 \bigg| {\leqslant}C\, \bigg(\frac{\varepsilon_{n,k}}{h}+(\sqrt{\lambda_j({\mathcal{D}}_k)} + 1)\,h+ h^2\bigg),\end{aligned}$$ where constants $c_1,c_2, c_3,C>0$ depend only on the submanifold ${\mathcal{D}}_k$ and the density $p_k$, and $$\begin{aligned}
\varepsilon_{n,k} = \begin{cases}
\displaystyle\frac{(\log n_k)^{3/4}}{n_k^{1/2}} , & \quad\mbox{if } q_k=2\\[2ex]
\displaystyle \Big(\frac{\log n_k}{n_k}\Big)^{1/q_k}, & \quad\mbox{otherwise}
\end{cases}.\end{aligned}$$

In particular, this lemma (taking $j=1$) implies a lower bound on the spectral gap of ${\mathcal{P}}_k^\dagger$ as $$\begin{aligned}
\label{Eqn:RGG_spectral_lower_bound}
\gamma({\mathcal{P}}_k^\dagger) {\geqslant}\bigg(1- C\,\Big(c_1^{-1}+(\sqrt{\lambda_1({\mathcal{D}}_k)} + 1)\,h+ h^2\Big)\bigg) C_k \, \lambda_1({\mathcal{D}}_k)\,h^2\end{aligned}$$ as long as $h {\geqslant}c_1 \varepsilon_{n,k}$, where constant $C_k$ only depends on $q_k$.

Next, we will apply the following comparison theorem to relate the spectral gaps of Markov chains ${\mathcal{W}}_{n,k}$ and ${\mathcal{W}}_{k}^\dagger$.

\[lem:comparison\_thm\] Let $P$ and $P'$ be transition matrices of two reversible Markov chains on the same state space $\Omega$, whose stationary distributions are denoted by $\pi$ and $\pi'$, respectively. Let ${\mathcal{E}}(f)$ and ${\mathcal{E}}'(f)$ denote the Dirichlet forms associated to the pairs $(P,\pi)$ and $(P',\pi')$, where $$\begin{aligned}
\label{Eqn:Dirichlet_form}
{\mathcal{E}}(f) =\frac{1}{2} \sum_{x,y\in\Omega} [\,f(x) - f(y)]^2\,\pi(x)\, P(x,y),\quad \forall f\in L^2(\Omega),\end{aligned}$$ and ${\mathcal{E}}'(f)$ can be similarly defined. If there exists some constant $B>0$ such that ${\mathcal{E}}'(f) {\leqslant}B \,{\mathcal{E}}(f)$ for all $f$, then $$\begin{aligned}
\gamma(P') {\leqslant}\bigg[\max_{x\in\Omega} \frac{\pi(x)}{\pi'(x)}\bigg] \, B\,\gamma(P),\end{aligned}$$ where $\gamma(P)$ and $\gamma(P')$ denote the spectral gaps associated with $P$ and $P'$, respectively.

We will apply this comparison theorem with $P_{n,k}\to P, {\mathcal{P}}_{k}^\dagger \to P'$, and $\Omega = G_{k}^{*}$. Let us find the constant $B$ such that ${\mathcal{E}}'(f){\leqslant}B\, {\mathcal{E}}(f)$ for all $f$, where in our setting, $$\begin{aligned}
{\mathcal{E}}(f) &=\frac{1}{2 N_k} \sum_{1{\leqslant}i,j{\leqslant}n_k} (\,f_i - f_j)^2\,\kappa(X_i,X_j),\quad\mbox{and}\\
{\mathcal{E}}'(f) &=\frac{1}{2 d_k^\dagger} \sum_{(i,j):\, \|X_i-X_j\| {\leqslant}h} (\,f_i - f_j)^2,\quad \forall f=(f_1,\ldots,f_{n_k})^T\in{\mathbb{R}}^{n_k}, \end{aligned}$$ According to the definition of $\tau$ as $\inf_{x,y\in S:\, \|x-y\| {\leqslant}h} \kappa(x,y)$, we can simply choose $B = (N_k/d_k^\dagger)\, \tau^{-1}$. In addition, we have the bound $$\begin{aligned}
\max_{i\in G_k^\ast} \frac{[\pi_{n,k}]_i}{[\pi_k^\dagger]_i} = \frac{d_k^\dagger}{\tilde N_k}\, \max_{i\in G_k^\ast}  \frac{d_{n,k}(X_i)}{d_{k,i}^\dagger}.\end{aligned}$$ Therefore, we can apply Lemma \[lem:comparison\_thm\] to get $$\begin{aligned}
\gamma(P_{n,k}) {\geqslant}\tau \bigg[\min_{i\in G_k^\ast}  \frac{d_{k,i}^\dagger}{d_{n,k}(X_i)}\bigg]\, \gamma({\mathcal{P}}_{k}^\dagger),\end{aligned}$$ which combined with inequality  leads to $$\begin{aligned}
\gamma(P_{n,k}) {\geqslant}\bigg(1- C\,\Big(c_1^{-1}+(\sqrt{\lambda_1({\mathcal{D}}_k)} + 1)\,h+ h^2\Big)\bigg) \,\bigg[\min_{i\in G_k^\ast}  \frac{d_{k,i}^\dagger}{d_{n,k}(X_i)}\bigg]\,\tau\,  C_k \, \lambda_1({\mathcal{D}}_k)\,h^2.\end{aligned}$$

Proof of Lemma \[lem:node\_degree\] {#Sec:Proof_lem:node_degree}
-----------------------------------

Recall that $\kappa(x,y)=\exp\{-\|x-y\|^2/(2h^2)\}$ is the Gaussian kernel with bandwidth parameter $h>0$. For $x \in S$, define $d_{n,k}(x) = \sum_{j \in G_{k}^{*}} \kappa(x, X_{j})$ as the induced degree function of $x$ within cluster $G_{k}^{*}$. Then for each $i\in G_k^\ast$ we have $d_{n,k}(X_{i}) = 1+\sum_{j\in G_k^\ast,\,j\neq i} \kappa(X_i,X_j) =: 1+\tilde{d}_{n,k}(X_{i})$. Denote $\alpha_{k}(x) = \operatorname{\mathds{E}}_{X \sim p_{k}} \kappa(x,\, X)$ and $v_{k}(x) = {\text{Var}}_{X \sim p_{k}}[\kappa(x,\, X)]$. Applying Lemma \[lem:expectation\_variance\_bound\] with ${\mathcal{M}}={\mathcal{D}}_k$ and $f(x)=p_k(x)$, we have $v_{k}(x) {\leqslant}\alpha_{k}(x) {\leqslant}C h^{q_{k}}$ for all $x \in {\mathcal{D}}_{k}$. Then for any fixed $x \in {\mathcal{D}}_{k}$, using the bound in  and the boundedness of $\kappa$, we may apply Bernstein inequality (cf. Lemma 2.2.9 in [@vandervaartwellner1996]) to obtain that for all $u>0$, $$\begin{aligned}
{\mathds{P}}\left( \Big|d_{n,k}(x) - n_k \alpha_{k}(x) \Big| {\geqslant}u \right) {\leqslant}2 \exp\left( -{u^{2} \over 2 C n_{k} \alpha_{k}(x) + {2 \over 3} u} \right). \end{aligned}$$ Choosing $u = t n_{k} \alpha_{k}(x)$ for $t \in (0, C]$, we have $$\label{Eqn:degree_con}
{\mathds{P}}\left( \Big|d_{n,k}(x) - n_k \alpha_{k}(x) \Big| {\geqslant}t n_{k} \alpha_{k}(x) \right) {\leqslant}2 \exp \left( -{t^{2} n_{k} \alpha_{k}(x) \over 2 C + {2 \over 3} t} \right) \le 2 \exp \left( -C n_{k} \alpha_{k}(x) t^{2} \right).$$ Now choosing $t = c_{1} \sqrt{\log(n_{k})/(\alpha_{k}(x) n_{k})}$ for some large enough constant $c_{1} > 0$, we get $${\mathds{P}}\left( \Big|d_{n,k}(x) - n_k \alpha_{k}(x) \Big| {\geqslant}c_{1} \sqrt{\alpha_{k}(x) n_{k} \log{n_{k}}} \right) {\leqslant}2 n_{k}^{-C c_{1}^{2}},$$ provided that $\log(n_{k}) {\leqslant}C \alpha_{k}(x) n_{k} {\leqslant}C n_{k} h^{q_{k}}$ in view of the uniform bounds  and . But this is ensured by our bandwidth assumption . Thus for any fixed $x \in {\mathcal{D}}_{k}$, we have with probability at least $1 - c_{2} n_{k}^{-c_{3}}$, $$\left| {d_{n,k}(x)  \over n_{k}} - \alpha_{k}(x) \right| {\leqslant}c_{1} \sqrt{\alpha_{k}(x) \log{n_{k}} \over n_{k}}.$$ Then it follows that with probability at least $1 - c_{2} n_{k}^{-c_{3}}$, $$\left| {d_{n,k}(x)  \over n_{k} (\sqrt{2\pi} h)^{q_{k}}} - p_{k}(x) \right| {\leqslant}{C \over (\sqrt{2\pi})^{q_{k}}} h  +  {c_{1} \over (\sqrt{2\pi} h)^{q_{k}}} \sqrt{\alpha_{k}(x) \log{n_{k}} \over n_{k}} {\leqslant}C \left( h + \sqrt{\log{n_{k}} \over n_{k} h^{q_{k}}} \right).$$ This implies that the rescaled degree function $n_k^{-1}\,\big(\sqrt{2\pi} h\big)^{-q_k}\,d_{n,k}(x)$ provides a good estimate of the density $p_k(x)$ at $x$. Since $X_{i} \in {\mathcal{D}}_{k}$ are i.i.d. for $i \in G_{k}^{*}$, we have with probability at least $1 - c_{2} n_{k}^{-c_{3}}$, $$\left| {\tilde{d}_{n,k}(X_{i})  \over (n_{k}-1) (\sqrt{2\pi} h)^{q_{k}}} - p_{k}(X_{i}) \right| {\leqslant}C \left( h + \sqrt{\log{n_{k}} \over n_{k} h^{q_{k}}} \right).$$ Then union bound implies that $$\max_{i \in G_{k}^{*}} \left| {d_{n,k}(X_{i})  \over n_{k} (\sqrt{2\pi} h)^{q_{k}}} - p_{k}(X_{i}) \right| {\leqslant}C \left( h + \sqrt{\log{n_{k}} \over n_{k} h^{q_{k}}} + {1 \over n_{k} h^{q_{k}}} \right) {\leqslant}C \left( h + \sqrt{\log{n_{k}} \over n_{k} h^{q_{k}}} \right)$$ with probability at least $1-c_{2}n_{k}^{-c_{3}}$ (by choosing the constant $c_{1}$ large enough).

The second part about the concentration of $d_{k}^\dagger(X_{i})$ can be analogously proved by applying the Chernoff bound for sum of i.i.d. Bernoulli random variables. Let $$\begin{aligned}
d_{k}^\dagger(x) = \sum_{j \in G_{k}^{*}} 1(\|x-X_j\|{\leqslant}h)\end{aligned}$$ so that $d_{k}^\dagger(X_{i}) = 1+\tilde{d}_{k}^\dagger(X_{i})$ where $\tilde{d}_{k}^\dagger(X_{i}) = \sum_{j \in G_{k}^{*}, j\neq i} 1(\|X_{i}-X_j\|{\leqslant}h)$. Note that Section 2.2 of [@burago2014graph] provides a uniform estimate of the expectation ${\mathbb{E}}_{X\sim p_k} [1(\|x-X\|{\leqslant}h)]$ in terms of the density $p(x)$ as $$\begin{aligned}
\label{Eqn:Expected-degree}
\sup_{x \in {\mathcal{D}}_{k}} \Big|{\mathbb{E}}_{X\sim p_k} [1(\|x-X\|{\leqslant}h)] - \nu_{q_k} \, h^{q_k}\,p_k(x) \Big| {\leqslant}C\, h^{q_k+2},\end{aligned}$$ where recall that $\nu_{q_k}$ denotes the volume of unit ball in ${\mathbb{R}}^{q_k}$. The rest of the proof follows a similar line as the proof of the first part, and we omit the details.

\[lem:expectation\_variance\_bound\] Let ${\mathcal{M}}$ be a $q$-dimensional compact submanifold in ${\mathbb{R}}^p$ with bounded absolute sectional curvature and injective radius, and $\mbox{Vol}_{{\mathcal{M}}}$ denote its volume form. Let $f$ be a Lipschitz probability density function on ${\mathcal{M}}$ such that $c {\leqslant}f(x) {\leqslant}c^{-1}$ for some constant $c > 0$. Let $\alpha(x) = \operatorname{\mathds{E}}_{X \sim f} [\kappa(x,\, X)]$ and $v(x) = {\text{Var}}_{X \sim f}[\kappa(x,\, X)]$. Then we have $$\label{Eqn:expectation_bound}
\sup_{x\in {\mathcal{M}}}  \Big| \alpha(x)  - \big(\sqrt{2\pi} h\big)^{q} \,f(x)\Big| {\leqslant}C \, h^{q+1}$$ and $v(x) {\leqslant}C \alpha(x)$ for all $x \in {\mathcal{M}}$, where the constant $C$ only depends on $f$, ${\mathcal{M}}$, and $c$. Consequently, we have $\sup_{x \in {\mathcal{M}}} \alpha(x) {\leqslant}C h^{q}$ and $\sup_{x \in {\mathcal{M}}} v(x) {\leqslant}C h^{q}$.

Note that for each $x\in {\mathcal{M}}$ and any Lipschitz probability density function $f$ on ${\mathcal{M}}$, the expectation ${\mathbb{E}}[\kappa(x,\, X)^2]$ takes the form $$\begin{aligned}
{\mathbb{E}}_{X \sim f} [\kappa(x,\, X)] = \int_{{\mathcal{M}}} \exp\{-\|x-y\|^2/(2h^2)\} \, f(y)\, {\mathrm{d}}\mbox{Vol}_{{\mathcal{M}}} (y).\end{aligned}$$ Then  follows from Lemma \[Lem:convolution\_bound\]. Similarly, we can bounded the variance of $\kappa(x,\, X)$ via $\mbox{Var}_{X \sim f} [\kappa(x,\, X)] {\leqslant}{\mathbb{E}}_{X \sim f}  [\kappa(x,\, X)^2]$, where $$\begin{aligned}
{\mathbb{E}}_{X \sim f}  [\kappa(x,\, X)^2]= \int_{{\mathcal{M}}} \exp\{-\|x-y\|^2/(h^2)\} \, f(y)\, {\mathrm{d}}\mbox{Vol}_{{\mathcal{M}}} (y).\end{aligned}$$ By a second application of Lemma \[Lem:convolution\_bound\] with $h/\sqrt{2} \to h$ to obtain $$\begin{aligned}
\Big| {\mathbb{E}}_{X \sim f}   [\kappa(x,\, X)^2] - \big(\sqrt{\pi} h\big)^{q} \,f(x)\Big| {\leqslant}C' \, h^{q+1}.\end{aligned}$$ This together with the uniform boundedness condition on $f$ and inequality  imply an upper bound to the variance by the expectation, $$\begin{aligned}
\label{Eqn:variance_bound}
\mbox{Var}_{X \sim f}  [\kappa(x,\, X)]  {\leqslant}C \,h^{q}{\leqslant}C \,{\mathbb{E}}_{X \sim f} [\kappa(x,\, X)],\quad \mbox{for some $C>0$}.\end{aligned}$$ The bounds $\sup_{x \in {\mathcal{M}}} \alpha(x) {\leqslant}C h^{q}$ and $\sup_{x \in {\mathcal{M}}} v(x) {\leqslant}C h^{q}$ follow from the fact that $h {\leqslant}c$.

\[Lem:convolution\_bound\] Let ${\mathcal{M}}$ be a $q$-dimensional compact submanifold in ${\mathbb{R}}^p$ with bounded absolute sectional curvature and injective radius, and $\mbox{Vol}_{{\mathcal{M}}}$ denote its volume form. Then there exists some constant $h_0>0$ only depending on ${\mathcal{M}}$, such that for all $h\in(0, h_0]$ and any Lipschitz function $f$ on ${\mathcal{M}}$, we have $$\begin{aligned}
\bigg| \frac{1}{\big(\sqrt{2\pi} h\big)^q}\,\int_{{\mathcal{M}}} \exp\{-\|x-y\|^2/(2h^2)\} \, f(y)\, {\mathrm{d}}\mbox{Vol}_{{\mathcal{M}}} (y) - f(x)\bigg| {\leqslant}C_{f}\,h,\end{aligned}$$ where constant $C_f$ only depends on $f$ and ${\mathcal{M}}$.

This lemma follows from Lemma 5.2 on pages 895–898 in [@yang2016bayesian].

Proof of Lemma \[Lemma:total\_degree\] {#Sec:Proof_total_degree}
--------------------------------------

Recall that $N_k=\sum_{i,j\in G^\ast_k} \kappa(X_i,X_j)$ is the total within-weight in $G^\ast_k$. According to Lemma \[lem:node\_degree\] (note that $N_k=\sum_{i\in G_k^\ast} d_{n,k}(X_i)$ using the notation therein), it holds with probability at least $1-c_2 n_k^{-c_3}$ that $$\begin{aligned}
\bigg| \frac{N_k}{n_k} - (\sqrt{2\pi}\, h)^{q_k}\, \sum_{i\in G_k^\ast} p_k(X_i)\bigg| {\leqslant}C\, n_{k} h^{q_k}\,\bigg(h + \sqrt{\frac{\log n_k}{n_kh^{q_{k}}}} \, \bigg).\end{aligned}$$ According to the sandwiched bound on the density function $p_k$, $\{p_k(X_i):\,i\in G_k^\ast\}$ are independent and bounded random variables. Therefore, we may apply Hoeffding’s inequality to obtain that $$\begin{aligned}
\bigg|\sum_{i\in G_k^\ast} p_k(X_i) - n_k \,\beta_k\bigg| {\leqslant}C\,\sqrt{n_k\log n_k}\end{aligned}$$ holds with probability at least $1-c_2 n_k^{-c_3}$, where $\beta_k=\mathbb E[p_k(X_i)]$. Combining the two preceding inequalities, we obtain that $$\begin{aligned}
\bigg| \frac{N_k}{n_k} - (\sqrt{2\pi}\, h)^{q_k} \,n_k \beta_k\bigg| {\leqslant}C \left(  n_{k} h^{q_{k}+1} + \sqrt{n_kh^{q_k}\log n_k} \right),\end{aligned}$$ which completes the proof.

Proof of Theorem \[thm:main\_adaptive\_h\] {#Sec:Proof_thm:main_adaptive_h}
------------------------------------------

#### *Proof of Part (1):*

Consider $X_i$, where $i\in G_k^\ast$ for some $k\in[K]$. Fix $h_U=c_U(\log n/n_k)^{1/q_k}$ and $h_L=c_L(\log n/n_k)^{1/q_k}$ for two sufficiently large constant $c_U$ and $c_L$ with $c_U=2c_L$. We use notation $N(X_i,h)$ to denote the number of points from $\{X_i\}_{i=1}^n$ that is within $h$ distance from $X_i$.

Recall that $d_k^\dagger(X_i) := d_{k,h}^\dagger(X_i)$ in Lemma \[lem:node\_degree\] is the number of points from $\{X_i\}_{i\in G_k^\ast}$ that is within $h$ distance to $X_i$ (we will choose $h=h_L$ and $h=h_U$ later). Here we put an subscript $h$ in $d_{k,h}^\dagger(X_i)$ to indicate the dependence of $d_k^\dagger$ on $h$. The condition on $\delta_{kk'}$ implies that any point outside the $k$th cluster $D_k$ has distance at least $C'(\log n/n_k)^{1/q_k} {\geqslant}\max\{h_L,h_U\}$. Therefore all points that are within $h_L(h_U)$ distance to $X_i$ must belong to $\mathcal D_k$, implying $N(X_i,h) = d_{k,h}^\dagger(X_i)$. Consequently, from the proof of Lemma \[lem:node\_degree\] (take $h=h_U$ and $h=h_L$ respectively), we have (a concentration inequality as  plus the expectation bound ), $$\begin{aligned}
&\mathbb P \big( N(x,h_L) {\leqslant}c_1 (1-t)\, n_k h_L^{q_k} \big) {\leqslant}\exp\{- c_1' n_k h_L^{q_k} t^2\},\\
&\mathbb P \big( N(x,h_U) {\geqslant}c_2 (1+t)\, n_k h_U^{q_k} \big) {\leqslant}\exp\{- c_2' n_k h_U^{q_k} t^2\},\quad t>0, x \in {\mathcal{D}}_{k}, \end{aligned}$$ where constants $(c_1,c_1')$ and $(c_2,c_2')$ only depend on the constant $c$ in the two-sided bound on density $p_k(\cdot)$ on the $k$th region $\mathcal D_k$. Let $c_U$ be sufficiently large such that $c_2 c_U^{q_k} = C$, where $C$ is the constant appearing in the neighborhood parameter $k_0=\lfloor C\log n\rfloor$. By taking $t$ such that $(1-t) c_1 c_L^{q_k} = C/2$ in the first inequality of the preceding display, and $t=1$ in the second inequality, we obtain that $$\begin{aligned}
&\mathbb P \big( N(X_{i},h_L) {\leqslant}k_0/2 \big) {\leqslant}\exp\{- c_1'' \,C \log n\},\\
&\mathbb P \big( N(X_{i},h_U) {\geqslant}2k_0 \big) {\leqslant}\exp\{- c_2''\, C\log n\},\end{aligned}$$ where $c_1''$ and $c_2''$ are two constants independent of $C$. For large enough $C$, we can make these two probabilities smaller than $1/n^3$. Since the event $\{N(X_i,h_L) {\leqslant}k_0/2\}\cap\{N(X_i,h_U) {\geqslant}2k_0\}$ implies $h_i \in[h_L,h_U]$ for each $i\in[n]$, a union bound argument over $i=1,2,\ldots,n$ leads to the claimed two sided bound for $h_i$ (with probability at least $1-n^{-1}$).

#### *Proof of Part (2):*

Using the two sided bound in the proof of Part (1), the proof follows same steps in the proof of Theorem \[thm:main\], with the only exception in proving a counterpart of Lemma \[Lem:T\_2\] for bounding the spectral gap $\gamma(P_{n,k})$ of chain $P_{n,k}$ on $\{X_i\}_{i\in G_k^\ast}$ in cluster $G_k^\ast$ for $k\in [K]$, since $P_{n,k}$ now has different bandwidth parameter $h_i$ at each observed point $X_i$ (that is, a bandwidth parameter inhomogeneous chain). More precisely, it remains to show that with high probability, it holds that $$\begin{aligned}
\gamma(P_{n,k}){\geqslant}C' \lambda_1(\mathcal D_k) \,(\log n /n_k)^{2/q_k}, \quad \mbox{for some constant $C'>0$.}\end{aligned}$$ Here, we assume without loss of generality that the absolute spectral gap of $P_{n,k}$ is dominated by one minus its second largest eigenvalue. Otherwise, we can always consider the lazy random walk by replacing $P_n$ with $P_n/2 +I_n/2$ in the diffusion $K$-mean SDP, whose absolute spectral gap is $\gamma(P_{n,k})/2$.

Our proof strategy is again based on the Markov chains comparison theorem (Lemma \[lem:comparison\_thm\]) by comparing this bandwidth parameter inhomogeneous chain with a bandwidth parameter homogeneous chain with $h_i \equiv h_L$, for each $i\in G_k^\ast$, where $h_L$ is the lower bound of $h_i$ in the proof of Part (1). In particular, a lower bound on the spectral gap of the latter is already derived in Lemma \[Lem:T\_2\] as of order $\lambda_1(\mathcal D_k) h_L^2$.

Fix the cluster index $k\in [K]$, and without loss of generality assume $G_k^\ast=\{1,2,\ldots,n_k\}$. To avoid confusion of notation, we put an superscript “IH" indicate the bandwidth parameter inhomogeneous chain, and “H" to denote the bandwidth parameter homogeneous chain with $h_i \equiv h_L$. For example, $P_{n,k}^{IH}$ and $\mathcal E^{IH}$ denote the transition probability matrix and the Dirichlet form  (defined in Lemma \[lem:comparison\_thm\]), respectively, associated with the bandwidth parameter inhomogeneous chain.

Due to the fact that $h_i {\geqslant}h_L$ for all $i\in G^\ast_k$, we immediately have $$\begin{aligned}
2 N_k^H \mathcal E^{H}(f) &= \sum_{1{\leqslant}i,j{\leqslant}n_k} (f_i-f_j)^2 \kappa^{H}(X_i,X_j)  \\
&{\leqslant}\sum_{1{\leqslant}i,j{\leqslant}n_k} (f_i-f_j)^2 \kappa^{IH}(X_i,X_j) = 2 N_k^{IH}\mathcal E^{IH}(f), \quad\mbox{for all $f\in\mathbb R^{n_k}$,}\end{aligned}$$ where $k^{H}(X_i,X_j) = \exp\{-\|X_i-X_j\|^2/(2h_L^2)\}$ and $\kappa^{IH}(X_i,X_j) = \exp\{-\|X_i-X_j\|^2/(2h_ih_j)\}$, and $(N_k^H,N_k^{IH})$ are the respective total degrees within $G_k^\ast$. Moreover, recall that the stationary distributions of $P_{n,k}^{IH}$ and $P_{n,k}^{H}$ are $\pi_{n,k}^{IH} = d_{n,k}^{IH}(X_i) / N_k^{IH}$ and $\pi_{n,k}^{H} = d_{n,k}^{H}(X_i) / N_k^{H}$, for $i\in G_k^\ast$, respectively, where $d_{n,k}^{IH}(X_i) =\sum_{j\in G_k^\ast} \kappa^{IH}(X_i,X_j)$, $d_{n,k}^{H}(X_i) =\sum_{j\in G_k^\ast} \kappa^{H}(X_i,X_j)$ are the node degrees, and $N_k^{IH}= \sum_{i\in G_k^\ast} d_{n,k}^{IH}(X_i)$, $N_k^{H}= \sum_{i\in G_k^\ast} d_{n,k}^{H}(X_i)$ are the total degrees.

Now we can apply Lemma \[lem:comparison\_thm\] with $B= N_k^{IH}/ N_k^{H}$ and Lemma \[Lem:T\_2\] (to the homogeneous chain $P_{n,k}^H$) to obtain $$\begin{aligned}
\gamma(P_{n,k}^{IH}) {\geqslant}\min_{i\in G_k^\ast} \bigg[\frac{d_{n,k}^{H}(X_i)}{d_{n,k}^{IH}(X_i)} \bigg]\, \gamma(P_{n,k}^{H}) \quad\mbox{and}\quad \gamma(P_{n,k}^{H}){\geqslant}C \lambda_1(\mathcal D_k) \,h_L^2,\end{aligned}$$ for some constant $C>0$. Similar to the proof of Lemma \[lem:node\_degree\], we can apply the concentration inequality to the nodes degree with bandwidth $h=h_U$ and $h=h_L$ to obtain that with probability at least $1-c_2\, n^{-c_3}$, $$\begin{aligned}
\max_{i\in G_k^\ast} \bigg|\,\frac{\sum_{j\in G_k^\ast}\exp\{-\|X_i-X_j\|^2/(2h_L^2)\} }{n_k(\sqrt{2\pi} h_L)^{q_k}}  - p_k(X_i) \bigg| {\leqslant}C'\bigg( h_L + \sqrt{\frac{\log n_k}{n_k h_{L}^{q_{k}}}}\,\bigg),\\
\max_{i\in G_k^\ast} \bigg|\,\frac{\sum_{j\in G_k^\ast}\exp\{-\|X_i-X_j\|^2/(2h_U^2)\} }{n_k(\sqrt{2\pi} h_U)^{q_k}}  - p_k(X_i) \bigg| {\leqslant}C'\bigg( h_U+ \sqrt{\frac{\log n_k}{n_k h_{U}^{q_{k}}}}\,\bigg), \end{aligned}$$ for all $i\in G_k^\ast$. Combining this with the sandwiched bound for $h_i$ in Part (1), we obtain $$\begin{aligned}
c_1\, n_k h_L^{q_k}  &{\leqslant}d_{n,k}^{H}(X_i)=\sum_{j\in G_k^\ast}\exp\{-\|X_i-X_j\|^2/(2h_L^2)\}  \\
&{\leqslant}d_{n,k}^{IH}(X_i)  = \sum_{j\in G_k^\ast}  \exp\{-\|X_i-X_j\|^2/(2h_ih_j)\} \\
&{\leqslant}\sum_{j\in G_k^\ast} \exp\{-\|X_i-X_j\|^2/(2h_U^2)\} {\leqslant}c_1'\, n_k h_U^{q_k},\ \ \ \mbox{for all $i\in G_k^\ast$.}\end{aligned}$$

Putting all pieces together, we obtain that it holds with probability at least $1-c_2\, n^{-c_3}$ that $$\begin{aligned}
\gamma(P_{n,k}^{IH}){\geqslant}C' \lambda_1(\mathcal D_k) \,(\log n /n_k)^{2/q_k}, \quad \mbox{for some constant $C'>0$.}\end{aligned}$$

Proof of Lemma \[lem:feasibility\_SDP\_lambda\_infinity\]
---------------------------------------------------------

*Proof of Part (1):* Since $n\lambda >\lambda_{\max}(A)$, the matrix $n\lambda I_n - A$ is positive definite. For any $Z \in {\mathscr{C}}$, from the constraint $Z {\mathbf{1}}_{n} = {\mathbf{1}}_{n}$, we see that $(1, n^{-1/2} {\mathbf{1}}_{n})$ is an eigen-pair of $Z$. In addition, since $Z \succeq 0$, all eigenvalues $\lambda_{1},\dots,\lambda_{n}$ of $Z$ are non-negative. Let $U_1=n^{-1/2}{\mathbf{1}}_{n}, U_2,\ldots, U_n$ denote the corresponding eigenvectors of $Z$. Thus the objective function $$\begin{aligned}
&\langle A ,Z\rangle - n\lambda \operatorname{tr}(Z) =  - \langle n\lambda I_n - A, Z\rangle \\
&= -\frac{1}{n}\,{\mathbf{1}}_{n}^T(n\lambda I_n - A){\mathbf{1}}_{n} - \sum_{i=2}^n \lambda_i\, U_i^T(n\lambda I_n - A)U_i {\leqslant}-\frac{1}{n}{\mathbf{1}}_{n}^T(n\lambda I_n - A){\mathbf{1}}_{n},\end{aligned}$$ where the equality holds if and only if $\lambda_2=\cdots=\lambda_n=0$. Note that $Z^{\diamond} \in {\mathscr{C}}$ is a feasible solution for  and $Z^{\diamond}$ has a non-zero eigenvalue equal to $1$ and $(n-1)$ zero eigenvalues. Therefore, $Z^{\diamond}$ is the unique solution of the SDP .

*Proof of Part (2):* For any $Z\in {\mathscr{C}}$, since $Z$ is a symmetric matrix satisfying $Z {\geqslant}0$ and $Z  {\mathbf{1}}_{n} = {\mathbf{1}}_{n}$, $Z$ is a stochastic matrix and all its eigenvalues have absolute values less than or equal to one. Moreover, from the positive semi-definiteness of $Z$, all eigenvalues of $Z$ lie in the $[0,1]$ interval. Now since $n\lambda <\lambda_{\min}(A)$, the matrix $A- n\lambda I_n$ is positive definite. From matrix Hölder’s inequality, the objective function satisfies $$\begin{aligned}
&\langle A ,Z\rangle - n\lambda \operatorname{tr}(Z) =  \langle A- n\lambda I_n, Z\rangle \\
&{\leqslant}{{\left\vert\kern-0.25ex\left\vert\kern-0.25ex\left\vert A- n\lambda I_n 
    \right\vert\kern-0.25ex\right\vert\kern-0.25ex\right\vert}}_{\ast}\, {{\left\vert\kern-0.25ex\left\vert\kern-0.25ex\left\vert Z 
    \right\vert\kern-0.25ex\right\vert\kern-0.25ex\right\vert}}_{\mbox{\scriptsize op}} = {{\left\vert\kern-0.25ex\left\vert\kern-0.25ex\left\vert A- n\lambda I_n 
    \right\vert\kern-0.25ex\right\vert\kern-0.25ex\right\vert}}_{\ast},\end{aligned}$$ where the equality holds if and only if all eigenvalues of $Z$ equal to one (since $A- n\lambda I_n$ is strictly positive definite). Note that $Z^{\dagger} = I_{n} \in {\mathscr{C}}$ is a feasible solution for . Therefore, $Z^{\dagger}$ is the unique solution of the SDP .

*Proof of Part (3):* By the optimality and feasibility of the solutions $\tilde Z_{\lambda_1}$ and $\tilde Z_{\lambda_2}$, we have $$\label{Eqn:optimality}
\begin{aligned}
\langle A ,\tilde Z_{\lambda_2}\rangle - \lambda_1 \operatorname{tr}(\tilde Z_{\lambda_2}) &{\leqslant}\langle A ,\tilde Z_{\lambda_1}\rangle - \lambda_1 \operatorname{tr}(\tilde Z_{\lambda_1}),\ \ \mbox{and}\\
\langle A ,\tilde Z_{\lambda_1}\rangle - \lambda_2 \operatorname{tr}(\tilde Z_{\lambda_1}) &{\leqslant}\langle A ,\tilde Z_{\lambda_2}\rangle - \lambda_2 \operatorname{tr}(\tilde Z_{\lambda_2}).
\end{aligned}$$ Adding these two inequalities together yields $$\begin{aligned}
(\lambda_1-\lambda_2) \big( \operatorname{tr}(\tilde Z_{\lambda_1}) -  \operatorname{tr}(\tilde Z_{\lambda_2})\big) {\leqslant}0,\end{aligned}$$ which implies $\operatorname{tr}(\tilde Z_{\lambda_1}) {\geqslant}\operatorname{tr}(\tilde Z_{\lambda_2})$ when $\lambda_1> \lambda_2$. Moreover, if at least one of the SDPs has a unique solution, then at least one of the two inequalities in  is strict, implying $$(\lambda_1-\lambda_2) \big( \operatorname{tr}(\tilde Z_{\lambda_1}) -  \operatorname{tr}(\tilde Z_{\lambda_2})\big) < 0,$$ and $\operatorname{tr}(\tilde Z_{\lambda_1}) > \operatorname{tr}(\tilde Z_{\lambda_2})$.

Proofs on spectral decompositions {#app:A}
=================================

Since $k$ is symmetric and positive semidefinite, so is $R$. Thus the corresponding operator $R$ is self-adjoint in $L^2({\mathrm{d}}\mu)$ and is also compact if holds. Then $R$ has a discrete set of nonnegative eigenvalues $\lambda_0{\geqslant}\lambda_1{\geqslant}\cdots {\geqslant}0$, and has the following eigen-decomposition $$\begin{aligned}
R(x,y) = \sum_{j=0}^\infty \lambda_j\, \phi_j(x)\,\phi_j(y),\quad\forall x,y\in S,\end{aligned}$$ where $\{\phi_j\}_{j=0}^\infty$ is an orthonormal basis of $L^2({\mathrm{d}}\mu)$. Note that $$\begin{aligned}
R(x,y) = \sqrt{\frac{\pi(x)}{\pi(y)}}\,p(x,y), \quad\forall x,y\in S.\end{aligned}$$ This implies a decomposition of the transition probability $p(x,y)$ as $$\begin{aligned}
p(x,y) = \sum_{j=0}^\infty \lambda_j\, \psi_j(x)\,\varphi_j(y),\quad\forall x,y\in S,\end{aligned}$$ where $\psi_j(x) = \phi_j(x)/\sqrt{\pi(x)}$ and $\varphi_j(x) = \phi_j(x)\sqrt{\pi(x)}$. In particular, for each $j=0,1,\ldots$, $$\begin{aligned}
P\psi_j(x) &= \sum_{l=0}^\infty \lambda_l \psi_l(x)\, \int_S \varphi_l(y)\, \psi_j(y)\,{\mathrm{d}}\mu(y)=\sum_{l=0}^\infty \lambda_l \psi_l(x)\,\delta_{lj} = \lambda_j \psi_j(x),\quad\forall x\in S,\end{aligned}$$ implying that $\{\psi_j\}_{j=0}^\infty$ are the corresponding (right) eigenfunctions of $P$, with unit $L^2(\pi {\mathrm{d}}\mu)$ norm, associated with the same eigenvalues $\lambda_0{\geqslant}\lambda_1{\geqslant}\cdots {\geqslant}0$. Since $P$ is the transition operator of a Markov chain, $\lambda_0=1$ and $\psi_0\equiv 1$.

For $t\in{\mathbb{N}}_{+}$ and $x,y\in S$, let $p_{t}(x,y)$ be the $t$-step transition probability from $x$ to $y$. By Lemma \[lem:spectral\_decomposition\_Markov\_chain\], we have $$\begin{aligned}
p_t(x,y) = \sum_{j=0}^\infty \lambda_j^t\, \psi_j(x)\,\varphi_j(y) \end{aligned}$$ and $\{\varphi_j\}_{j=0}^\infty$ forms an orthonormal basis of $L^2({\mathrm{d}}\mu/\pi)$. Consequently, by viewing $\lambda_j^t\, \psi_j(x)$ as the coefficient associated with $\varphi_j$ in the orthogonal expansion of function $p_t(x,\cdot)$, we have $$\begin{aligned}
D_{t}^2(x, y) =\|\, p_{t}(x, \cdot) - p_{t}(y, \cdot)\,\|^2_{L^{2}({\mathrm{d}}\mu/\pi)}= \sum_{j=0}^{\infty} \lambda_{j}^{2t} \, [\psi_{j}(x) - \psi_{j}(y)]^{2}. \end{aligned}$$

Empirical diffusion affinity {#app:B}
============================

Similar to the derivations in Appendix \[app:A\], if we define matrix $R_n\in{\mathbb{R}}^{n\times n}$ with $$\begin{aligned}
[R_n]_{ij}=\frac{\kappa(X_i,X_j)}{\sqrt{d_n(X_i)}\sqrt{d_n(X_j)}},\end{aligned}$$ then $\{\lambda_{n,j}\}_{j=0}^{n-1}$ are also the eigenvalues of $R_n$. Let $\phi_{n,j}\in{\mathbb{R}}^n$ denote the unit Euclidean norm eigenvector associated with $\lambda_{n,j}$. Then the empirical probability transition matrix $P_n$ has the decomposition $$\begin{aligned}
P_{n}^t = \sum_{j=0}^{n-1} \lambda_{n,j}^t\, \psi_{n,j}\,\varphi_{n,j}^T,\end{aligned}$$ where $\psi_{n,j} = D_n^{-1/2}\,\phi_{n,j}\in{\mathbb{R}}^n$ and $\varphi_{n,j} = D_n^{1/2}\phi_{n,j}\in{\mathbb{R}}^n$, so that $\psi_{n,j}=D_n^{-1} \varphi_{n,j}$ for each $j\in\{0,1,\dots,n-1\}$. In particular, $\psi_{n,j}$ has unit $L^2(\mbox{diag}(D_n))$ norm, and $\varphi_{n,j}$ has unit $L^2(\mbox{diag}(D_n^{-1}))$ norm, for each $j\in\{0,1,\dots,n-1\}$.

In addition, we have the following relation between the diffusion affinity and $P_n^{2t}$, $$\begin{aligned}
\langle X_i,\, X_j\rangle_{D_{n,t}} = \sum_{l=0}^{n-1} \lambda_{n,l}^{2t} \,[\psi_{n,l}]_i \, [\psi_{n,l}]_j =\sum_{l=0}^{n-1} \lambda_{n,l}^{2t} \, [\psi_{n,l}]_i \, [\varphi_{n,l}]_j d_n^{-1}(X_j)
=[P_n^{2t}D_n^{-1}]_{ij}.\end{aligned}$$

Technical proofs
================

In this appendix, we collect some technical lemmas used in the proofs of our main results.

\[lem:some\_ineq\_feasible\_set\] Let $Z^{*}$ be defined in (\[eqn:Kmeans\_true\_membership\_matrix\]). Then for any $Z \in {\mathscr{C}}$ defined in , we have $$\begin{aligned}
\label{eqn:ineq_1_feasible_set}
\|Z^{*} - Z^{*} Z Z^{*}\|_{1} = \|Z^{*} - Z^{*} Z\|_{1} =&\, 2\sum_{k=1}^K \sum_{m\neq k} \|Z_{G_{k}^{*} G_{m}^{*}}\|_{1}.\end{aligned}$$ In addition, if $Z$ also satisfies $\operatorname{tr}(Z)=\operatorname{tr}(Z^\ast)$, or $Z\in {\mathscr{C}}_K$, where ${\mathscr{C}}_K$ is defined in , then $$\begin{aligned}
\label{eqn:ineq_2_feasible_set}
{{\left\vert\kern-0.25ex\left\vert\kern-0.25ex\left\vert (I-Z^{*}) Z (I-Z^{*}) 
    \right\vert\kern-0.25ex\right\vert\kern-0.25ex\right\vert}}_{\ast} = &\, \sum_{k=1}^K \sum_{m\neq k} \frac{1}{n_k}\, \|Z_{G_{k}^{*} G_{m}^{*}}\|_{1} {\leqslant}{\|Z^{*} - Z^{*} Z\|_{1} \over 2 \underline{n}}, \\
\label{eqn:ineq_3_feasible_set}
\|Z^{*} - Z^{*} Z\|_{1} {\leqslant}\|Z^{*} - Z\|_{1} {\leqslant}& \, n\,{{\left\vert\kern-0.25ex\left\vert\kern-0.25ex\left\vert (I-Z^{*}) Z (I-Z^{*}) 
    \right\vert\kern-0.25ex\right\vert\kern-0.25ex\right\vert}}_{\ast} {\leqslant}{2 n \over \underline{n}} \|Z^{*} - Z^{*} Z\|_{1}.\end{aligned}$$

Inequalities  and  follows from Lemma 1 in [@GiraudVerzelen2018]. Inequality  is due to inequality (57) in [@BuneaGiraudRoyerVerzelen2016].

\[lem:some\_ineq\_feasible\_set\_adaptive\] Let $Z^{*}$ be defined in (\[eqn:Kmeans\_true\_membership\_matrix\]). Then for any $Z \in {\mathscr{C}}$ defined in (\[eqn:clustering\_Kmeans\_sdp\_unknown\_K\]), we have $$\begin{aligned}
{{\left\vert\kern-0.25ex\left\vert\kern-0.25ex\left\vert (I-Z^{*}) Z (I-Z^{*}) 
    \right\vert\kern-0.25ex\right\vert\kern-0.25ex\right\vert}}_{\ast}{\leqslant}&\, \sum_{k=1}^K \sum_{m\neq k} \frac{1}{n_k}\, \|Z_{G_{k}^{*} G_{m}^{*}}\|_{1} + \operatorname{tr}(Z) - \operatorname{tr}(Z^\ast),\\
\|Z^{*} - Z\|_{1} {\leqslant}& \,4n\,\sum_{k=1}^K \sum_{m\neq k} \frac{1}{n_k}\, \|Z_{G_{k}^{*} G_{m}^{*}}\|_{1}+ n \big(\operatorname{tr}(Z) - \operatorname{tr}(Z^\ast)\big),\end{aligned}$$ and  holds for $Z \in {\mathscr{C}}$.

The first inequality follows from inequality (57) in [@BuneaGiraudRoyerVerzelen2016]. The second one follows from the first,  , and the following decomposition, $$\begin{aligned}
Z - Z^\ast  = (I-Z^{*}) Z (I-Z^{*})  + (Z^\ast Z - Z^\ast) + (Z Z^\ast - Z^\ast) + (Z^\ast - Z^\ast ZZ^\ast),\end{aligned}$$ with inequality $\|U\|_1 {\leqslant}n {{\left\vert\kern-0.25ex\left\vert\kern-0.25ex\left\vert U 
    \right\vert\kern-0.25ex\right\vert\kern-0.25ex\right\vert}}_{\mbox{\scriptsize op}} {\leqslant}n {{\left\vert\kern-0.25ex\left\vert\kern-0.25ex\left\vert U 
    \right\vert\kern-0.25ex\right\vert\kern-0.25ex\right\vert}}_{\ast}$ for any matrix $U\in {\mathbb{R}}^{n\times n}$.

[^1]: X. Chen’s research is supported in part by NSF DMS-1404891, NSF CAREER Award DMS-1752614, and UIUC Research Board Awards (RB17092, RB18099). Y. Yang’s research is supported in part by NSF DMS-1810831. This work is completed in part with the high-performance computing resource provided by the Illinois Campus Cluster Program at UIUC. Authors are listed in alphabetical order
