SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Heap-indexing the points in  $\Pi$  and a strict heap invariant: As we saw in Section 2.1, each point in  $\Pi$  can be uniquely identified by their time index  $N$ , i.e. if we time-order the points of  $\Pi$ ,  $N$  represents the  $N$ th arrival in the ordered list. However, we can also uniquely index each point in  $\Pi$  using a splitting function-induced BSP-tree as follows.
We extend each node in the BSP-tree with a point from  $\Pi$ , such that the extended tree satisfies a strict heap invariant: First, we extend the root node  $(\Omega, 1)$  by adjoining  $\Pi$ 's first arrival  $(T_1, X_1)$  and the first arrival index 1 to get  $(T_1, X_1, \Omega, 1, 1)$ . Then, for every other extended node  $(T, X, B, H, N)$  with parent node  $(T', X', B', \lfloor H/2 \rfloor, M)$  we require that  $(T, X)$  is the first arrival in the restricted process  $\Pi \cap ((T', \infty) \times B)$ . This restriction enforces that we always have that  $T' < T$  and, therefore,  $M < N$ . Furthermore, it is strict because there are no other points of  $\Pi$  in  $B$  between those two arrival times.
Notation for the tree structure: Let us denote the extended BSP tree  $\mathcal{T}$  on  $\Pi$  induced by split. Each node  $\nu \in \mathcal{T}$  is a 5-tuple  $\nu = (T,X,B,H,N)$  consisting of the arrival time  $T$ , spatial coordinate  $X$ , its bounds  $B$ , split-induced heap index  $H$  and time index  $N$ . As a slight overload of notation, for a node  $\nu$ , we use it as subscript to refer to its elements, e.g.  $T_{\nu}$  is the arrival time associated with node  $\nu$ . We now prove the following important result, which ensures that we do not lose any information by using  $\mathcal{T}$  to represent  $\Pi$ . An essentially equivalent statement was first proven for Gumbel processes (Appendix, "Equivalence under partition" subsection; Maddison et al., 2014).
Lemma D.1. Let  $\Pi, P$ , split and  $\mathcal{T}$  be as defined above. Then,  $P$ -almost surely,  $\mathcal{T}$  contains every point of  $\Pi$ .
Proof. We give an inductive argument.
Base case: the first arrival of  $\Pi$  is by definition contained in the root node of  $\mathcal{T}$ .
Inductive hypothesis: assume that the first  $N$  arrivals of  $\Pi$  are all contained in  $\mathcal{T}$ .
Case for  $N + 1$ : We begin by observing that if the first  $N$  nodes are contained in  $\mathcal{T}$ , they must form a connected subtree  $\mathcal{T}_N$ . To see this, assume the contrary, i.e. that the first  $N$  arrivals form a subgraph  $\Gamma_N \subseteq \mathcal{T}$  with multiple disconnected components. Let  $\nu \in \Gamma_N$  be a node contained in a component
of  $\Gamma_N$  that is disconnected from the component of  $\Gamma_N$  containing the root node. Since  $\mathcal{T}$  is a tree, there is a unique path  $\pi$  from the root node to  $\nu$  in  $\mathcal{T}$ , and since  $\nu$  and the root are disconnected in  $\Gamma_N$ ,  $\pi$  must contain a node  $c \notin \Gamma_N$ . However, since  $c$  is an ancestor of  $\nu$ , by the heap invariant of  $\mathcal{T}$  we must have that the time index of  $c$  is  $N_c < N_\nu \leq N$  hence  $c \in \Gamma_N$ , a contradiction.
Thus, let  $\mathcal{T}_N$  represent the subtree of  $\mathcal{T}$  containing the first  $N$  arrivals of II. Now, let  $\mathcal{F}_N$  represent the frontier of  $\mathcal{T}_N$ , i.e. the leaf nodes' children:
$$
\mathcal {F} _ {N} \stackrel {\text {d e f}} {=} \left\{\nu \in \mathcal {T} \mid \nu \notin \mathcal {T} _ {N}, \operatorname {p a r e n t} (\nu) \in \mathcal {T} _ {N} \right\}, \tag {169}
$$
where parent retrieves the parent of a node in  $\mathcal{T}$ . Let
$$
\bar {\Omega} _ {N} \stackrel {\text {d e f}} {=} \bigcup_ {\nu \in \mathcal {F} _ {N}} B _ {\nu} \tag {170}
$$
be the union of all the bounds of the nodes in the frontier. A simple inductive argument shows that for all  $N$  the nodes in  $\mathcal{F}_N$  provide a  $P$ -essential partition of  $\Omega$ , from which  $P(\bar{\Omega}_N) = 1$ . Let  $T_N$  be the  $N$ th arrival time of  $\Pi$ . Now, by definition, the arrival time associated with every node in the frontier  $\mathcal{F}_N$  must be later than  $T_N$ . Finally, consider the first arrival time across the nodes in the frontier:
$$
T _ {N} ^ {*} \stackrel {\text {d e f}} {=} \min  _ {\nu \in \mathcal {F} _ {N}} T _ {\nu}. \tag {171}
$$
Then, conditioned on  $\mathcal{T}_N$ ,  $T_N^*$  is the first arrival of  $\Pi$  restricted to  $(T_N,\infty)\times \bar{\Omega}$ , thus it is  $P$ -almost surely the  $N + 1$ st arrival in  $\Pi$ , as desired.
A connection between the time index an heap index of a node: Now that we have two ways of uniquely identifying each point in  $\Pi$  it is natural to ask whether there is any relation between them. In the next paragraph we adapt an argument from Flamich et al. (2022) to show that under certain circumstances, the answer is yes.
First, we need to define two concepts, the depth of a node in an extended BSP-tree and a contractive splitting function. Thus, let  $\mathcal{T}$  be an extended BSP-tree over  $\Pi$  induced by split. Let  $\nu \in \mathcal{T}$ . Then, the depth  $D$  of  $\nu$  in  $\mathcal{T}$  is defined as the distance from  $\nu$  to the root. A simple argument shows that the heap index  $H_{\nu}$  of every node  $\nu$  at depth  $D$  in  $\mathcal{T}$  is between  $2^{D} \leq H_{\nu} < 2^{D + 1}$ . Thus, we can easily obtain the depth of a node  $\nu$  from the heap index via the formula  $D_{\nu} = \lfloor \log_2 H_{\nu} \rfloor$ . Next, we say that split is contractive if all the bounds it produces shrink on average. More formally, let  $\epsilon < 1$ , and for a node  $\nu \in \mathcal{T}$ , let  $\mathcal{A}_{\nu}$  denote the set of ancestor nodes of  $\nu$ . Then, split is contractive if for every non-root node  $\nu \in \mathcal{T}$  we have
$$
\mathbb {E} _ {\mathcal {T} _ {A _ {\nu}} \mid D _ {\nu}} [ P (B _ {\nu}) ] \leq \epsilon^ {D _ {\nu}}, \tag {172}
$$
where  $\mathcal{T}_{A_{\nu}}$  and denotes the subtree of  $\mathcal{T}$  containing the arrivals of the ancestors of  $\nu$ .
Note that  $\epsilon \geq 1/2$  for any split function. This is because if  $\{L, R\} = \mathrm{split}(B)$  for some set  $B$ , then  $P(R) = P(B) - P(L)$ . Thus, if  $P(R) = \alpha P(B)$ , then  $P(L) = (1 - \alpha)P(B)$ , and by definition  $\epsilon = \max \{\alpha, 1 - \alpha\}$ , which is minimized when  $\alpha = 1/2$ , from which  $\epsilon = 1/2$ .
For example, split<sub>dyad</sub> is contractive with  $\epsilon = 1/2$ , while split<sub>trivial</sub> is not contractive. By Lemma 1 from Flamich et al. (2022), split<sub>on-samp</sub> is also contractive with  $\epsilon = 3/4$ . We now strengthen this result using a simple argument, and show that split<sub>on-samp</sub> is contractive with  $\epsilon = 1/2$ .
Lemma D.2. Let  $\nu, D$  be defined as above, let  $P$  be a non-atomic probability measure over  $\mathbb{R}$  with CDF  $F_{P}$ . Let  $\Pi$  a  $(1, P)$ -Poisson process and  $\mathcal{T}$  be the BSP-tree over  $\Pi$  induced by split $_{on-samp}$ . Then,
$$
\mathbb {E} _ {\mathcal {T} _ {A _ {\nu}} \mid D _ {\nu}} [ P (B _ {\nu}) ] = 2 ^ {- D _ {\nu}}. \tag {173}
$$
Proof. Fix  $D_{\nu} = d$ , and let  $\mathcal{N}_d = \{n \in \mathcal{T} \mid D_n = d\}$  be the set of nodes in  $\mathcal{T}$  whose depth is  $d$ . Note, that  $|\mathcal{N}_d| = 2^d$ . We will show that
$$
\forall n, m \in \mathcal {N} _ {d}: \quad P \left(B _ {n}\right) \stackrel {\mathrm {d}} {=} P \left(B _ {m}\right), \tag {174}
$$
i.e. that the distributions of the bound sizes are all the same. From this, we will immediately have  $\mathbb{E}[P(B_n)] = \mathbb{E}[P(B_\nu)]$  for every  $n\in \mathcal{N}_d$ . Then, using the fact, that the nodes in  $\mathcal{N}_d$  for a  $P$ -almost partition of  $\Omega$ , we get:
$$
1 = \mathbb {E} \left[ P \left(\bigcup_ {n \in \mathcal {N} _ {d}} B _ {n}\right) \right] = \mathbb {E} \left[ \sum_ {n \in \mathcal {N} _ {d}} P \left(B _ {n}\right) \right] = \sum_ {n \in \mathcal {N} _ {d}} \mathbb {E} [ P (B _ {n}) ] = | \mathcal {N} _ {d} | \cdot \mathbb {E} [ P (B _ {\nu}) ]. \tag {175}
$$
Dividing the very left and very right by  $|\mathcal{N}_d| = 2^d$  yields the desired result.
To complete the proof, we now show that by symmetry, Equation (174) holds. We begin by exposing the fundamental symmetry of  $\mathsf{split}_{\mathrm{on - samp}}$ : for a node  $\nu$  with left child  $L$  and right child  $R$ , the left and right bound sizes are equal in distribution:
$$
P \left(B _ {L}\right) \stackrel {\mathrm {d}} {=} P \left(B _ {r}\right) \mid P \left(B _ {\nu}\right). \tag {176}
$$
First, note that by definition, all involved bounds will be intervals. Namely, assume that  $B_{\nu} = (a,b)$  for some  $a < b$  and  $X_{\nu}$  is the sample associated with  $\nu$ . Then,  $B_{L} = (a,X_{\nu})$  and  $B_{R} = (X_{\nu},b)$  and hence  $P(B_L) = F_P(X_\nu) - F_P(a)$ . Since  $X_{\nu}\sim P|_{B_{\nu}}$ , by the probability integral transform, we have  $F(X_{\nu})\sim \mathrm{Unif}(F_P(a),F_P(b))$ , from which  $P(B_L)\sim \mathrm{Unif}(0,F_P(b) - F_P(a)) = \mathrm{Unif}(0,P(B_\nu))$ . Since  $P(B_R) = P(B_\nu) - P(B_L)$ , we similarly have  $P(B_R)\sim \mathrm{Unif}(0,P(B_\nu))$ , which establishes our claim.
Now, to show Equation (174), fix  $d$  and fix  $n \in \mathcal{N}_d$ . Let  $\mathcal{A}_n$  denote the ancestor nodes of  $n$ . As we saw in the paragraph above,
$$
P \left(B _ {n}\right) \mid P \left(B _ {\text {p a r e n t} (n)}\right) \stackrel {{\mathrm {d}}} {{=}} P \left(B _ {\text {p a r e n t} (n)}\right) \cdot U, \quad U \sim \operatorname {U n i f} (0, 1), \tag {177}
$$
regardless of whether  $n$  is a left or a right child of its parent. We can apply this  $d$  times to the ancestors of  $n$  find the marginal:
$$
P \left(B _ {n}\right) \stackrel {\mathrm {d}} {=} \prod_ {i = 1} ^ {d} U _ {i}, \quad U _ {i} \sim \operatorname {U n i f} (0, 1). \tag {178}
$$
Since the choice of  $n$  was arbitrary, all nodes in  $\mathcal{N}_d$  have this distribution, which is what we wanted to show.
Now, we have the following result.
Lemma D.3. Let split be a contractive splitting function for some  $\epsilon \in [1/2, 1)$ . Then, for every node  $\nu$  in  $\mathcal{T}$  with time index  $N_{\nu}$  and depth  $D_{\nu}$ , we have
$$
\mathbb {E} _ {D _ {\nu} \mid N _ {\nu}} \left[ D _ {\nu} \right] \leq - \log_ {\epsilon} N _ {\nu}. \tag {179}
$$
Proof. Let us examine the case  $N_{\nu} = 1$  first. In this case,  $\nu$  is the root of  $\mathcal{T}$  and has depth  $D_{\nu} = 0$  by definition. Thus,  $0 \leq -\log_{\epsilon} 1$  holds trivially.
Now, fix  $\nu \in \mathcal{T}$  with time index  $N_{\nu} = N > 1$ . Let  $\mathcal{T}_{N - 1}$  be the subtree of  $\mathcal{T}$  containing the first  $N - 1$  arrivals,  $\mathcal{F}_{N - 1}$  be the frontier of  $\mathcal{T}_{N - 1}$  and  $T_{N - 1}$  the  $(N - 1)\mathrm{st}$  arrival time. Then, as we saw in Lemma D.1, the  $N$ th arrival in  $\Pi$  occurs in one of the nodes in the frontier  $\mathcal{F}_{N - 1}$ , after  $T_{N - 1}$ . In particular, conditioned on  $\mathcal{T}_{N - 1}$ , the arrival times associated with each node  $f \in \mathcal{F}_{N - 1}$  will be shifted exponentials  $T_f = T_{N - 1} + \mathrm{Exp}(P(B_f))$ , and the  $N$ th arrival time in  $\Pi$  is the minimum of these:  $T_{\nu} = T_N = \min_{f \in \mathcal{F}_{N - 1}} T_f$ . It is a standard fact (see e.g. Lemma 6 in Maddison (2016)) that the index of the minimum
$$
F _ {N} = \underset {f \in \mathcal {F} _ {N - 1}} {\arg \min } T _ {f} \tag {180}
$$
is independent of  $T_{\nu} = T_{F_N}$  and  $\mathbb{P}[F_N = f \mid \mathcal{T}_{N - 1}] = P(B_f)$ . A simple inductive argument shows that the number of nodes on the frontier  $|\mathcal{F}_{N - 1}| = N$ . Thus, we have a simple upper bound on the entropy of  $F$ :
$$
\mathbb {E} _ {F _ {N} \mid \mathcal {T} _ {N - 1}, N _ {\nu} = N} \left[ - \log_ {2} P \left(B _ {\nu}\right) \right] = \mathbb {H} \left[ F _ {N} \mid \mathcal {T} _ {N - 1}, N _ {\nu} = N \right] \leq \log_ {2} N. \tag {181}
$$
Thus, taking expectation over  $\mathcal{T}_{N - 1}$ , we find
$$
\begin{array}{l} \log_ {2} N \stackrel {\text {e q . (1 8 1)}} {\geq} \mathbb {E} _ {F _ {N}, \mathcal {T} _ {N - 1} | N _ {\nu} = N} \left[ - \log_ {2} P \left(B _ {\nu}\right) \right] (182) \\ = \mathbb {E} _ {D _ {\nu} | N _ {\nu} = N} \left[ \mathbb {E} _ {F _ {N}, \mathcal {T} _ {N - 1} | D _ {\nu}, N _ {\nu} = N} \left[ - \log_ {2} P \left(B _ {\nu}\right) \right] \right] (183) \\ \geq \mathbb {E} _ {D _ {\nu} | N _ {\nu} = N} \left[ - \log_ {2} \mathbb {E} _ {F _ {N}, \mathcal {T} _ {N - 1} | D _ {\nu}, N _ {\nu} = N} \left[ P \left(B _ {\nu}\right) \right] \right] (184) \\ \geq \mathbb {E} _ {D _ {\nu} | N _ {\nu} = N} \left[ - \log_ {2} \epsilon^ {D _ {\nu}} \right] (185) \\ = \left(- \log_ {2} \epsilon\right) \cdot \mathbb {E} _ {D _ {\nu} | N _ {\nu} = N} \left[ D _ {\nu} \right]. (186) \\ \end{array}
$$
The second inequality holds by Jensen's inequality. In the third inequality, we apply Equation (172), and one might worry about conditioning on  $N_{\nu}$  here. However, this is not an issue because
$$
\begin{array}{l} \mathbb {E} _ {F _ {N}, \mathcal {T} _ {N - 1} \mid D _ {\nu} = d, N _ {\nu} = N} [ P (B _ {\nu}) ] (187) \\ = \mathbf {1} [ d \leq N - 1 ] \cdot \sum_ {f \in \mathcal {F} _ {N - 1}} \mathbb {E} _ {\mathcal {T} _ {A _ {f}} | F _ {N} = f, D _ {\nu} = d} [ P (B _ {f}) ] \cdot \mathbb {P} [ F _ {N} = f \mid D _ {f} = d ] (188) \\ \leq \mathbf {1} [ d \leq N - 1 ] \cdot \sum_ {f \in \mathcal {F} _ {N - 1}} \epsilon^ {d} \cdot \mathbb {P} [ F _ {N} = f \mid D _ {f} = d ] (189) \\ = \mathbf {1} [ d \leq N - 1 ] \cdot \epsilon^ {d}. (190) \\ \end{array}
$$
Thus, we finally get
$$
\left(- \log_ {2} \epsilon\right) \cdot \mathbb {E} _ {D _ {\nu} | N _ {\nu} = N} \left[ D _ {\nu} \right] \leq \log_ {2} N \quad \Rightarrow \quad \mathbb {E} _ {D _ {\nu} | N _ {\nu}} \left[ D _ {\nu} \right] \leq - \log_ {\epsilon} N _ {\nu} \tag {191}
$$
by dividing both sides by  $-\log_2\epsilon$  and we obtain the desired result.
Converting between different heap indices: Assume now that we have two splitting functions, split_target and split_sim, which induce their own BSP-ordering on  $\Pi$ ,  $T_{\mathrm{target}}$  and  $T_{\mathrm{sim}}$ . Now, given a split_target-induced heap index  $H$ , Algorithm 7 presents a method for simulating the appropriate node  $\nu \in T_{\mathrm{target}}$  by simulating nodes from  $T_{\mathrm{sim}}$ . In other words, given a node with some heap index induced by a splitting function, Algorithm 7 lets us find the heap index of the same arrival induced by a different splitting function. The significance of Algorithm 7 is that it lets us develop convenient search methods using a given splitting function, but it might be more efficient to encode the heap index induced by another splitting function.
Theorem D.4. Let  $\Pi$ , split\_target\_, split\_sim\_,  $\mathcal{T}_{\text{target}}$  and  $\mathcal{T}_{\text{sim}}$  be as above. Let  $\nu \in \mathcal{T}_{\text{target}}$  with and let  $(T_{\text{sim}}, X_{\text{sim}}, H_{\text{sim}})$  be the arrival and its heap index output by Algorithm 7 given the above as input as well as  $H_{\nu}$  as the target index. Then, Algorithm 7 is correct, in the sense that
$$
T _ {\nu} \stackrel {d} {=} T _ {s i m} \quad a n d \quad X _ {\nu} \stackrel {d} {=} X _ {s i m}, \tag {192}
$$
and  $H_{sim}$  is the heap index of  $(T_{sim},X_{sim})$  in  $\mathcal{T}_{sim}$ .
Proof. First, observe that when  $\text{split}_{\text{target}} = \text{split}_{\text{sim}}$ , Algorithm 7 collapses onto just the extended BSP tree construction for  $\Pi$  and simply returns the arrival with the given heap index  $H_{\text{target}}$  in  $\mathcal{T}_{\text{target}}$ . In particular, the inner loop will always exit after one iteration, and every time one and only one of the conditional blocks will be executed. In other words, in this case, the algorithm becomes equivalent to Algorithm 2 in Flamich et al. (2022).
Let us now consider the case when split  $\mathrm{target} \neq \mathrm{split}_{\mathrm{sim}}$ . Denote the depth of the required node by  $D_{\nu} = \lfloor \log_2 H_{\nu} \rfloor$ . Now, we give an inductive argument for correctness.
Base case: Consider  $D_{\nu} = 0$ . In this case, the target bounds  $B = \Omega$ , and the first sample we draw  $X \sim P$  is guaranteed to fall in  $\Omega$ . Hence, for  $D_{\nu} = 0$  the outer loop only runs for one iteration. Furthermore, during that iteration, the inner loop will also exit after one iteration, and Algorithm 7 returns the sample  $(T, X)$  sampled before the outer loop with heap index 1. Since  $T \sim \mathrm{Exp}(1)$  and  $X \sim P$ , this will be a correctly distributed output with the appropriate heap index.
Inductive hypothesis: Assume Algorithm 7 is correct heap indices with depths up to  $D_{\nu} = d$ .
Case  $D_{\nu} = d + 1$ : Let  $\rho \in \mathcal{T}_{\mathrm{target}}$  be the parent node of  $\nu$  with arrival  $(T_{\rho}, X_{\rho})$ . Then,  $D_{\rho} = d$ , hence by the inductive hypothesis, Algorithm 7 will correctly simulate a branch  $\mathcal{T}_{\mathrm{target}}$  up to node  $\rho$ . At the end of the  $d$ th iteration of the outer loop Algorithm 7 sets the target bounds  $B \gets B_{\nu}$ . Then, in the final,  $d + 1$ st iteration, the inner loop simply realizes  $\mathcal{T}_{\mathrm{sim}}$  and accepts the first sample after  $X$  that falls inside  $B_{\nu}$  whose time index  $T > T_{\rho}$ . Due to the priority queue, the loop simulates the nodes of  $\mathcal{T}_{\mathrm{sim}}$  in time order; hence the accepted sample will also be the one with the earliest arrival time. Furthermore, Algorithm 7 only ever considers nodes of  $\mathcal{T}_{\mathrm{sim}}$  whose bounds intersect the target bounds  $B_{\nu}$ , hence the inner loop is guaranteed to terminate, which finishes the proof.
E GPRS with Binary Search
We now utilise the machinery we developed in Appendix D to analyze Algorithm 5.
**Correceptes of Algorithm 5:** Observe that Algorithm 5 constructs the extended BSP tree for the on-sample splitting function. Thus, we will now focus on performing a binary tree search using the extended BSP tree induced by the on-sample splitting function, which we denote by  $\mathcal{T}$ . The first step of the algorithm matches GPRS's first step (Algorithm 3). Hence it is correct for the first step. Now consider the algorithm in an arbitrary step  $k$  before termination, where the candidate sample  $(T,X)$  is rejected, i.e.  $T > \varphi(X)$ . By assumption, the density ratio  $r$  is unimodal, and since  $\sigma$  is monotonically increasing,  $\varphi = \sigma \circ r$  is unimodal too. Thus, let  $x^{*} \in \Omega$  be such that  $r(x^{*}) = r^{*}$ , where  $r^{*} = \exp_{2}(D_{\infty}[Q \| P])$ . Assume for now that  $X < x^{*}$ , the case  $X > x^{*}$  follows by a symmetric argument. By the unimodality assumption, since  $X < x^{*}$ , it must hold that for all  $y < X$ , we have  $\varphi(y) < \varphi(X)$ . Consider now the arrival  $(T_{L},X_{L})$  of  $\Pi$  in the current node's left child. Then, we will have  $T < T_{L}$  and  $X_{L} < X$  by construction. Thus, finally, we get
$$
\varphi \left(X _ {L}\right) <   \varphi (X) <   T <   T _ {L}, \tag {193}
$$
meaning that the current node's left child is also guaranteed to be rejected. This argument can be easily extended to show that any left-descendant of the current node will be rejected, and it is sufficient to search its right-descendants only. By a similar argument, when  $X > x^{*}$ , we find that it is sufficient only to check the current node's left-descendants. Finally, since both Algorithms 3 and 5 simulate II and search for its first arrival under  $\varphi$ , by the construction in Appendix A, the sample returned by both algorithms will follow the desired target distribution.
Analyzing the expected runtime and codelength: Since Algorithm 5 simulates a single branch of  $\mathcal{T}_{\mathrm{on - sample}}$ , its runtime is equal to the depth  $D$  of the branch. Furthermore, let  $N$  denote the time index of the accepted arrival and  $H$  its heap index in  $\mathcal{T}_{\mathrm{on - sample}}$ , which means  $D = \lfloor \log_2 H \rfloor$ . It is tempting to use lemmas D.2 and D.3 to in our analysis of  $N$ ,  $H$  and  $D$ . However, they do not apply, because they assume no restriction on  $D$  and  $N$ , while in this section, we condition on the fact that  $N$ ,  $H$  and  $D$  identify the arrival in  $\Pi$  that was accepted by Algorithm 5. Hence, we first prove a lemma analogous to lemma D.2 in this restricted case, based on Lemma 4 of Flamich et al. (2022). Note the additional assumptions we need for our result.
Lemma E.1. Let  $Q$  and  $P$  be distributions over  $\mathbb{R}$  with unimodal density ratio  $r = dQ / dP$ , given to Algorithm 5 as the target and proposal distribution as input, respectively. Assume  $P$  has CDF  $F_{P}$ . Let  $H$  denote the accepted sample's heap index, let  $D = \lfloor \log_2 H \rfloor$ , and let  $B_{H}$  denote the bounds associated with the accepted node. Then,
$$
\mathbb {E} \left[ P \left(B _ {H}\right) \mid H \right] \leq \left(\frac {3}{4}\right) ^ {D}. \tag {194}
$$
Proof. We prove the claim by induction. For  $H = 1$ ,  $D = 0$  the claim holds trivially, since  $B_{1} = \mathbb{R}$ , hence  $P(B_{1}) = 1$ . Assume now that the claim holds for  $D = \lfloor \log_2H\rfloor = d - 1$  for  $d\geq 1$ , and we prove the statement when  $D = \lfloor \log_2H\rfloor = d$ . Let  $X_0,\ldots ,X_{d - 1},X_d$  denote the samples simulated along the branch that leads to the accepted node, i.e.  $X_0$  is the sample associated with the root node and  $X_{d}$  is the accepted sample. By the definition of the on-sample splitting function and law of iterated expectations, we have
$$
\mathbb {E} _ {X _ {0: d - 1}} [ P (B _ {H}) \mid H ] = \left\{ \begin{array}{l l} \mathbb {E} _ {X _ {0}} [ P (B _ {H}) \mid H ] & \text {w h e n} d = 1 \\ \mathbb {E} _ {X _ {0: d - 2}} [ \mathbb {E} _ {X _ {d - 1} \mid X _ {0: d - 2}} [ P (B _ {H}) \mid H ] \mid H ] & \text {w h e n} d \geq 2. \end{array} \right. \tag {195}
$$
Below, we only examine the inner expectation in the  $d \geq 2$  case; computing the expectation in the  $d = 1$  case follows mutatis mutandis. First, denote the bounds of the accepted node's parent as  $B_{\lfloor H / 2\rfloor} = (\alpha ,\beta)$  for some real numbers  $\alpha < \beta$  and define  $a = F_P(\alpha), b = F_P(\beta)$  and  $U = F_{P}(X_{d - 1})$ . Since  $X_{d - 1} \mid X_{1:d - 2} \sim P|_{B_{\lfloor H / 2\rfloor}}$ , by the generalized probability integral transform we have  $U \sim \mathrm{Unif}(a,b)$ , where  $\mathrm{Unif}(a,b)$  denotes the uniform distribution on the interval  $(a,b)$ . The two possible intervals from which Algorithm 5 will choose are  $(\alpha, X_{d - 1})$  and  $(X_{d - 1},\beta)$ , whose measures are  $P((\alpha, X_{d - 1})) = F_P(X_{d - 1}) - F_P(\alpha) = U - a$  and similarly  $P((X_{d - 1},\beta)) = b - U$ . Then, in the worst case, the algorithm always picks the bigger of the two intervals, thus  $P(B_H) \leq \max \{U - A, B - U\}$ , from which we obtain the bound
$$
\mathbb {E} _ {X _ {d - 1} \mid X _ {1: d - 2}} [ P (B _ {H}) \mid H ] \leq \mathbb {E} _ {U} \left[ \max  \{U - a, b - U \} \right] = \frac {3}{4} (b - a) = \frac {3}{4} P \left(B _ {\lfloor H / 2 \rfloor}\right). \tag {196}
$$
Plugging this into Equation (195), we get
$$
\begin{array}{l} \mathbb {E} _ {X _ {1: d - 1}} \left[ P \left(B _ {H}\right) \mid H \right] \leq \frac {3}{4} \mathbb {E} _ {X _ {1: d - 2}} \left[ P \left(B _ {\lfloor H / 2 \rfloor}\right) \mid H \right] (197) \\ \leq \frac {3}{4} \cdot \left(\frac {3}{4}\right) ^ {d - 1}, (198) \\ \end{array}
$$
where the second inequality follows from the inductive hypothesis, which finishes the proof.
Fortunately, lemma D.3 does not depend on this condition, so we can modify it mutatis mutandis so that it still applies in this latter case as well, and we restate it here for completeness:
Lemma E.2. Let  $N, D, H, B_H$  be defined as above. Then
$$
\mathbb {E} \left[ - \log P \left(B _ {H}\right) \right] \leq \log_ {2} N \tag {199}
$$
$$
\mathbb {E} _ {D \mid N} [ D ] \leq - \log_ {3 / 4} N. \tag {200}
$$