SlowGuess/NeurIPS_2023_OCR huggingface dataset:
We would like to further emphasize that homological noises are not restricted to 0-dimension lying outside the estimated support (red point in the persistence diagram of Figure A1). 0-dimensional homological noise inside the estimated support (green point in the persistence diagram of Figure A1), 1-dimensional homological noise can also arise, and the bootstrap bandwidth  $c_{\mathcal{X}}$  allows to simultaneously filter them.
D Assumptions on distributions and kernels
For distributions, we assume that the order of probability volume decay  $P(\mathcal{B}(x,r))$  is at least  $r^d$ .
Assumption A1. For all  $x \in \operatorname{supp}(P)$  and  $y \in \operatorname{supp}(Q)$ ,
$$
\liminf_{r\to 0}\frac{P\left(\mathcal{B}(x,r)\right)}{r^{d}} >0,\qquad \liminf_{r\to 0}\frac{Q\left(\mathcal{B}(y,r)\right)}{r^{d}} >0.
$$
Remark D.1. Assumption A1 is analogous to Assumption 2 of Kim et al. [37], but is weaker since the condition is pointwise on each  $x \in \mathbb{R}^d$ . And this condition is much weaker than assuming a density on  $\mathbb{R}^d$ : for example, a distribution supported on a low-dimensional manifold satisfies Assumption A1. This provides a framework suitable for high dimensional data, since many times high dimensional data lies on a low dimensional structure hence its density on  $\mathbb{R}^d$  cannot exist. See Kim et al. [37] for a more detailed discussion.
For kernel functions, we assume the following regularity conditions:
Assumption A2. Let  $K: \mathbb{R}^d \to \mathbb{R}$  be a nonnegative function with  $\| K \|_1 = 1$ ,  $\| K \|_\infty$ ,  $\| K \|_2 < \infty$ , and satisfy the following:
Figure A1: To robustly estimate the support, we use the bootstrap bandwidth  $c_{\alpha}$  to filter out topological noise (orange) and keep topological signal (skyblue). Then TopP&R is computed on this support.
(i)  $K(0) > 0$
(ii)  $K$  has a compact support.
(iii)  $K$  is Lipschitz continuous and of second order.
Assumption A2 allows to build a valid bootstrap confidence band for kernel density estimator (KDE). See Theorem 12 of [26] or Theorem 3.4 of [38]
Proposition D.2 (Theorem 3.4 of [38]). Let  $\mathcal{X} = \{X_1, \ldots, X_n\}$  be IID from a distribution  $P$ . For  $h > 0$ , let  $\hat{p}_h, \hat{p}_h^*$  be kernel density estimator for  $\mathcal{X}$  and its bootstrap  $\mathcal{X}^*$ , respectively, and for  $\alpha \in (0,1)$ , let  $c_{\mathcal{X}}$  be the  $\alpha$  bootstrap quantile from  $\sqrt{n h^d} \| \hat{p}_h - \hat{p}_h^* \|_{\infty}$ . For  $h_n \to 0$ ,
$$
\mathbb {P} \left(\sqrt {n h _ {n} ^ {d}} \| \hat {p} _ {h _ {n}} - p _ {h _ {n}} \| _ {\infty} > c _ {\mathcal {X}}\right) = \alpha + \left(\frac {\log n}{n h _ {n} ^ {d}}\right) ^ {\frac {4 + d}{4 + 2 d}}.
$$
Assumption A1, A2 ensures that, when the bandwidth  $h_n \to 0$ , average KDEs are bounded away from 0.
Lemma D.3. Let  $P$  be a distribution satisfying Assumption A1. Suppose  $K$  is a nonnegative function satisfying  $K(0) > 0$  and continuous at 0. Suppose  $\{h_n\}_{n \in \mathbb{N}}$  is given with  $h_n \geq 0$  and  $h_n \to 0$ . Then for all  $x \in \operatorname{supp}(P)$ ,
$$
\liminf_{n\to \infty}p_{h_{n}}(x) > 0.
$$
Proof. Since  $K(0) > 0$  and  $K$  is continuous at 0, there is  $r_0 > 0$  such that for all  $y \in \mathcal{B}(0, r_0)$ ,  $K(y) \geq \frac{1}{2} K(0) > 0$ . And hence
$$
\begin{array}{l} p _ {h} (x) = \int \frac {1}{h ^ {d}} K \left(\frac {x - y}{h}\right) d P (y) \geq \int \frac {K (0)}{2 h ^ {d}} 1 \left(\frac {x - y}{h} \in \mathcal {B} (0, r _ {0})\right) d P (y) \\ \geq \frac {K (0)}{2 h ^ {d}} P \left(\mathcal {B} (x, r _ {0} h)\right). \\ \end{array}
$$
Hence as  $h_n \to 0$ ,
Before specifying the rate of convergence, we introduce the concept of reach. First introduced by [39], the reach is a quantity expressing the degree of geometric regularity of a set. Given a closed subset  $A \subset \mathbb{R}^d$ , the medial axis of  $A$ , denoted by  $\operatorname{Med}(A)$ , is the subset of  $\mathbb{R}^d$  consisting of all the points that have at least two nearest neighbors on  $A$ .
$$
\operatorname {M e d} (A) = \left\{x \in \mathbb {R} ^ {d} \backslash A \colon \exists q _ {1} \neq q _ {2} \in A, | | q _ {1} - x | | = | | q _ {2} - x | | = d (x, A) \right\},
$$
where  $d(x, A) = \inf_{q \in A} ||q - x||$  denotes the distance from a generic point  $x \in \mathbb{R}^d$  to  $A$ . The reach of  $A$  is then defined as the minimal distance from  $A$  to  $\operatorname{Med}(A)$ .
Definition D.4. The reach of a closed subset  $A\subset \mathbb{R}^d$  is defined as
$$
\operatorname {r e a c h} (A) = \inf  _ {q \in A} d \left(q, \operatorname {M e d} (A)\right) = \inf  _ {q \in A, x \in \operatorname {M e d} (A)} | | q - x | |.
$$
Now, for specifying the rate of convergence, we first assume that distributions have densities away from 0 and  $\infty$ .
Assumption A3.  $P$  and  $Q$  have Lebesgue densities  $p$  and  $q$  that, there exists  $0 < p_{\min} \leq p_{\max} < \infty$ ,  $0 < q_{\min} \leq q_{\max} < \infty$  with for all  $x \in \operatorname{supp}(P)$  and  $y \in \operatorname{supp}(Q)$ ,
$$
p _ {\min } \leq p (x) \leq p _ {\max }, \quad q _ {\min } \leq q (x) \leq q _ {\max }.
$$
We also assume weak geometric assumptions on the support of the distributions  $\operatorname{supp}(P)$  and  $\operatorname{supp}(Q)$ , being bounded and having positive reach.
Assumption A4. We assume  $\operatorname{supp}(P)$  and  $\operatorname{supp}(Q)$  are bounded. And the support of  $P$  and  $Q$  have positive reach, i.e.  $\operatorname{reach}(\operatorname{supp}(P)) > 0$  and  $\operatorname{reach}(\operatorname{supp}(Q)) > 0$ .
Sets with positive reach ensure that the volume of its tubular neighborhood grows in polynomial order, which is Theorem 26 from [40] and originally from [39].
Proposition D.5. Let  $A$  be a set with  $\operatorname{reach}(A) > 0$ . Let  $A_r \coloneqq \{x \in \mathbb{R}^d : d(x, A) \leq r\}$ . Then for  $r < \operatorname{reach}(A)$ , there exists  $a_0, \ldots, a_d \in \mathbb{R} \cup \{\infty\}$  that satisfies
$$
\lambda_ {d} (A _ {r}) = \sum_ {k = 0} ^ {d - 1} a _ {k} r ^ {k},
$$
where  $\lambda_{d}$  is the usual Lebesgue measure of  $\mathbb{R}^d$
E Details and Proofs for Section 4
For a random variable  $X$  and  $\alpha \in (0,1)$ , let  $q_{X,\alpha}$  be upper  $\alpha$ -quantile of  $X$ , i.e.,  $\mathbb{P}(X \geq q_{\alpha}) = \alpha$ , or equivalently,  $\mathbb{P}(X < q_{\alpha}) = 1 - \alpha$ . Let  $\tilde{p}_h$  be the KDE on  $\mathcal{X}^0$ . For a finite set  $\mathcal{X}$ , we use the notation  $c_{\mathcal{X},\alpha}$  for  $\alpha$ -bootstrap quantile satisfying  $\mathbb{P}\left(\| \hat{p}_{\mathcal{X},h_n} - \hat{p}_{\mathcal{X}^b,h_n}\|_\infty < c_{\mathcal{X},\alpha}|\mathcal{X}\right) = 1 - \alpha$ , where  $\mathcal{X}^b$  is the bootstrap sample from  $\mathcal{X}$ . For a distribution  $P$ , we use the notation  $c_{P,\alpha}$  for  $\alpha$ -quantile satisfying  $\mathbb{P}\left(\| \hat{p}_{h_n} - p_{h_n}\|_\infty < c_{P,\alpha}\right) = 1 - \alpha$ , where  $\hat{p}_{h_n}$  is kernel density estimator of IID samples from  $P$ . Hence when  $\mathcal{X}$  is not IID samples from  $P$ , the relation of Proposition D.2 may not hold.
Claim E.1. Let  $Z \sim \mathcal{N}(0, 1)$  be a sample from standard normal distribution, then for  $\alpha \in (0, 1)$ ,
$$
q _ {Z, \alpha} = \Theta \left(\sqrt {\log (1 / \alpha)}\right).
$$
And for  $0 \leq \delta < \alpha < 1$ ,
$$
q _ {Z, \alpha} - q _ {Z, \alpha + \delta} = \left(\delta \alpha \sqrt {\log (1 / \alpha)}\right)
$$
Proof. Let  $Z \sim \mathcal{N}(0,1)$ , then for all  $x > 2$
$$
\frac {1}{2 x} \exp \left(- \frac {x ^ {2}}{2}\right) \leq \mathbb {P} (Z > x) \leq \frac {1}{x} \exp \left(- \frac {x ^ {2}}{2}\right).
$$
Then  $x = C\sqrt{\log(1 / \alpha)}$  gives
$$
\frac {\alpha^ {C / 2}}{2 C \sqrt {\log (1 / \alpha)}} \leq \mathbb {P} (Z > x) \leq \frac {\alpha^ {C / 2}}{C \sqrt {\log (1 / \alpha)}}.
$$
And hence
$$
q _ {Z, \alpha} = \Theta \left(\sqrt {\log (1 / \alpha)}\right),
$$
and in particular,
$$
\exp \left(- \frac {q _ {Z , \alpha} ^ {2}}{2}\right) = \Theta \left(\alpha \sqrt {\log (1 / \alpha)}\right).
$$
Now for  $0 \leq \delta < \alpha < 1$ ,
$$
\begin{array}{l} \left(q _ {Z, \alpha} - q _ {Z, \alpha + \delta}\right) \exp \left(- \frac {q _ {Z , \alpha} ^ {2}}{2}\right) \leq \int_ {q _ {Z, \alpha + \delta}} ^ {q _ {Z, \alpha}} \exp \left(- \frac {t ^ {2}}{2}\right) d t = \delta \\ \leq \left(q _ {Z, \alpha} - q _ {Z, \alpha + \delta}\right) \exp \left(- \frac {q _ {Z , \alpha + \delta} ^ {2}}{2}\right). \\ \end{array}
$$
$$
q _ {Z, \alpha} - q _ {Z, \alpha + \delta} \leq \delta \exp \left(- \frac {q _ {Z , \alpha + \delta} ^ {2}}{2}\right) = \Theta (\delta (\alpha + \delta) \sqrt {\log (1 / \alpha)}),
$$
$$
q _ {Z, \alpha} - q _ {Z, \alpha + \delta} \geq \delta \exp \left(- \frac {q _ {Z , \alpha} ^ {2}}{2}\right) = \Theta \left(\delta \alpha \sqrt {\log (1 / (\alpha + \delta))}\right).
$$
Then from  $\delta <  \alpha$
$$
q _ {Z, \alpha} - q _ {Z, \alpha + \delta} = \Theta (\delta \alpha \sqrt {\log (1 / \alpha)}).
$$
Claim E.2. Let  $X, Y$  be random variables, and  $0 \leq \delta < \alpha < 1$ . Suppose there exists  $c > 0$  satisfying
$$
\mathbb {P} \left(| X - Y | > c\right) \leq \delta . \tag {6}
$$
$$
q _ {X, \alpha + \delta} - c \leq q _ {Y, \alpha} \leq q _ {X, \alpha - \delta} + c.
$$
Proof. Note that  $q_{X,a - \delta}$  satisfies  $\mathbb{P}(X > q_{X,\alpha -\delta}) = \alpha -\delta$  . Then from (6),
$$
\begin{array}{l} \mathbb {P} \left(Y > q _ {X, \alpha - \delta} + c\right) \leq \mathbb {P} \left(Y > q _ {X, \alpha - \delta} + c, | X - Y | \leq c\right) + \mathbb {P} \left(| X - Y | > c\right) \\ \leq \mathbb {P} (X > q _ {X, \alpha - \delta}) + \delta = \alpha . \\ \end{array}
$$
$$
q _ {Y, \alpha} \leq q _ {X, \alpha - \delta} + c.
$$
Then changing the role of  $X$  and  $Y$  gives
$$
q _ {X, \alpha + \delta} - c \leq q _ {Y, \alpha}.
$$
Lemma E.3. (i) Under Assumption 1, 2 and A2,
$$
\left\| \hat {p} _ {h} - \tilde {p} _ {h} \right\| _ {\infty} \leq \frac {\rho_ {n} \left\| K \right\| _ {\infty}}{h ^ {d}}.
$$
(ii) Under Assumption 1, 2 and A2, with probability  $1 - \delta$
$$
c _ {\mathcal {X} ^ {0}, \alpha + \delta} - O \left(\frac {\rho_ {n}}{h ^ {d}} + \sqrt {\frac {\rho_ {n} \log (1 / \delta)}{n h ^ {2 d}}}\right) \leq c _ {\mathcal {X}, \alpha} \leq c _ {\mathcal {X} ^ {0}, \alpha - \delta} + O \left(\frac {\rho_ {n}}{h ^ {d}} + \sqrt {\frac {\rho_ {n} \log (1 / \delta)}{n h ^ {2 d}}}\right).
$$
(iii) Suppose Assumption 1, 2, A2 hold, and let  $\alpha, \delta_n \in (0,1)$ . Suppose  $nh_n^d \to \infty$ ,  $\delta_n^{-1} = O\left(\left(\frac{\log n}{nh_n^d}\right)^{\frac{4 + d}{4 + 2d}}\right)$  and  $nh_n^{-d}\rho_n^2\delta_n^{-2} \to 0$ . Then with probability  $1 - \alpha - 4\delta_n$ ,
$$
\left\| \hat {p} _ {h} - p _ {h} \right\| _ {\infty} <   c \chi_ {, \alpha} \leq c _ {P, \alpha - 3 \delta_ {n}}.
$$
Proof. (i)
$$
\hat {p} _ {h} (x) - \tilde {p} _ {h} (x) = \frac {1}{n h ^ {d}} \sum_ {i = 1} ^ {n} \left(K \left(\frac {x - X _ {i}}{h}\right) - K \left(\frac {x - X _ {i} ^ {0}}{h}\right)\right).
$$
Then under Assumption A2,
$$
\begin{array}{l} \left\| \hat {p} _ {h} - \tilde {p} _ {h} \right\| _ {\infty} \leq \frac {1}{n h ^ {d}} \sum_ {i = 1} ^ {n} \left\| K \left(\frac {\cdot - X _ {i}}{h}\right) - K \left(\frac {\cdot - X _ {i} ^ {0}}{h}\right) \right\| _ {\infty} \\ \leq \frac {1}{n h ^ {d}} \sum_ {i = 1} ^ {n} \| K \| _ {\infty} I (X _ {i} \neq X _ {i} ^ {0}). \\ \end{array}
$$
Then from Assumption 2,  $\sum_{i=1}^{n} I(X_i \neq X_i^0) \leq n\rho_n$ , and hence
$$
\| \hat {p} _ {h} - \tilde {p} _ {h} \| _ {\infty} \leq \frac {\| K \| _ {\infty} \rho_ {n}}{h ^ {d}}.
$$
Let  $\mathcal{X}_b$ ,  $\mathcal{X}_b^0$  be bootstrapped samples of  $\mathcal{X}$ ,  $\mathcal{X}^0$  with the same sampling with replacement process. Let  $\hat{p}_h^b$ ,  $\tilde{p}_h^b$  be KDE of  $\mathcal{X}_b$  and  $\mathcal{X}_b^0$ , respectively. And, note that
$$
\left| \left\| \hat {p} _ {h} - \hat {p} _ {h} ^ {b} \right\| _ {\infty} - \left\| \tilde {p} _ {h} - \tilde {p} _ {h} ^ {b} \right\| _ {\infty} \right| \leq \| \hat {p} _ {h} - \tilde {p} _ {h} \| _ {\infty} + \left\| \hat {p} _ {h} ^ {b} - \tilde {p} _ {h} ^ {b} \right\| _ {\infty}.
$$
Let  $L_{b}$  be the number of elements where  $\mathcal{X}_b$  and  $\mathcal{X}_b^0$  differ, i.e.,  $L_{b} = |\mathcal{X}_{b}\backslash \mathcal{X}_{b}^{0}| = |\mathcal{X}_{b}^{0}\backslash \mathcal{X}_{b}|$ , then  $L_{b}\sim \mathrm{Binomial}(n,\rho_{n})$ , and
$$
\left\| \hat {p} _ {h} ^ {b} - \tilde {p} _ {h} ^ {b} \right\| _ {\infty} \leq \frac {\| K \| _ {\infty} L _ {b}}{n h ^ {d}}.
$$
And hence,
$$
\left| \left\| \hat {p} _ {h} - \hat {p} _ {h} ^ {b} \right\| _ {\infty} - \left\| \tilde {p} _ {h} - \tilde {p} _ {h} ^ {b} \right\| _ {\infty} \right| \leq \frac {\left\| K \right\| _ {\infty} \left(n \rho_ {n} + L _ {b}\right)}{n h ^ {d}}. \tag {7}
$$
Then by Hoeffding's inequality, with probability  $1 - \delta$
$$
L _ {b} \leq n \rho_ {n} + \sqrt {\frac {n \log (1 / \delta)}{2}}.
$$
by applying this to (7), with probability  $1 - \delta$
$$
\left| \left| \left| \hat {p} _ {h} - \hat {p} _ {h} ^ {b} \right| \right| _ {\infty} - \left| \left| \tilde {p} _ {h} - \tilde {p} _ {h} ^ {b} \right| \right| _ {\infty} \right| \leq O \left(\frac {\rho_ {n}}{h ^ {d}} + \sqrt {\frac {\rho_ {n} \log (1 / \delta)}{n h ^ {2 d}}}\right).
$$
Hence applying Claim E.2 implies that, with probability  $1 - \delta$
Let  $\tilde{\delta}_n\coloneqq O\left(\left(\frac{\log n}{nh_n^d}\right)^{\frac{4 + d}{4 + 2d}}\right)$  be from RHS of Proposition D.2, then for large enough  $n$ $\delta_{n}\geq \tilde{\delta}_{n}$  Note that Proposition D.2 implies that for all  $\alpha \in (0,1)$
$$
c _ {P, \alpha + \delta_ {n}} \leq c _ {\chi_ {0}, \alpha} \leq c _ {P, \alpha - \delta_ {n}}. \tag {8}
$$
Now,  $nh_n^d \to \infty$  implies that  $\sqrt{nh_n^d} (\tilde{p}_{h_n} - p_{h_n})$  converges to a Gaussian process, and then Claim E.2 implies that  $c_{P,\alpha} = \Theta \left(\sqrt{\frac{\log(1 / \alpha)}{nh_n^d}}\right)$  and
$$
c _ {P, \alpha} - c _ {P, \alpha + \delta_ {n}} = \Theta \left(\delta_ {n} \alpha \sqrt {\frac {\log (1 / \alpha)}{n h _ {n} ^ {d}}}\right). \tag {9}
$$
Then under Assumption 2, since  $nh_n^{-d}\rho_n^2\delta_n^{-2} = o(1)$  and  $n\rho_{n}\geq 1$  implies  $h_n^{-d}\rho_n\delta_n^{-2} = o(1)$ , and then
$$
\frac {\rho_ {n}}{h _ {n} ^ {d}} + \sqrt {\frac {\rho_ {n} \log (1 / \delta)}{n h _ {n} ^ {2 d}}} = O \left(\delta_ {n} \alpha \sqrt {\frac {\log (1 / \alpha)}{n h _ {n} ^ {d}}}\right). \tag {10}
$$
Then (8), (9), (10) implies that
$$
c _ {P, \alpha + 3 \delta_ {n}} \leq c _ {P, \alpha + 2 \delta_ {n}} - O \left(\delta_ {n} \alpha \sqrt {\frac {\log (1 / \alpha)}{n h _ {n} ^ {d}}}\right) \leq c _ {\mathcal {X} ^ {0}, \alpha + \delta_ {n}} - O \left(\frac {\rho_ {n}}{h _ {n} ^ {d}} + \sqrt {\frac {\rho_ {n} \log (1 / \delta)}{n h _ {n} ^ {2 d}}}\right), \tag {11}
$$
$$
c _ {\mathcal {X} ^ {0}, \alpha - \delta_ {n}} + O \left(\frac {\rho_ {n}}{h _ {n} ^ {d}} + \sqrt {\frac {\rho_ {n} \log (1 / \delta)}{n h _ {n} ^ {2 d}}}\right) \leq c _ {P, \alpha - 2 \delta_ {n}} + O \left(\delta_ {n} \alpha \sqrt {\frac {\log (1 / \alpha)}{n h _ {n} ^ {d}}}\right) \leq c _ {P, \alpha - 3 \delta_ {n}}. \tag {12}
$$
Now, from the definition of  $c_{P,\alpha +3\delta_n}$ , with probability  $1 - \alpha -3\delta_{n}$
$$
\left\| \hat {p} _ {h} - p _ {h} \right\| _ {\infty} \leq c _ {P, \alpha + 3 \delta_ {n}}. \tag {13}
$$
And (ii) implies that, with probability  $1 - \delta_{n}$
$$
c _ {\mathcal {X} ^ {0}, \alpha + \delta_ {n}} - O \left(\frac {\rho_ {n}}{h _ {n} ^ {d}} + \sqrt {\frac {\rho_ {n} \log (1 / \delta)}{n h _ {n} ^ {2 d}}}\right) \leq c _ {\mathcal {X}, \alpha} \leq c _ {\mathcal {X} ^ {0}, \alpha - \delta_ {n}} + O \left(\frac {\rho_ {n}}{h _ {n} ^ {d}} + \sqrt {\frac {\rho_ {n} \log (1 / \delta)}{n h _ {n} ^ {2 d}}}\right). \tag {14}
$$
Hence by combining (11), (12), (13), (14), with probability  $1 - \alpha - 4\delta_{n}$
$$
\begin{array}{l} \left\| \hat {p} _ {h} - p _ {h} \right\| _ {\infty} \leq c _ {P, \alpha + 3 \delta_ {n}} \\ \leq c _ {\mathcal {X} ^ {0}, \alpha + \delta_ {n}} - O \left(\frac {\rho_ {n}}{h _ {n} ^ {d}} + \sqrt {\frac {\rho_ {n} \log (1 / \delta)}{n h _ {n} ^ {2 d}}}\right) \\ \leq c \chi_ {, \alpha} \\ \leq c _ {\mathcal {X} ^ {0}, \alpha - \delta_ {n}} + O \left(\frac {\rho_ {n}}{h _ {n} ^ {d}} + \sqrt {\frac {\rho_ {n} \log (1 / \delta)}{n h _ {n} ^ {2 d}}}\right) \\ \leq c _ {P, \alpha - 3 \delta_ {n}}. \\ \end{array}
$$
Corollary E.4. Suppose Assumption 1, 2, A2 hold, and let  $\alpha \in (0,1)$ . Suppose  $\delta_n^{-1} = O\left(\left(\frac{\log n}{nh_n^d}\right)^{\frac{4 + d}{4 + 2d}}\right)$  and  $nh_n^{-d}\rho_n^2\delta_n^{-2}\to 0$ . Then with probability  $1 - \alpha -4\delta_{n}$
(i) Let  $\delta_{n}\in (0,1)$  and suppose  $nh_n^d\to \infty$ $\delta_n^{-1} = O\left(\left(\frac{\log n}{nh_n^d}\right)^{\frac{4 + d}{4 + 2d}}\right)$  and  $nh_n^{-d}\rho_n^2\delta_n^{-2}\rightarrow 0.$  Then with probability  $1 - \alpha -4\delta_{n}$
$$
p _ {h _ {n}} ^ {- 1} \left[ 2 c _ {P, \alpha - 3 \delta_ {n}}, \infty\right) \subset \hat {p} _ {h _ {n}} ^ {- 1} \left[ c _ {\mathcal {X}, \alpha}, \infty\right) \subset \operatorname {s u p p} \left(P _ {h _ {n}}\right).
$$
(ii) Let  $\delta_m \in (0,1)$  and suppose  $mh_m^d \to \infty$ ,  $\delta_m^{-1} = O\left(\left(\frac{\log m}{mh_m^d}\right)^{\frac{4 + d}{4 + 2d}}\right)$  and  $mh_m^{-d}\rho_m^2\delta_m^{-2} \to 0$ . Then with probability  $1 - \alpha - 4\delta_m$ ,
$$
q _ {h _ {m}} ^ {- 1} \left[ 2 c _ {Q, \alpha - 3 \delta_ {m}}, \infty\right) \subset \hat {q} _ {h _ {m}} ^ {- 1} \left[ c _ {\mathcal {Y}, \alpha}, \infty\right) \subset \operatorname {s u p p} \left(Q _ {h _ {m}}\right).
$$
Lemma E.3 (iii) implies that with probability  $1 - \alpha - 4\delta_{n}$ ,  $\| \hat{p}_{h} - p_{h}\| < c_{\mathcal{X},\alpha} \leq c_{P,\alpha - 3\delta_{n}}$ . This implies
This can be proven similarly to (i).
Claim E.5. For a nonnegative measure  $\mu$  and sets  $A, B, C, D$ ,
$$
\mu (A \cap B) - \mu (C \cap D) \leq \mu (A \backslash C) + \mu (B \backslash D).
$$
$$
\begin{array}{l} \mu (A \cap B) - \mu (C \cap D) \leq \mu ((A \cap B) \backslash (C \cap D)) = \mu ((A \cap B) \cap (C ^ {\mathbb {C}} \cup D ^ {\mathbb {C}})) \\ = \mu ((A \cap B) \cap C ^ {\mathbb {C}}) \cup (A \cap B) \cap D ^ {\mathbb {C}})) \\ \leq \mu ((A \cap B) \backslash C) + \mu (A \cap B) \backslash D) \\ \leq \mu (A \backslash C) + \mu (B \backslash D). \\ \end{array}
$$
From here, let  $P_{n}$  and  $Q_{m}$  be the empirical measures on  $\mathcal{X}$  and  $\mathcal{Y}$ , respectively, i.e.,  $P_{n} = \frac{1}{n}\sum_{i=1}^{n}\delta_{X_{i}}$  and  $Q_{m} = \frac{1}{m}\sum_{j=1}^{m}\delta_{Y_{j}}$ .
Lemma E.6. Suppose Assumption 1, 2 hold. Let  $A \subset \mathbb{R}^d$ . Then with probability  $1 - \delta$
$$
\left| P _ {n} - P \right| (A) \leq \rho_ {n} + \sqrt {\frac {\log (2 / \delta)}{2 n}},
$$
$$
P _ {n} (A) \leq P (A) + \rho_ {n} + \sqrt {\frac {\log (2 / \delta)}{n}}.
$$
Proof. Let  $P_{n}^{0}$  be the empirical measure on  $\mathcal{X}^0$ , i.e.,  $P_{n}^{0} = \frac{1}{n}\sum_{i = 1}^{n}\delta_{X_{i}^{0}}$ . By using Hoeffding's inequality,
$$
\mathbb {P} \left(\left| \left(P _ {n} ^ {0} - P\right) (A) \right| \geq t\right) \leq 2 \exp (- 2 n t ^ {2}),
$$
and hence with probability  $1 - \delta$
$$
\left| P _ {n} ^ {0} - P \right| (A) \leq \sqrt {\frac {\log (2 / \delta)}{2 n}}.
$$
And  $\left|P_{n} - P_{n}^{0}\right|(A)$  is expanded as
$$
\left| P _ {n} - P _ {n} ^ {0} \right| (A) = \frac {1}{n} \sum_ {i = 1} ^ {n} \left| I \left(X _ {i} \in A\right) - I \left(X _ {i} ^ {0} \in A\right) \right|.
$$
Under Assumption 2,  $\sum_{i=1}^{n} I\left(X_{i} \neq X_{i}^{0}\right) \leq n \rho_{n}$ , and hence
$$
\begin{array}{l} \left| P _ {n} - P _ {n} ^ {0} \right| (A) = \frac {1}{n} \sum_ {i = 1} ^ {n} \left| I \left(X _ {i} \in A\right) - I \left(X _ {i} ^ {0} \in A\right) \right| \\ \leq \frac {1}{n} \sum_ {i = 1} ^ {n} I \left(X _ {i} \neq X _ {i} ^ {0}\right) = \rho_ {n}. \\ \end{array}
$$
Therefore, with probability  $1 - \delta$
$$
\left| P _ {n} - P \right| (A) \leq \rho_ {n} + \sqrt {\frac {\log (2 / \delta)}{2 n}}.
$$
Claim E.7. Suppose Assumption 1, 2, A1, A2 hold, and let  $\delta_{n},\delta_{m}\in (0,1)$ . Suppose  $nh_n^d\to \infty$ ,  $mh_m^d\to \infty$ ,  $\delta_n^{-1} = O\left(\left(\frac{\log n}{nh_n^d}\right)^{\frac{4 + d}{4 + 2d}}\right)$ ,  $\delta_m^{-1} = O\left(\left(\frac{\log m}{mh_m^d}\right)^{\frac{4 + d}{4 + 2d}}\right)$ ,  $nh_n^{-d}\rho_n^2\delta_n^{-2}\to 0$ , and  $nh_m^{-d}\rho_m^2\delta_m^{-2}\to 0$ . Let
$$
B _ {n, m} := \left(\operatorname {s u p p} (P) \backslash p _ {h _ {n}} ^ {- 1} [ 2 c _ {P}, \infty)\right) \cup q _ {h _ {m}} ^ {- 1} (0, 2 c _ {Q}) \cup \operatorname {s u p p} \left(P _ {h _ {n}}\right) \backslash \operatorname {s u p p} (P). \tag {15}
$$
(i) With probability  $1 - 2\alpha -4\delta_{n} - 8\delta_{m}$
$$
\begin{array}{l} \left| Q _ {m} \left(\hat {p} _ {h _ {n}} ^ {- 1} \left[ c _ {\mathcal {X}}, \infty\right) \cap \hat {q} _ {h _ {m}} ^ {- 1} \left[ c _ {\mathcal {Y}}, \infty\right)\right) - Q _ {m} \left(\operatorname {s u p p} (P) \cap \operatorname {s u p p} (Q)\right) \right| \\ \leq C \left(Q \left(B _ {n, m}\right) + \rho_ {m} + \sqrt {\frac {\log (1 / \delta)}{m}}\right). \\ \end{array}
$$
(ii) With probability  $1 - 2\alpha -8\delta_{m}$
$$
\left| Q _ {m} \left(\hat {q} _ {h _ {m}} ^ {- 1} [ c _ {\mathcal {Y}}, \infty)\right) - Q _ {m} (\operatorname {s u p p} (Q)) \right| \leq C \left(Q \left(q _ {h _ {m}} ^ {- 1} (0, 2 c _ {Q})\right) + \rho_ {m} + \sqrt {\frac {\log (1 / \delta)}{m}}\right).
$$
(iii) With probability  $1 - 2\alpha -4\delta_{n} - 9\delta_{m}$
$$
\begin{array}{l} \left| Q _ {m} \left(\hat {p} _ {h _ {n}} ^ {- 1} [ c _ {\mathcal {X}}, \infty) \cap \hat {q} _ {h _ {m}} ^ {- 1} [ c _ {\mathcal {Y}}, \infty)\right) - Q (\operatorname {s u p p} (P)) \right| \\ \leq C \left(Q (B _ {n, m}) + \rho_ {m} + \sqrt {\frac {\log (1 / \delta)}{m}}\right). \\ \end{array}
$$
(iv) With probability  $1 - 2\alpha -9\delta_{m}$
$$
\left| Q _ {m} \left(\hat {q} _ {h _ {m}} ^ {- 1} [ c _ {\mathcal {Y}}, \infty)\right) - 1 \right| \leq C \left(Q \left(q _ {h _ {m}} ^ {- 1} (0, 2 c _ {Q})\right) + \rho_ {m} + \sqrt {\frac {\log (1 / \delta)}{m}}\right).
$$
(v) As  $n,m\to \infty$ $B_{n,m}\rightarrow \emptyset$  . And in particular,
$$
Q (B _ {n, m}) \to 0.
$$
From Corollary E.4 (i) and (ii), with probability  $1 - 2\alpha - 4(\delta_n + \delta_m)$ ,
$$
\begin{array}{l} Q _ {m} \left(p _ {h _ {n}} ^ {- 1} [ 2 c _ {P}, \infty) \cap q _ {h _ {m}} ^ {- 1} [ 2 c _ {Q}, \infty)\right) \leq Q _ {m} \left(\hat {p} _ {h _ {n}} ^ {- 1} [ c _ {\mathcal {X}}, \infty) \cap \hat {q} _ {h _ {m}} ^ {- 1} [ c _ {\mathcal {Y}}, \infty)\right) \\ \leq Q _ {m} \left(\operatorname {s u p p} \left(P _ {h _ {n}}\right) \cap \operatorname {s u p p} \left(Q _ {h _ {m}}\right)\right). \tag {16} \\ \end{array}
$$
Then from the first inequality of (16), combining with Claim E.5 gives
$$
\begin{array}{l} Q _ {m} \left(\hat {p} _ {h _ {n}} ^ {- 1} [ c _ {\mathcal {X}}, \infty) \cap \hat {q} _ {h _ {m}} ^ {- 1} [ c _ {\mathcal {Y}}, \infty)\right) - Q _ {m} \left(\operatorname {s u p p} (P) \cap \operatorname {s u p p} (Q)\right) \\ \geq Q _ {m} \left(p _ {h _ {n}} ^ {- 1} [ 2 c _ {P}, \infty) \cap q _ {h _ {m}} ^ {- 1} [ 2 c _ {Q}, \infty)\right) - Q _ {m} (\operatorname {s u p p} (P) \cap \operatorname {s u p p} (Q)) \\ \geq - \left(Q _ {m} \left(\operatorname {s u p p} (P) \backslash p _ {h _ {n}} ^ {- 1} [ 2 c _ {P}, \infty)\right) + Q _ {m} \left(\operatorname {s u p p} (Q) \backslash q _ {h _ {m}} ^ {- 1} [ 2 c _ {Q}, \infty)\right)\right). \tag {17} \\ \end{array}
$$
And from the second inequality of (16), combining with Claim E.5 gives