<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title/><link>https://sichen-wang.github.io/</link><atom:link href="https://sichen-wang.github.io/index.xml" rel="self" type="application/rss+xml"/><description/><generator>HugoBlox Kit (https://hugoblox.com)</generator><language>en-us</language><lastBuildDate>Mon, 24 Oct 2022 00:00:00 +0000</lastBuildDate><image><url>https://sichen-wang.github.io/media/icon_hu_9dfcb674aa885f38.png</url><title/><link>https://sichen-wang.github.io/</link></image><item><title>The Minimax Rate of Online Isotonic Regression on Product Orders</title><link>https://sichen-wang.github.io/publications/online-isotonic-regression/</link><pubDate>Sun, 27 Sep 2026 00:00:00 +0000</pubDate><guid>https://sichen-wang.github.io/publications/online-isotonic-regression/</guid><description>&lt;article class="ltx_document ltx_authors_1line"&gt;
&lt;section id="S1" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="introduction"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;1 &lt;/span&gt;Introduction&lt;/h2&gt;
&lt;div id="S1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;In online isotonic regression, a learner faces an adversary over a finite partially ordered domain: at each of $T$ rounds the learner observes a query point, predicts $\hat{y}_{t}\in[0,1]\text{,}$ and incurs the squared loss $(\hat{y}_{t}-y_{t})^{2}$ once the label $y_{t}\in[0,1]$ is revealed; its regret is the cumulative loss minus that of the best isotonic function in hindsight, nondecreasing along the partial order. On the chain, the totally ordered case, &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Kotłowski&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt; (&lt;a href="#bib.bib2" title="Online isotonic regression" class="ltx_ref"&gt;2016&lt;/a&gt;)&lt;/cite&gt; determined the minimax regret up to logarithmic factors; beyond it, &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Kotłowski&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt; (&lt;a href="#bib.bib3" title="Random permutation online isotonic regression" class="ltx_ref"&gt;2017&lt;/a&gt;)&lt;/cite&gt; posed the design of efficient algorithms as a central open problem, and no $\Theta$-level resolution has appeared since. This paper settles the problem on the product orders $[m]^{d}=\{1,\ldots,m\}^{d}\text{,}$ for every fixed dimension $d\geq 2\text{:}$ the minimax regret is characterized at the $\Theta$ level, the characterization is matched in polynomial time, and both statements hold across a family of losses whose boundary we locate. Queries may recur, relaxing the earlier protocols in which each point arrives once &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Kotłowski&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt;, &lt;a href="#bib.bib2" title="Online isotonic regression" class="ltx_ref"&gt;2016&lt;/a&gt;, &lt;a href="#bib.bib3" title="Random permutation online isotonic regression" class="ltx_ref"&gt;2017&lt;/a&gt;)&lt;/cite&gt;, a choice natural for streaming (&lt;a href="#S2.SS1" title="2.1 Setup ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;); &lt;a href="#S6" title="6 Discussion ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt; compares the protocols.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S1.SS0.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Applications.&lt;/h5&gt;
&lt;div id="S1.SS0.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Two scenarios motivate the multivariate setting. Two-feature probability calibration is the multivariate form of classical isotonic calibration &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Zadrozny and Elkan, &lt;a href="#bib.bib17" title="Transforming classifier scores into accurate multiclass probability estimates" class="ltx_ref"&gt;2002&lt;/a&gt;; Niculescu-Mizil and Caruana, &lt;a href="#bib.bib18" title="Predicting good probabilities with supervised learning" class="ltx_ref"&gt;2005&lt;/a&gt;; Berta&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt;, &lt;a href="#bib.bib19" title="Classifier calibration with ROC-regularized isotonic regression" class="ltx_ref"&gt;2024&lt;/a&gt;)&lt;/cite&gt;: the calibrated probability of a deployed classifier is jointly nondecreasing in the model score and in an ordinal covariate. Its natural loss, the entropic (log) loss, is part of the characterization. On UCI Adult, learning on the score-by-covariate grid beats both calibration along the score alone and an unstructured per-cell mean on 20 of 20 splits (&lt;a href="#A1" title="Appendix A Experiments ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;A&lt;/span&gt;&lt;/a&gt;). In combination dose-finding, the toxicity probability of a two-agent therapy is monotone in each dose, and the surface is learned along the treatment trajectory &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Conaway&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt;, &lt;a href="#bib.bib20" title="Designs for single- or multiple-agent phase I trials" class="ltx_ref"&gt;2004&lt;/a&gt;; Wages&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt;, &lt;a href="#bib.bib21" title="Continual reassessment method for partial ordering" class="ltx_ref"&gt;2011&lt;/a&gt;)&lt;/cite&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S1.SS0.SSS0.Px2" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Main results.&lt;/h5&gt;
&lt;div id="S1.SS0.SSS0.Px2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The minimax regret under squared loss is, for every fixed $d\geq 2$ and all integers $m\geq 2\text{,}$ $T\geq 1$ (&lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;),&lt;/p&gt;
&lt;table id="S1.Ex2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}\bigl([m]^{d}\bigr)\;=\;\Theta_{d}\!\left(\min\!\left\{T,\;\inf_{K\in\mathbb{N}_{+}}\!\Bigl[\,2\,H_{[m]^{d}}(K)\,+\,\frac{T}{4K^{2}}\,\Bigr]\right\}\right),\quad H_{\mathcal{P}}(K)\;:=\;\log\Omega(\mathcal{P},K{+}1),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where, for a finite poset $\mathcal{P}\text{,}$ $\Omega(\mathcal{P},N)$ counts the order-preserving maps into $\{1,\ldots,N\}\text{,}$ the order polynomial of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Stanley (&lt;a href="#bib.bib6" title="A chromatic-like polynomial for ordered sets" class="ltx_ref"&gt;1970&lt;/a&gt;)&lt;/cite&gt;. The formula balances the two costs of learning on the value grid $\{0,1/K,\ldots,1\}\text{:}$ $H_{[m]^{d}}(K)$ is, up to a factor of two in the resolution, the sup-norm metric entropy of the comparator class, and $T/(4K^{2})$ is the cost of rounding the hindsight optimum onto the grid once its first-order term is canceled (&lt;a href="#S2" title="2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;). It unfolds into a three-phase law (&lt;a href="#Thmtheorem3" title="Corollary 3 (Three-Phase Scaling Law). ‣ 3.3 The Three Phases and the Phase Criterion ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;): $\Theta_{d}(T)$ for $T\lesssim_{d}m^{d-1}$ (Phase 0); $\Theta_{d}(m^{2(d-1)/3}\,T^{1/3})$ for $m^{d-1}\lesssim_{d}T\lesssim_{d}m^{d+2}$ (Phase 1); and $\Theta_{d}(m^{d}[1+\log(T/m^{d+2})])$ beyond (Phase 2), where the grid has decoupled into $m^{d}$ scalar estimation problems. The upper bound in the display holds on every finite poset and, with loss-dependent constants, for every smooth exp-concave loss (&lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;); the grids are where we match it. Rectangles $[a]\times[b]$ add a fourth sector that the substitution $m\mapsto\sqrt{ab}$ misses, and the characterization persists at every fixed aspect ratio (&lt;a href="#Thmtheorem66" title="Proposition 66 (Rectangles). ‣ K.5 Rectangles ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;66&lt;/span&gt;&lt;/a&gt;). The intermediate phase carries no logarithmic factor; on the chain it does (&lt;a href="#Thmtheorem46" title="Theorem 46 (Chain Complete Minimax). ‣ Order polynomial of the chain. ‣ I.1 Setup and Main Theorem ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;46&lt;/span&gt;&lt;/a&gt;), and &lt;a href="#S2.SS2" title="2.2 The Order Polynomial Is the Metric Entropy ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt; traces the difference to the entropy at coarse scales.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS0.SSS0.Px2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The law is stable in the loss: every smooth, exp-concave, strongly proper, bounded loss obeys the same characterization, and so does the entropic loss of calibration, the loss entering only through the constants (&lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;). Absolute and pinball losses change the rate: they obey a square-root law in which resolution plays no part, $\Theta_{d}(\min\{T,\sqrt{m^{d-1}T}\})$ for the absolute loss (&lt;a href="#Thmtheorem56" title="Theorem 56 (Pinball and Absolute Losses on Grids). ‣ J.5 Lipschitz Losses ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;56&lt;/span&gt;&lt;/a&gt;). On the algorithmic side, two complementary planar engines (Column-Independent Chain EW and Surrogate Threshold-Indexed EW), a rate-doubling wrapper, and a slicing step combine into a horizon-free polynomial-time learner, rate-optimal for every loss of the &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; family and every fixed dimension (&lt;a href="#Thmtheorem7" title="Theorem 7 (Slicing). ‣ 5.4 Every Fixed Dimension, Every Loss ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S1.SS0.SSS0.Px3" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Technical contributions.&lt;/h5&gt;
&lt;div id="S1.SS0.SSS0.Px3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The characterization rests on a small set of mechanisms. For the upper bound, the isotonic fit is stationary on each of its level sets, so rounding onto a resolution-$K$ grid costs $T/K^{2}$ rather than $T/K\text{;}$ aggregation then prices learning at $H_{\mathcal{P}}(K)\text{,}$ and nothing beyond the poset structure is used (&lt;a href="#S2" title="2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;). The lower bounds come from two general-poset mechanisms (&lt;a href="#S3.SS1" title="3.1 Two Mechanisms ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt;): independent fair bits toggled across nested frontiers at large central rank levels, which decouple the game into two-point Bernoulli tests, and an independent continuous prior around a strictly isotonic core, which factorizes the posterior cell by cell and feeds the van Trees inequality. On the algorithmic side, for polynomial-time strip decompositions of the grid, every bound the standard exp-concave analysis yields carries a $(\log m)^{2/3}$ entropy overhead through the bulk of the intermediate phase (&lt;a href="#Thmtheorem44" title="Theorem 44 (Strip-Independent Transfer-Matrix Lower Bound). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;44&lt;/span&gt;&lt;/a&gt;). Decomposing by threshold layer removes it: exponential weights factorize across the layers of a discretized isotonic function once the nesting constraint is dropped, a surrogate loss dominates the true loss and is exact whenever the layers do nest, and each layer’s prediction is a single $O(m^{2})$ dynamic program (&lt;a href="#S5.SS2" title="5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.2&lt;/span&gt;&lt;/a&gt;). Two choices complete the algorithm: the wrapper doubles the regret budget rather than time, since geometric time epochs forfeit the logarithmic phase; and the slices are planes, the smallest that cost no entropy (&lt;a href="#S5.SS3" title="5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Sections&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.3&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S5.SS4" title="5.4 Every Fixed Dimension, Every Loss ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.4&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S1.SS0.SSS0.Px4" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Related work.&lt;/h5&gt;
&lt;div id="S1.SS0.SSS0.Px4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Kotłowski&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt; (&lt;a href="#bib.bib2" title="Online isotonic regression" class="ltx_ref"&gt;2016&lt;/a&gt;)&lt;/cite&gt; and &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Kotłowski&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt; (&lt;a href="#bib.bib3" title="Random permutation online isotonic regression" class="ltx_ref"&gt;2017&lt;/a&gt;)&lt;/cite&gt; are the direct predecessors, on the chain and its random-permutation model. Once an entropy estimate is supplied, the framework of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Rakhlin and Sridharan (&lt;a href="#bib.bib16" title="Online non-parametric regression" class="ltx_ref"&gt;2014&lt;/a&gt;)&lt;/cite&gt; gives the rate as an upper bound and the chaining algorithm of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Gaillard and Gerchinovitz (&lt;a href="#bib.bib23" title="A chaining algorithm for online nonparametric regression" class="ltx_ref"&gt;2015&lt;/a&gt;)&lt;/cite&gt; attains $O_{d}(m^{2(d-1)/3}\,T^{1/3})$ in Phase 1. What the generic route does not supply is the estimate itself, the matching lower bounds, and a polynomial-time implementation: the covers involved have cardinality $e^{\Theta_{d}(m^{d-1}K)}\text{,}$ and the surrogate engine never materializes one. The adaptive online algorithms of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Liautaud&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt; (&lt;a href="#bib.bib24" title="Minimax-optimal and locally-adaptive online nonparametric regression" class="ltx_ref"&gt;2025b&lt;/a&gt;, &lt;a href="#bib.bib25" title="Minimax adaptive online nonparametric regression over Besov spaces" class="ltx_ref"&gt;a&lt;/a&gt;)&lt;/cite&gt; operate above the continuity threshold $s&amp;gt;d/p$ of the Besov scale $B^{s}_{p,q}\text{,}$ while monotone surfaces may jump across a monotone curve. On the plane the comparison is exact through embeddings whose norms grow with the design: every fixed integer smoothness $s$ forces an ambient norm of order $m^{s}\text{,}$ so the guarantee a smoothness ball can transfer, $m^{2s/(s+1)}\,T^{1/(s+1)}$ up to logarithms, stays polynomially above the isotonic $m^{2/3}T^{1/3}$ throughout Phase 1 (&lt;a href="#A12" title="Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;L&lt;/span&gt;&lt;/a&gt;). Batch isotonic regression on grids &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Chatterjee&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt;, &lt;a href="#bib.bib4" title="On matrix estimation under monotonicity constraints" class="ltx_ref"&gt;2018&lt;/a&gt;)&lt;/cite&gt; studies $L_{2}$ estimation risk, a different quantity from online regret. Ignoring the order entirely, exp-concave aggregation over a fine value grid &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Vovk, &lt;a href="#bib.bib15" title="A game of prediction with expert advice" class="ltx_ref"&gt;1998&lt;/a&gt;; Cesa-Bianchi and Lugosi, &lt;a href="#bib.bib1" title="Prediction, learning, and games" class="ltx_ref"&gt;2006&lt;/a&gt;)&lt;/cite&gt; pays $O_{d}(m^{d}\log T)\text{,}$ matching the law only deep in its logarithmic phase. The combinatorial and Bayesian inputs are classical: MacMahon’s box formula &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(MacMahon, &lt;a href="#bib.bib7" title="Combinatory analysis" class="ltx_ref"&gt;1916&lt;/a&gt;)&lt;/cite&gt; behind the planar constants, and the van Trees inequality &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Gill and Levit, &lt;a href="#bib.bib8" title="Applications of the van Trees inequality: a Bayesian Cramér–Rao bound" class="ltx_ref"&gt;1995&lt;/a&gt;)&lt;/cite&gt; behind the deep-phase lower bound.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S2" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="the-complexity-formula-and-the-universal-upper-bound"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;2 &lt;/span&gt;The Complexity Formula and the Universal Upper Bound&lt;/h2&gt;
&lt;div id="S2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Our characterization is assembled from four components: a universal upper bound, proved here for every finite poset and for the loss class fixed below; two lower-bound mechanisms, developed in &lt;a href="#S3" title="3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;; and a merging step that collapses the resulting families of bounds into a single tight envelope (&lt;a href="#S3.SS2" title="3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.2&lt;/span&gt;&lt;/a&gt;, with explicit planar constants in &lt;a href="#A4" title="Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;D&lt;/span&gt;&lt;/a&gt;). This section also fixes what the complexity formula measures: the order polynomial is the metric entropy of the comparator class.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S2.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="setup"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;2.1 &lt;/span&gt;Setup&lt;/h3&gt;
&lt;div id="S2.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Let $(\mathcal{P},\preceq)$ be a finite poset with $n:=|\mathcal{P}|\text{.}$ Over $T$ rounds, the adversary chooses $(x_{t},y_{t})\in\mathcal{P}\times[0,1]\text{,}$ with repeated query points allowed, and reveals $x_{t}\text{;}$ the learner predicts $\hat{y}_{t}\in[0,1]\text{,}$ then observes $y_{t}$ and incurs $\ell(\hat{y}_{t},y_{t})\text{.}$ The comparator class consists of the isotonic functions&lt;/p&gt;
&lt;table id="S2.Ex3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{F}_{\mathcal{P}}^{\uparrow}\;:=\;\bigl\{f:\mathcal{P}\to[0,1]\;:\;u\preceq v\Rightarrow f(u)\leq f(v)\bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;the regret is $R_{T}:=\sum_{t=1}^{T}\ell(\hat{y}_{t},y_{t})-\min_{f\in\mathcal{F}_{\mathcal{P}}^{\uparrow}}\sum_{t=1}^{T}\ell(f(x_{t}),y_{t})\text{,}$ and the minimax regret $R_{T}^{*}(\mathcal{P},\ell):=\inf\sup\mathbb{E}[R_{T}]$ takes the infimum over (possibly randomized) learner strategies and the supremum over (oblivious or adaptive) adversary sequences &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Cesa-Bianchi and Lugosi, &lt;a href="#bib.bib1" title="Prediction, learning, and games" class="ltx_ref"&gt;2006&lt;/a&gt;)&lt;/cite&gt;. Every upper bound below holds pathwise, on each individual sequence, and is achieved by a deterministic learner; every lower bound is proved via Yao’s principle &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Yao, &lt;a href="#bib.bib5" title="Probabilistic computations: toward a unified measure of complexity" class="ltx_ref"&gt;1977&lt;/a&gt;)&lt;/cite&gt; against a randomized oblivious adversary and extends automatically to adaptive ones. When the loss is omitted it is the squared loss: $R_{T}^{*}(\mathcal{P}):=R_{T}^{*}(\mathcal{P},\ell_{\mathrm{sq}})$ with $\ell_{\mathrm{sq}}(p,y):=(p-y)^{2}\text{.}$ We reserve $m$ for the side length of the grid $[m]^{d}:=\{1,\ldots,m\}^{d}$ under the product order; $K\in\mathbb{N}_{+}$ denotes a discretization level with grid $G_{K}:=\{0,1/K,\ldots,1\}\text{;}$ logarithms are natural.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Throughout, a loss is a function $\ell:[0,1]^{2}\to[0,\infty]$ whose first argument is the prediction, with $\ell(\cdot,y)$ convex on $[0,1]$ for every $y\text{.}$ We call $\ell$ &lt;em class="ltx_emph ltx_font_italic"&gt;curved&lt;/em&gt; with parameters $(\eta,\beta,\alpha,\Lambda)$ if for every $y$ the map $p\mapsto e^{-\eta\ell(p,y)}$ is concave on $[0,1]$ ($\eta$-exp-concavity) and the derivative $\partial_{1}\ell(\cdot,y)$ in the prediction is $\beta$-Lipschitz ($\beta$-smoothness); if $0\leq\ell\leq\Lambda$ on $[0,1]^{2}\text{;}$ and if $\ell$ is &lt;em class="ltx_emph ltx_font_italic"&gt;$\alpha$-strongly proper on $[\tfrac{1}{4},\tfrac{3}{4}]$&lt;/em&gt;, meaning&lt;/p&gt;
&lt;table id="S2.E1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}_{Y\sim\mathrm{Ber}(p)}\bigl[\ell(q,Y)-\ell(p,Y)\bigr]\;\geq\;\alpha\,(p-q)^{2}\qquad\text{for all }p\in\bigl[\tfrac{1}{4},\tfrac{3}{4}\bigr],\ q\in[0,1],$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(1)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;the interior form of strong properness &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Agarwal, &lt;a href="#bib.bib22" title="Surrogate regret bounds for bipartite ranking via strongly proper losses" class="ltx_ref"&gt;2014&lt;/a&gt;)&lt;/cite&gt;. Exp-concavity and smoothness drive the upper bounds; strong properness and boundedness enter only the lower bounds. The squared loss is curved with $(\eta,\beta,\alpha,\Lambda)=(\tfrac{1}{2},2,1,1)$ and attains equality in (&lt;a href="#S2.E1" title="Equation 1 ‣ 2.1 Setup ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;). The entropic loss $\ell_{\log}(p,y):=-y\log p-(1-y)\log(1-p)\text{,}$ the natural loss for probability calibration, is not smooth; &lt;a href="#Thmtheorem55" title="Theorem 55 (Entropic Upper Bound). ‣ J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;55&lt;/span&gt;&lt;/a&gt; treats it separately.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S2.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-order-polynomial-is-the-metric-entropy"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;2.2 &lt;/span&gt;The Order Polynomial Is the Metric Entropy&lt;/h3&gt;
&lt;div id="S2.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $N\in\mathbb{N}_{+}\text{,}$ let $\Omega(\mathcal{P},N)$ denote the number of order-preserving maps $\mathcal{P}\to\{1,\ldots,N\}\text{,}$ the &lt;em class="ltx_emph ltx_font_italic"&gt;order polynomial&lt;/em&gt; of $\mathcal{P}$ &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Stanley, &lt;a href="#bib.bib6" title="A chromatic-like polynomial for ordered sets" class="ltx_ref"&gt;1970&lt;/a&gt;)&lt;/cite&gt;. Under the rescaling $k\mapsto(k-1)/K\text{,}$ the maps counted by $\Omega(\mathcal{P},K{+}1)$ are exactly the isotonic functions valued in $G_{K}\text{,}$ and we measure complexity on the logarithmic scale:&lt;/p&gt;
&lt;table id="S2.Ex4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H_{\mathcal{P}}(K)\;:=\;\log\Omega(\mathcal{P},K{+}1).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;On the chain, $\Omega([n],K{+}1)=\binom{n+K}{K}\text{,}$ the number of non-decreasing $G_{K}$-valued sequences of length $n\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The complexity measure is a familiar object in disguise. Write $N_{\infty}(\varepsilon,\mathcal{F}_{\mathcal{P}}^{\uparrow})$ for the smallest number of sup-norm $\varepsilon$-balls in $[0,1]^{\mathcal{P}}$ covering $\mathcal{F}_{\mathcal{P}}^{\uparrow}\text{;}$ up to a factor of two in the resolution, $H_{\mathcal{P}}$ is that metric entropy: $H_{\mathcal{P}}(K_{-})\leq\log N_{\infty}(\varepsilon,\mathcal{F}_{\mathcal{P}}^{\uparrow})\leq H_{\mathcal{P}}(K_{+})$ for $0&amp;lt;\varepsilon&amp;lt;\tfrac{1}{2}\text{,}$ at $K_{+}:=\lceil\tfrac{1}{2\varepsilon}\rceil$ and $K_{-}:=K_{+}-1$ (&lt;a href="#Thmtheorem68" title="Proposition 68 (Entropy Equivalence). ‣ L.1 The Entropy Sandwich ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;68&lt;/span&gt;&lt;/a&gt;). Monotone rounding onto $G_{K_{+}}$ moves every isotonic function by at most $\tfrac{1}{2K_{+}}\leq\varepsilon\text{,}$ giving the cover; two distinct $G_{K_{-}}$-valued isotonic functions are more than $2\varepsilon$ apart in sup norm, so no $\varepsilon$-ball contains two. &lt;a href="#A12" title="Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;L&lt;/span&gt;&lt;/a&gt; records the details, together with the position of this entropy law among the classical nonparametric scales.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;On grids the law has two regimes: for every fixed $d\geq 2\text{,}$ uniformly over $m\geq 2$ and $K\geq 1\text{,}$&lt;/p&gt;
&lt;table id="S2.Ex5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H_{[m]^{d}}(K)\;=\;\begin{cases}\Theta_{d}\bigl(m^{d-1}K\bigr),&amp;amp;1\leq K\leq m,\\[2.84526pt] \Theta_{d}\bigl(m^{d}\bigl[1+\log\tfrac{K}{m}\bigr]\bigr),&amp;amp;K\geq m\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;(&lt;a href="#Thmtheorem62" title="Lemma 62 (Grid Entropy). ‣ K.2 Grid Entropy ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;62&lt;/span&gt;&lt;/a&gt;, proved in &lt;a href="#A11" title="Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;K&lt;/span&gt;&lt;/a&gt;). In metric-entropy form, via &lt;a href="#Thmtheorem68" title="Proposition 68 (Entropy Equivalence). ‣ L.1 The Entropy Sandwich ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;68&lt;/span&gt;&lt;/a&gt;, this reads $\log N_{\infty}(\varepsilon,\mathcal{F}_{[m]^{d}}^{\uparrow})=\Theta_{d}(m^{d-1}/\varepsilon)$ for $1/m\lesssim\varepsilon&amp;lt;\tfrac{1}{2}$ and $\Theta_{d}(m^{d}[1+\log\tfrac{1}{m\varepsilon}])$ below that scale. At coarse scales the entropy is linear in $1/\varepsilon\text{,}$ with no logarithmic correction. The chain differs exactly there: $\log N_{\infty}(\varepsilon,\mathcal{F}_{[n]}^{\uparrow})=\Theta(\varepsilon^{-1}\log(en\varepsilon))$ for $\varepsilon\gtrsim 1/n\text{,}$ and this logarithm is the entropic source of the logarithmic factor that the chain’s rate carries at intermediate horizons (&lt;a href="#Thmtheorem46" title="Theorem 46 (Chain Complete Minimax). ‣ Order polynomial of the chain. ‣ I.1 Setup and Main Theorem ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;46&lt;/span&gt;&lt;/a&gt;) and that grids of every dimension avoid. The same law governs the sequential covering numbers of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Rakhlin and Sridharan (&lt;a href="#bib.bib16" title="Online non-parametric regression" class="ltx_ref"&gt;2014&lt;/a&gt;)&lt;/cite&gt;, which coincide with the metric ones for horizons of at least $|\mathcal{P}|$ (&lt;a href="#A12" title="Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;L&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S2.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="level-set-stationarity-and-the-upper-bound"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;2.3 &lt;/span&gt;Level-Set Stationarity and the Upper Bound&lt;/h3&gt;
&lt;div id="S2.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The upper bound has two costs: aggregating over the grid class, and rounding the hindsight optimum onto it. Aggregation is standard: running exponential weights over the $\Omega(\mathcal{P},K{+}1)$ grid-valued isotonic functions costs $\tfrac{1}{\eta}H_{\mathcal{P}}(K)$ for an $\eta$-exp-concave loss. Rounding is where the exponent is decided: it moves each comparator value by at most $\tfrac{1}{2K}\text{,}$ so a first-order estimate pays $O(T/K)\text{;}$ reaching $T/K^{2}$ requires the first-order term to cancel. The cancellation is a property of the isotonic fit itself, valid for every differentiable convex loss: on each of its level sets, the fitted value is stationary.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS3.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Let $f^{*}$ minimize the comparator loss $\sum_{t=1}^{T}\ell(f(x_{t}),y_{t})$ over $\mathcal{F}_{\mathcal{P}}^{\uparrow}\text{,}$ write $w_{u}:=|\{t:x_{t}=u\}|$ and $B_{c}:=\{u\in\mathcal{P}:w_{u}&amp;gt;0,\ f^{*}(u)=c\}$ for the queried part of a level set of $f^{*}\text{,}$ and set $w_{B_{c}}:=\sum_{u\in B_{c}}w_{u}\text{.}$ Then&lt;/p&gt;
&lt;table id="S2.Ex6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{t\,:\,x_{t}\in B_{c}}\partial_{1}\ell(c,y_{t})\;=\;0\qquad\text{for every }c\in(0,1),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;the one-sided sums being nonnegative at $c=0$ and nonpositive at $c=1$ (&lt;a href="#Thmtheorem50" title="Lemma 50 (Level-Set Stationarity). ‣ J.1 Level-Set Stationarity ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;50&lt;/span&gt;&lt;/a&gt;). The proof shifts the &lt;em class="ltx_emph ltx_font_italic"&gt;complete&lt;/em&gt; level set, unqueried elements included, by $\pm\epsilon\text{:}$ strict relations across its boundary have positive gaps, so the shifted function stays isotonic, and $\epsilon=0$ minimizes a differentiable function of one variable (&lt;a href="#A10" title="Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;J&lt;/span&gt;&lt;/a&gt;). For the squared loss this sharpens to the exact zero-mean identity $\sum_{t:x_{t}\in B_{c}}(f^{*}(x_{t})-y_{t})=0$ at every fitted level (&lt;a href="#Thmtheorem8" title="Lemma 8 (Block Residual). ‣ Recall. ‣ Appendix B Block Residual Property ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt;), which on the chain is the classical pooled-averaging property through which &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Kotłowski&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt; (&lt;a href="#bib.bib2" title="Online isotonic regression" class="ltx_ref"&gt;2016&lt;/a&gt;)&lt;/cite&gt; dispense with chaining; on a general poset a level set need not be connected, and the identity survives by summing over the complete level set. Together with the aggregation step, stationarity yields the upper bound.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem1" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 1&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Universal Upper Bound).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Fix a finite poset $\mathcal{P}\text{,}$ an integer $T\geq 1\text{,}$ and a loss $\ell$ with $\ell(\cdot,y)$ convex, $\eta$-exp-concave, and $\beta$-smooth on $[0,1]$ for every $y\text{.}$ There exists a deterministic online learner achieving, for every sequence $(x_{t},y_{t})_{t=1}^{T}\in\mathcal{P}\times[0,1]\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.Ex7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\inf_{K\in\mathbb{N}_{+}}\Bigl\{\,\tfrac{1}{\eta}\,H_{\mathcal{P}}(K)+\tfrac{\beta T}{8K^{2}}\,\Bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For the squared loss, with $(\eta,\beta)=(\tfrac{1}{2},2)\text{,}$ this reads&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.E2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\Psi_{\mathcal{P}}(T)\;:=\;\inf_{K\in\mathbb{N}_{+}}\Bigl\{\,2H_{\mathcal{P}}(K)+\frac{T}{4K^{2}}\,\Bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(2)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;and in particular $R_{T}^{*}(\mathcal{P})\leq\Psi_{\mathcal{P}}(T)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS3.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The two loss parameters enter homogeneously. Write $G(a,b):=\inf_{K\in\mathbb{N}_{+}}\{aH_{\mathcal{P}}(K)+b\,T/K^{2}\}\text{,}$ so that $\Psi_{\mathcal{P}}(T)=G(2,\tfrac{1}{4})$ while &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; gives $G(\tfrac{1}{\eta},\tfrac{\beta}{8})\text{.}$ Monotonicity and positive homogeneity in $(a,b)$ then place the latter between $\min\{\tfrac{1}{2\eta},\tfrac{\beta}{2}\}\,\Psi_{\mathcal{P}}(T)$ and $\max\{\tfrac{1}{2\eta},\tfrac{\beta}{2}\}\,\Psi_{\mathcal{P}}(T)\text{:}$ across the curved class, the loss moves the upper bound by a constant factor only.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS3.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The entropic loss of calibration obeys the same envelope. Being $1$-exp-concave with curvature diverging at the endpoints, it lies outside &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;, and two ingredients replace smoothness. The rounding cost becomes exact: replacing a fitted level $c$ by $z$ costs precisely $w_{B_{c}}\mathrm{kl}(c\,\|\,z)$ with $\mathrm{kl}$ the binary Kullback–Leibler divergence, the Bregman block identity that &lt;a href="#Thmtheorem50" title="Lemma 50 (Level-Set Stationarity). ‣ J.1 Level-Set Stationarity ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;50&lt;/span&gt;&lt;/a&gt; yields for $\ell_{\log}\text{;}$ and the right grid is nonuniform, the arcsine levels $\sin^{2}\bigl(\tfrac{(2k+1)\pi}{4(K+1)}\bigr)\text{,}$ $k=0,\ldots,K\text{,}$ of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Kotłowski&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt; (&lt;a href="#bib.bib2" title="Online isotonic regression" class="ltx_ref"&gt;2016&lt;/a&gt;, Section 7.1)&lt;/cite&gt; having KL covering radius below $14/K^{2}$ under monotone rounding. Aggregating at rate $1$ over the $\Omega(\mathcal{P},K{+}1)$ isotonic maps into those levels gives $R_{T}\leq\inf_{K}\{H_{\mathcal{P}}(K)+14\,T/K^{2}\}\text{,}$ again $\Theta(\Psi_{\mathcal{P}}(T))$ by the comparison above (&lt;a href="#Thmtheorem55" title="Theorem 55 (Entropic Upper Bound). ‣ J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;55&lt;/span&gt;&lt;/a&gt; in &lt;a href="#A10" title="Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;J&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S3" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="matching-lower-bounds-and-the-characterization"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;3 &lt;/span&gt;Matching Lower Bounds and the Characterization&lt;/h2&gt;
&lt;section id="S3.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="two-mechanisms"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.1 &lt;/span&gt;Two Mechanisms&lt;/h3&gt;
&lt;div id="S3.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Our first mechanism supplies what the generic route to online nonparametric lower bounds lacks on this class: a family of isotonic functions realizing a shattering with equalities and with independent coordinates. The relevant fat-shattering branch &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Rakhlin and Sridharan, &lt;a href="#bib.bib16" title="Online non-parametric regression" class="ltx_ref"&gt;2014&lt;/a&gt;, Theorem 3)&lt;/cite&gt; concerns a modified class, its proof adjoining external functions that need not be isotonic. Below the design resolution $1/m$ the class contains no such family, and our second mechanism argues directly with a continuous prior (&lt;a href="#A12" title="Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;L&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Both mechanisms are randomized isotonic adversaries whose posteriors factorize. Mechanism I needs a graded order with many large consecutive central rank levels: independent fair bits toggle the points of $K$ such levels across $K$ nested frontiers, every realization of the bits yields an isotonic function, and each probed point’s value depends on its own bit alone (&lt;em class="ltx_emph ltx_font_italic"&gt;Complete Isolation&lt;/em&gt;), so the game decouples into independent two-point Bernoulli tests. Mechanism II needs a &lt;em class="ltx_emph ltx_font_italic"&gt;separated core&lt;/em&gt;, an isotonic $b:\mathcal{P}\to[\tfrac{1}{3},\tfrac{2}{3}]$ that rises by at least $4\varepsilon$ across every strict relation: perturbing each value of $b$ independently by at most $\varepsilon$ keeps every realization inside the isotonic cone, the posterior factorizes across points, and the van Trees inequality &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Gill and Levit, &lt;a href="#bib.bib8" title="Applications of the van Trees inequality: a Bayesian Cramér–Rao bound" class="ltx_ref"&gt;1995&lt;/a&gt;)&lt;/cite&gt; lower-bounds the estimation error at every query count. Planarity and MacMahon’s formula enter the sharp constants and the fast dynamic programs of &lt;a href="#S5" title="5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;, never the mechanisms themselves. &lt;a href="#S3.F1" title="In 3.1 Two Mechanisms ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Figure&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; shows both in their planar form.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="S3.F1" class="ltx_figure"&gt;
&lt;span id="S3.F1.pic2"&gt;&lt;/span&gt;
&lt;img id="S3.F1.pic1" src="mechanisms.svg" width="379" height="143" alt="Two lower-bound mechanisms: nested level sets and the interior cube" loading="lazy"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;Figure 1: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt;The two lower-bound mechanisms.&lt;/span&gt; Left: Mechanism I on the
plane at $m=16\text{,}$ $K=2\text{.}$ Solid staircases are the two nested frontiers,
dashed segments a frontier’s alternative course when a bit is $0\text{,}$ and dots the probed
points, one per column pair in each layer; same-layer probes align along an
anti-diagonal path. Right: Mechanism II in the slice of one strict pair
$u\prec u^{\prime}\text{,}$ the prior support square sitting inside the isotonic cone with
margins at least $2\varepsilon\text{.}$&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/section&gt;
&lt;section id="S3.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-main-theorem"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.2 &lt;/span&gt;The Main Theorem&lt;/h3&gt;
&lt;div id="S3.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;On the grids $[m]^{d}$ the two mechanisms match the universal upper bound in every fixed dimension, across the loss class.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem2" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 2&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Main Theorem).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Fix an integer $d\geq 2\text{,}$ and let $\ell$ be a curved loss with parameters $(\eta,\beta,\alpha,\Lambda)$ or the entropic loss. For all integers $m\geq 2$ and $T\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}\bigl([m]^{d},\ell\bigr)\;=\;\Theta\bigl(\min\bigl\{T,\;\Psi_{[m]^{d}}(T)\bigr\}\bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;with implied constants depending only on $d$ and the loss parameters.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The content of the theorem is geometric: the formula holds in every dimension through the same two mechanisms, and the entire loss dependence collapses into the constant, so the rate is governed by the entropy profile $H_{[m]^{d}}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S3.SS2.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Proof architecture.&lt;/h5&gt;
&lt;div id="S3.SS2.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The upper bound follows by evaluating &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorems&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmtheorem55" title="Theorem 55 (Entropic Upper Bound). ‣ J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;55&lt;/span&gt;&lt;/a&gt; through &lt;a href="#Thmtheorem62" title="Lemma 62 (Grid Entropy). ‣ K.2 Grid Entropy ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;62&lt;/span&gt;&lt;/a&gt;. The two mechanisms run along the rank levels $A_{s}:=\{x\in[m]^{d}:\sum_{i}(x_{i}-1)=s\}\text{,}$ of which at least $m/2$ consecutive central ones carry at least $m^{d-1}/(2d)$ points apiece by the unimodality of $(|A_{s}|)_{s}\text{,}$ the only combinatorial input the grids require. Both price rounds through the posterior. A Mechanism I bit stays uncertain across the $\Theta(K^{2})$ rounds of its episode, its two candidate values differing by $\Theta(1/K)\text{,}$ so every informative round costs $\Omega(1/K^{2})\text{;}$ with $\Theta_{d}(m^{d-1}K)$ bits to resolve on $K\leq m/2$ of those levels, the ensemble yields $R_{T}^{*}([m]^{d})\gtrsim_{d}\min\{m^{d-1}K,\,T/K^{2}\}\text{,}$ and $T$ decides which branch of the minimum binds. Mechanism II perturbs the rank function itself, a separated core; each of the $m^{d}$ cells then receives $\Theta_{d}(T/m^{d})$ queries, and van Trees converts that query count into a per-cell estimation error, yielding $R_{T}^{*}([m]^{d})\geq\tfrac{3}{16}\,m^{d}\log\bigl(1+\tfrac{T}{540\,d^{2}m^{d+2}}\bigr)$ for $T\geq m^{d}\text{.}$ A curved loss enters the argument at exactly two points, the posterior-variance step of the bit ensemble and the regret-to-squared-error reduction of the separated core, where (&lt;a href="#S2.E1" title="Equation 1 ‣ 2.1 Setup ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;) substitutes the factor $\alpha\text{;}$ every other step concerns the Bernoulli observation law alone, and Pinsker’s inequality supplies $\alpha=2$ for the entropic loss. An elementary envelope comparison assembles these bounds into $\min\{T,\Psi_{[m]^{d}}(T)\}\text{.}$ Full proofs: &lt;a href="#A11" title="Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;K&lt;/span&gt;&lt;/a&gt; for the constructions and the merging, &lt;a href="#A10" title="Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;J&lt;/span&gt;&lt;/a&gt; for the loss substitutions; the planar squared-loss case carries the explicit constant $(1088\cdot 342)^{-1}$ through &lt;a href="#A4" title="Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;D&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.SSS0.Px1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;In dimension one the grid is the chain, whose complete law is &lt;a href="#Thmtheorem46" title="Theorem 46 (Chain Complete Minimax). ‣ Order polynomial of the chain. ‣ I.1 Setup and Main Theorem ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;46&lt;/span&gt;&lt;/a&gt;: at intermediate horizons the rate is $\Theta(T^{1/3}L_{T}^{2/3})$ with $L_{T}:=1+\log_{+}(n^{3}/T)$ and $\log_{+}x:=\max\{\log x,0\}\text{,}$ the logarithmic factor announced by the chain’s entropy in &lt;a href="#S2.SS2" title="2.2 The Order Polynomial Is the Metric Entropy ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt; and avoided in every dimension $d\geq 2$ (&lt;a href="#A9" title="Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;I&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S3.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-three-phases-and-the-phase-criterion"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.3 &lt;/span&gt;The Three Phases and the Phase Criterion&lt;/h3&gt;
&lt;div id="S3.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Evaluating the envelope of &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; through &lt;a href="#Thmtheorem62" title="Lemma 62 (Grid Entropy). ‣ K.2 Grid Entropy ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;62&lt;/span&gt;&lt;/a&gt; yields the scaling law.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem3" class="ltx_theorem ltx_theorem_corollary"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Corollary 3&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Three-Phase Scaling Law).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Fix $d$ and $\ell$ as in &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;. For all integers $m\geq 2$ and $T\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.E3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}([m]^{d},\ell)\;=\;\begin{cases}\Theta_{d}(T),&amp;amp;T\lesssim_{d}m^{d-1}\quad\text{(Phase 0),}\\[2.0pt] \Theta_{d}\bigl(m^{2(d-1)/3}\,T^{1/3}\bigr),&amp;amp;m^{d-1}\lesssim_{d}T\lesssim_{d}m^{d+2}\quad\text{(Phase 1),}\\[2.0pt] \Theta_{d}\bigl(m^{d}\,\bigl[1+\log\tfrac{T}{m^{d+2}}\bigr]\bigr),&amp;amp;T\gtrsim_{d}m^{d+2}\quad\text{(Phase 2),}\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(3)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;with implied constants depending also on the loss parameters.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The optimization behind (&lt;a href="#S3.E3" title="Equation 3 ‣ Corollary 3 (Three-Phase Scaling Law). ‣ 3.3 The Three Phases and the Phase Criterion ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;) is part of the proof of &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; in &lt;a href="#A11" title="Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;K&lt;/span&gt;&lt;/a&gt;. The phases have a physical reading: in Phase 0 the adversary lacks the budget to activate the combinatorial structure and every round costs $\Theta(1)\text{;}$ in Phase 1 a $K$-layer frontier balances its $\Theta_{d}(m^{d-1}K)$ bits against the observation cost $T/K^{2}$ at $K^{*}\asymp_{d}(T/m^{d-1})^{1/3}\text{;}$ in Phase 2 the $m^{d}$ cells decouple into independent scalar estimation problems and the regret turns logarithmic.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;On the plane both the entropy and the envelope are exact. Order-preserving maps $[m]^{2}\to\{1,\ldots,K{+}1\}$ are in bijection with plane partitions in an $m\times m\times K$ box, and MacMahon’s formula counts them.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem4" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 4&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (MacMahon’s Formula &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(MacMahon, &lt;a href="#bib.bib7" title="Combinatory analysis" class="ltx_ref"&gt;1916&lt;/a&gt;)&lt;/cite&gt;).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For all integers $m,K\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.E4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Omega([m]^{2},K{+}1)\;=\;\prod_{i=1}^{m}\prod_{j=1}^{m}\frac{K+i+j-1}{i+j-1}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(4)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Taking logarithms in (&lt;a href="#S3.E4" title="Equation 4 ‣ Theorem 4 (MacMahon’s Formula (MacMahon, 1916)). ‣ 3.3 The Three Phases and the Phase Criterion ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;) turns the count into a double sum, and an Euler–Maclaurin expansion of it gives the planar entropy law $H_{[m]^{2}}(K)=m^{2}\,\varphi(K/m)+O(\log m)\text{,}$ the error uniform in $K\text{,}$ with $\varphi(\alpha):=\int_{0}^{1}\!\!\int_{0}^{1}\log\bigl(1+\tfrac{\alpha}{s+t}\bigr)\,ds\,dt$ the Riemann limit of that sum (&lt;a href="#Thmtheorem14" title="Lemma 14 (Log-Order-Polynomial Asymptotic). ‣ C.5 Main-Text Form ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;14&lt;/span&gt;&lt;/a&gt;). The three-phase law sharpens accordingly, to $\Psi_{[m]^{2}}(T)=m^{2}\,\psi(T/m^{4})+O(m)$ as $T/m\to\infty$ with $\psi(c):=\inf_{\alpha&amp;gt;0}\{2\varphi(\alpha)+c/(4\alpha^{2})\}$ (&lt;a href="#A3" title="Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;C&lt;/span&gt;&lt;/a&gt;), and the Phase-1 constant lies between $7^{-7/3}\approx 0.0107$ and $\bigl(\tfrac{3\log 2}{4}\bigr)^{2/3}\approx 0.6465$ (&lt;a href="#A13" title="Appendix M The Phase-1 Constant ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;M&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Which phases can occur is governed by the shape of $H_{\mathcal{P}}\text{.}$ Truncation at level $K$ splits an isotonic map valued in $\{0,\ldots,K{+}L\}$ injectively into one valued in $\{0,\ldots,K\}$ plus one valued in $\{0,\ldots,L\}\text{,}$ so $H_{\mathcal{P}}(K{+}L)\leq H_{\mathcal{P}}(K)+H_{\mathcal{P}}(L)\text{:}$ on every finite poset the entropy is subadditive, hence at most linear in $K\text{.}$ On a power-law window $H_{\mathcal{P}}(K)\asymp K^{\rho}$ this forces $\rho\leq 1\text{,}$ and balancing $K^{\rho}$ against $T/K^{2}$ caps the intermediate exponent of the envelope at $\rho/(\rho+2)\leq\tfrac{1}{3}\text{.}$ The regret never exceeds the envelope, so no finite poset sustains an intermediate phase with a larger exponent; the grid attains the cap in every dimension: extremal, not special. A linear regime of $H_{\mathcal{P}}$ produces the cube-root phase on every family characterized here, and entropy of the form $n\log(K{+}1)$ produces no intermediate phase at all. Posets of height at most two are of that kind: two antichains carry the whole order, any assignment on either extends isotonically, and the rate is $\Theta(n\log(1+T/n))\text{,}$ which Follow-the-Leader already attains under the squared loss. Fences, whose cover relations alternate in direction along a path, are among them (&lt;a href="#Thmtheorem67" title="Proposition 67 (Height-Two Posets). ‣ K.6 Height-Two Posets ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;67&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S4" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="the-lipschitz-boundary"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;4 &lt;/span&gt;The Lipschitz Boundary&lt;/h2&gt;
&lt;div id="S4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The universal upper bound rests on two prices: exp-concavity puts aggregation at $\tfrac{1}{\eta}H_{\mathcal{P}}(K)\text{,}$ and smoothness puts rounding at $\beta T/(8K^{2})\text{.}$ A kink degrades both at once: aggregation reverts to the $\sqrt{T\,H_{\mathcal{P}}(K)}$ of a generic bounded convex loss, and rounding turns linear in the resolution. Already on the one-point poset, where the comparator class is the interval $[0,1]\text{,}$ the squared loss has minimax regret $\Theta(\log T)\text{,}$ while under independent fair labels the absolute loss costs every prediction $\tfrac{1}{2}$ per round and lets the better endpoint recover half of $\lvert\sum_{t}(2y_{t}-1)\rvert$ in hindsight, forcing $\Theta(\sqrt{T})$ (&lt;a href="#A10" title="Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;J&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $\tau\in(0,1)\text{,}$ the pinball loss $\ell_{\tau}(p,y):=\tau(y-p)_{+}+(1-\tau)(p-y)_{+}$ is the loss of quantile estimation, with $\rho_{\tau}:=\tau(1-\tau)\text{;}$ the absolute loss is $2\ell_{1/2}\text{.}$ On grids the rate is a square-root law, uniform in the quantile:&lt;/p&gt;
&lt;table id="S4.Ex9" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}\bigl([m]^{d},\ell_{\tau}\bigr)\;=\;\Theta_{d}\Bigl(\min\bigl\{\rho_{\tau}T,\;\sqrt{\rho_{\tau}\,m^{d-1}\,T}\bigr\}\Bigr),\quad R_{T}^{*}\bigl([m]^{d},\lvert\cdot\rvert\bigr)\;=\;\Theta_{d}\bigl(\min\{T,\sqrt{m^{d-1}T}\}\bigr)$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;(&lt;a href="#Thmtheorem56" title="Theorem 56 (Pinball and Absolute Losses on Grids). ‣ J.5 Lipschitz Losses ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;56&lt;/span&gt;&lt;/a&gt;, proved in &lt;a href="#A10" title="Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;J&lt;/span&gt;&lt;/a&gt;). The upper bound aggregates the $e^{H_{[m]^{d}}(1)}$ indicators of upsets, the upward-closed subsets of the grid, under exponential weights: the layer-cake identity $f=\int_{0}^{1}\mathbf{1}\!\left[\cdot\in\{f\geq s\}\right]\,ds$ reduces the linearized regret against $\mathcal{F}_{\mathcal{P}}^{\uparrow}$ to the regret against a single upset, and a small-loss bound, its benchmark $\rho_{\tau}T$ witnessed by the empty and full upsets, yields the rate. The lower bound draws $\mathrm{Ber}(1-\tau)$ labels on one central rank level, where the pinball Bayes risk is flat at $\rho_{\tau}\text{,}$ fair coins at $\tau=\tfrac{1}{2}\text{:}$ the learner pays $\rho_{\tau}$ each round, while the comparator picks the better endpoint at each of the $\Theta_{d}(m^{d-1})$ antichain points independently and collects their binomial fluctuations.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;No resolution enters either bound; the grid disappears from the analysis, the upper bound retaining only $H_{[m]^{d}}(1)$ and the lower bound only the size of one rank level. On the plane, $\sqrt{mT}$ is exactly what the single-scale bound of &lt;a href="#A12" title="Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;L&lt;/span&gt;&lt;/a&gt; yields at coarse scales, now met without slack: what stationarity and smoothness together recover for curved losses is what the kink forfeits. The square-root rate is attained efficiently: the grid splits into planes at no cost in entropy, and on the queried one the exponential-weights prediction is a single weighted upset marginal, one call per round to the $O(m^{2})$ dynamic program of &lt;a href="#Thmtheorem38" title="Lemma 38 (Upset Marginal DP). ‣ F.2.2 Upset Marginal DP ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;38&lt;/span&gt;&lt;/a&gt; (&lt;a href="#A10" title="Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;J&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S5" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="polynomial-time-algorithms"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;5 &lt;/span&gt;Polynomial-Time Algorithms&lt;/h2&gt;
&lt;div id="S5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Realizing &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; directly means maintaining $e^{H_{\mathcal{P}}(K)}$ experts, exponential in $m^{d-1}$ on grids. This section removes the obstacle: its endpoint is &lt;a href="#Thmtheorem7" title="Theorem 7 (Slicing). ‣ 5.4 Every Fixed Dimension, Every Loss ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;, a horizon-free polynomial-time learner rate-optimal on $[m]^{d}$ for every fixed $d$ and every loss of the &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; family. The route runs through the plane: two complementary engines, their lower envelope made horizon-free by a rate-doubling wrapper, and a slicing step that lifts the planar learner to every dimension.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S5.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="column-independent-chain-exponential-weights"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.1 &lt;/span&gt;Column-Independent Chain Exponential Weights&lt;/h3&gt;
&lt;div id="S5.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The first engine drops the constraints between columns: each column $i\in[m]$ is treated as an independent chain, carrying its own exponential weights over the $\binom{m+K}{K}$ non-decreasing $G_{K}$-valued functions $\mathcal{F}_{[m],K}^{\uparrow}\text{.}$ Because the squared loss is row-additive, the per-column weight factorizes across rows, and the predictive mean at a query $x_{t}=(i_{t},j_{t})$ reduces to a $(K{+}1)$-state forward-backward dynamic program along the chain, $O(mK)$ per round, only the queried column updating.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Every $f\in\mathcal{F}_{[m]^{2}}^{\uparrow}$ restricts column-wise to a non-decreasing function, so $\mathcal{F}_{[m]^{2}}^{\uparrow}\subseteq\prod_{i=1}^{m}\mathcal{F}_{[m]}^{\uparrow}\text{;}$ enlarging the comparator class cannot decrease the regret, which then splits as $R_{T}\leq\sum_{i=1}^{m}R_{i}\text{.}$ Per column, the chain case of &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; gives $R_{i}\leq 2\log\binom{m+K}{K}+T_{i}/(4K^{2})$ with $T_{i}:=|\{t:i_{t}=i\}|\text{,}$ and $\sum_{i}T_{i}=T\text{,}$ so $R_{T}\leq 2m\log\binom{m+K}{K}+T/(4K^{2})\text{.}$ At a level attaining the infimum, and with $R_{T}\leq T\text{,}$ this gives $R_{T}\leq\min\{T,\Psi_{\mathrm{col}}(T)\}$ with $\Psi_{\mathrm{col}}(T):=\inf_{K\in\mathbb{N}_{+}}\bigl\{2m\,\log\binom{m+K}{K}+T/(4K^{2})\bigr\}$ (&lt;a href="#Thmtheorem35" title="Theorem 35 (Column-Independent Upper Bound). ‣ F.1.4 Proof of Theorem 35 ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;35&lt;/span&gt;&lt;/a&gt;, proved in &lt;a href="#A6.SS1" title="F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;F.1&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;In Phase 2 ($T\gg m^{4}$), $K^{*}=\Theta(\sqrt{T}/m)$ gives $\Psi_{\mathrm{col}}(T)=\Theta(m^{2}\log(T/m^{4}))\text{,}$ matching &lt;a href="#Thmtheorem3" title="Corollary 3 (Three-Phase Scaling Law). ‣ 3.3 The Three Phases and the Phase Criterion ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; at the $\Theta$ level. In Phase 1 the engine pays for the enlargement: for $m\log m\lesssim T\lesssim m^{4}\text{,}$ $\Psi_{\mathrm{col}}(T)=\Theta(m^{2/3}\,T^{1/3}\,[1+\log(m^{4}/T)]^{2/3})\text{,}$ the factor above the minimax rate being of order $(\log m)^{2/3}$ through the bulk of the phase and fading only at its far end. The factor has an algebraic source: dropping the inter-column constraints inflates the entropy from $2H_{[m]^{2}}(K)=\Theta(mK)$ to $2m\log\binom{m+K}{K}=\Theta(mK[1+\log(m/K)])$ for $K\leq m\text{,}$ and the logarithm is not negligible at $K^{*}\ll m\text{.}$ Widening columns to strips does not help: every regret bound the standard exp-concave EW analysis produces for a strip decomposition retains the factor (&lt;a href="#Thmtheorem44" title="Theorem 44 (Strip-Independent Transfer-Matrix Lower Bound). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;44&lt;/span&gt;&lt;/a&gt;); closing it takes a different decomposition.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S5.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="surrogate-threshold-indexed-exponential-weights"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.2 &lt;/span&gt;Surrogate Threshold-Indexed Exponential Weights&lt;/h3&gt;
&lt;div id="S5.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Decomposing by threshold layer instead closes the gap. The engine has three parts: a Gibbs identity that factorizes the exponential weights across layers once the latent representation is enlarged, a surrogate loss that dominates the true loss on the enlarged representation and is tight on its nested part, and an $O(m^{2})$ dynamic program for upset marginals.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S5.SS2.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Gibbs layering.&lt;/h5&gt;
&lt;div id="S5.SS2.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $h:[m]^{2}\to\{0,1,\ldots,K\}$ and $u\in[m]^{2}\text{,}$ $h(u)=\sum_{r}\mathbf{1}\!\left[h(u)\geq r\right]$ and $h(u)^{2}=\sum_{r}(2r-1)\,\mathbf{1}\!\left[h(u)\geq r\right]\text{,}$
the first identity writing $h$ as the count of thresholds it exceeds, the second following from the first via $\sum_{r=1}^{k}(2r-1)=k^{2}\text{.}$ Substituted into the exponential weight $\exp(-\tfrac{1}{2}\sum_{s&amp;lt;t}(g(x_{s})-y_{s})^{2})$ of a grid function $g=h/K\text{,}$ they factorize the weight into per-layer, per-cell factors indexed by the threshold upsets $U_{r}(h):=\{h\geq r\}\text{;}$ once the nesting constraint on the tuple $(U_{1},\ldots,U_{K})$ is dropped, the factorization is complete and the weights update layer by layer. In the other direction, for $z_{1},\ldots,z_{K}\in\{0,1\}$ with $k:=\sum_{r}z_{r}\text{,}$ the strictly increasing coefficients give $\sum_{r}(2r-1)\,z_{r}\geq k^{2}\text{,}$ with equality exactly when $(z_{1},\ldots,z_{K})$ is the prefix of length $k\text{:}$ the inequality that makes the relaxation free.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S5.SS2.SSS0.Px2" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Generalized experts and the surrogate.&lt;/h5&gt;
&lt;div id="S5.SS2.SSS0.Px2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;A &lt;em class="ltx_emph ltx_font_italic"&gt;generalized expert&lt;/em&gt; is an arbitrary tuple $G=(U_{1},\ldots,U_{K})\in\mathcal{U}^{K}$ of upsets of $[m]^{2}\text{,}$ predicting $g_{G}(x):=\tfrac{1}{K}\sum_{r}\mathbf{1}\!\left[x\in U_{r}\right]\text{;}$ there are $\binom{2m}{m}^{K}$ of them, the upsets being in bijection with monotone lattice paths, $|\mathcal{U}|=\binom{2m}{m}\text{,}$ and every $g_{G}$ is isotonic, a nonnegative combination of upset indicators, as is every average of them. Under the squared loss the surrogate charges $G$ the loss increments of its layers, additive across layers by construction,&lt;/p&gt;
&lt;table id="S5.E5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widetilde{\ell}(G;\,x,y)\;:=\;y^{2}\,+\,\sum_{r=1}^{K}\!\left(\frac{2r-1}{K^{2}}-\frac{2y}{K}\right)\mathbf{1}\!\left[x\in U_{r}\right],$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(5)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;with per-layer coefficient $c_{r,t}:=(2r-1)/K^{2}-2y_{t}/K$ at round $t\text{,}$ and we abbreviate $\widetilde{\ell}_{t}(G):=\widetilde{\ell}(G;\,x_{t},y_{t})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS2.SSS0.Px2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The surrogate dominates the true loss, $\widetilde{\ell}(G;\,x,y)\geq(g_{G}(x)-y)^{2}\text{,}$ with equality exactly when the membership vector $(\mathbf{1}\!\left[x\in U_{1}\right],\ldots,\mathbf{1}\!\left[x\in U_{K}\right])$ is a prefix of ones, hence at every $x$ once $U_{1}\supseteq\cdots\supseteq U_{K}$ (&lt;a href="#Thmtheorem37" title="Lemma 37 (Surrogate Dominance and Nested Tightness). ‣ F.2.1 Surrogate Dominance and Nested Tightness ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;37&lt;/span&gt;&lt;/a&gt;); in the loss-increment form this is a rearrangement bound valid for every convex loss (&lt;a href="#Thmtheorem57" title="Lemma 57 (Increment Dominance). ‣ J.6 The Loss-Increment Surrogate ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;57&lt;/span&gt;&lt;/a&gt;), and that form is what carries the engine across the loss class in &lt;a href="#S5.SS4" title="5.4 Every Fixed Dimension, Every Loss ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.4&lt;/span&gt;&lt;/a&gt;. Each layer’s marginal $\Pr_{U\sim\mu}[x\in U]$ under $\mu(U)\propto\prod_{u\in U}w_{u}$ is computable in $O(m^{2})$ time by parametrizing upsets through their frontiers and running a forward-backward program over cutoffs (&lt;a href="#Thmtheorem38" title="Lemma 38 (Upset Marginal DP). ‣ F.2.2 Upset Marginal DP ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;38&lt;/span&gt;&lt;/a&gt;). &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; keeps one weight per cell in each layer, so that the global measure is the product $\pi_{t}$ of the $K$ layer measures, runs that program once in each layer, and predicts the average of the $K$ marginals; &lt;a href="#A6.SS2" title="F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;F.2&lt;/span&gt;&lt;/a&gt; proves all three.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="S5.F2" class="ltx_figure paper-algorithms"&gt;
&lt;figure id="alg1" class="ltx_float ltx_float_algorithm ltx_framed ltx_framed_top"&gt;
&lt;figcaption class="ltx_caption"&gt;&lt;span class="ltx_tag ltx_tag_float"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Algorithm 1&lt;/span&gt; &lt;/span&gt; Column-Independent Chain EW&lt;/figcaption&gt;
&lt;div class="ltx_listing ltx_listing"&gt;
&lt;div id="alg1.l1" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;Input:&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; edge length &amp;lt;/span&amp;gt;$m$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;, level &amp;lt;/span&amp;gt;$K$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;, horizon &amp;lt;/span&amp;gt;$T$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;.
&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id="alg1.l2" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;Initialize:&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;$\mu_{i}\leftarrow\mathrm{Unif}(\mathcal{F}_{[m],K}^{\uparrow})$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; for each &amp;lt;/span&amp;gt;$i\in[m]$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;.
&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id="alg1.l3" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;for&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;$t=1,2,\ldots,T$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;do&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id="alg1.l4" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;2:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;    Observe &amp;lt;/span&amp;gt;$x_{t}=(i_{t},j_{t})$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;.
&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id="alg1.l5" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;3:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;    &amp;lt;/span&amp;gt;$\hat{y}_{t}\leftarrow\mathbb{E}_{g\sim\mu_{i_{t}}}[g(j_{t})]$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; via fwd-bwd DP.
&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id="alg1.l6" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;4:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;    Predict &amp;lt;/span&amp;gt;$\hat{y}_{t}$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;, observe &amp;lt;/span&amp;gt;$y_{t}$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;.
&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id="alg1.l7" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;5:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;    &amp;lt;/span&amp;gt;$\mu_{i_{t}}(g)\propto\mu_{i_{t}}(g)\,e^{-(g(j_{t})-y_{t})^{2}/2}$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id="alg1.l8" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;6:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;end&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;for&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/figure&gt;
&lt;figure id="alg2" class="ltx_float ltx_float_algorithm ltx_framed ltx_framed_top"&gt;
&lt;figcaption class="ltx_caption"&gt;&lt;span class="ltx_tag ltx_tag_float"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Algorithm 2&lt;/span&gt; &lt;/span&gt; Surrogate Threshold-Indexed EW&lt;/figcaption&gt;
&lt;div class="ltx_listing ltx_listing"&gt;
&lt;div id="alg2.l1" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;Input:&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; edge length &amp;lt;/span&amp;gt;$m$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;, level &amp;lt;/span&amp;gt;$K$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;, horizon &amp;lt;/span&amp;gt;$T$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;.
&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id="alg2.l2" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;Initialize:&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;$w_{u,r}\leftarrow 1$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; for all &amp;lt;/span&amp;gt;$r\in[K]$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;$u\in[m]^{2}$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;.
&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id="alg2.l3" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;for&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;$t=1,2,\ldots,T$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;do&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id="alg2.l4" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;2:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;    Observe &amp;lt;/span&amp;gt;$x_{t}\in[m]^{2}$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;.
&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id="alg2.l5" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;3:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;for&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;$r=1,\ldots,K$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;do&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id="alg2.l6" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;4:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;         &amp;lt;/span&amp;gt;$p_{t,r}\leftarrow\mathrm{UpsetDP}(\{w_{u,r}\}_{u},x_{t})$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id="alg2.l7" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;5:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;end&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;for&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id="alg2.l8" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;6:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;    Predict &amp;lt;/span&amp;gt;$\hat{y}_{t}\leftarrow(1/K)\sum_{r}p_{t,r}$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;observe &lt;/span&gt;$y_{t}$&lt;span class="ltx_text" style="font-size:90%;"&gt;.
&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="alg2.l9" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;7:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;for&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;$r=1,\ldots,K$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;do&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id="alg2.l10" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;8:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;         &amp;lt;/span&amp;gt;$c_{r,t}\leftarrow(2r-1)/K^{2}-2y_{t}/K$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id="alg2.l11" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;9:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;         &amp;lt;/span&amp;gt;$w_{x_{t},r}\leftarrow w_{x_{t},r}\,e^{-c_{r,t}/2}$&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id="alg2.l12" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;10:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;end&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;for&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id="alg2.l13" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;11:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;end&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot; style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;for&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/figure&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;Figure 2: &lt;/span&gt;The two atomic polynomial-time algorithms underlying our
horizon-free wrapper: &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; decomposes by column (per-column 1D DP), &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; decomposes by surrogate layer (per-layer upset DP).&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div id="Thmtheorem5" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 5&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Surrogate Upper Bound).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Fix any integers $m\geq 2$ and $K\in\mathbb{N}_{+}\text{.}$ &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; runs in per-round time $O(Km^{2})$ and, for any sequence $(x_{t},y_{t})_{t=1}^{T}\in[m]^{2}\times[0,1]\text{,}$ satisfies $R_{T}\leq 2K\,\log\!\binom{2m}{m}+T/(4K^{2})\text{.}$ At a level attaining the infimum below, and with $R_{T}\leq T\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.E6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\min\!\bigl\{T,\;\Psi_{\mathrm{surr}}(T)\bigr\},\quad\Psi_{\mathrm{surr}}(T)\;:=\;\inf_{K\in\mathbb{N}_{+}}\!\biggl\{2K\,\log\!\binom{2m}{m}\,+\,\frac{T}{4K^{2}}\biggr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(6)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.SS2.SSS0.Px2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;By Stirling’s formula, $\log\binom{2m}{m}=2m\log 2-O(\log m)\text{,}$ so $K^{*}=\Theta((T/m)^{1/3})$ and $\Psi_{\mathrm{surr}}(T)=\Theta(m^{2/3}T^{1/3})\text{:}$ rate-optimal throughout Phase 1, with no logarithmic factor. In Phase 2 the envelope stays at $T^{1/3}$ while the rate turns logarithmic, so the two engines are complementary.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S5.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="combined-strategy-and-horizon-free-wrapper"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.3 &lt;/span&gt;Combined Strategy and Horizon-Free Wrapper&lt;/h3&gt;
&lt;div id="S5.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For a known horizon the better engine can be chosen in advance: with $\Phi(T):=\min\{T,\Psi_{\mathrm{col}}(T),\Psi_{\mathrm{surr}}(T)\}\text{,}$ running whichever of &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; and &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; has the smaller envelope, at its optimizing level, takes $\mathrm{poly}(m,T)$ per round and satisfies $R_{T}\leq\Phi(T)$ (&lt;a href="#Thmtheorem40" title="Theorem 40 (Combined Upper Bound). ‣ F.3.1 Combined Upper Bound ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;40&lt;/span&gt;&lt;/a&gt;), the trivial bound $R_{T}\leq T$ holding for any predictions in $[0,1]\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS3.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Evaluating the three terms phase by phase,&lt;/p&gt;
&lt;table id="S5.E7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Phi(T)\;=\;\begin{cases}\Theta(T),&amp;amp;T\lesssim m,\\ \Theta(m^{2/3}T^{1/3}),&amp;amp;m\lesssim T\lesssim m^{4},\\ \Theta(m^{2}\log(T/m^{4})),&amp;amp;T\gg m^{4},\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(7)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;matching &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; at the $\Theta$ level at every horizon.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S5.SS3.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Rate-doubling wrapper.&lt;/h5&gt;
&lt;div id="S5.SS3.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;a href="#Thmtheorem40" title="Theorem 40 (Combined Upper Bound). ‣ F.3.1 Combined Upper Bound ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;40&lt;/span&gt;&lt;/a&gt; requires advance knowledge of $T\text{.}$ Partition the time axis into epochs $k=1,2,\ldots$ of adaptive length&lt;/p&gt;
&lt;table id="S5.E8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$L_{k}\;:=\;\max\!\bigl\{L\in\mathbb{N}_{+}:\Phi(L)\leq 2^{k-1}\bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(8)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;so the regret of a horizon-$L_{k}$ instance of the combined strategy within epoch $k$ is $\leq\Phi(L_{k})\leq 2^{k-1}\text{,}$ summing geometrically. Different epochs use freshly initialized algorithms (no shared state); see &lt;a href="#alg3" title="In Algorithm 3 (formal restatement). ‣ F.3.3 Proof of Theorem 6 ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; in &lt;a href="#A6.SS3" title="F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;F.3&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem6" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 6&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Horizon-Free Polynomial-Time Rate-Optimal Algorithm).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem6.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;a href="#alg3" title="In Algorithm 3 (formal restatement). ‣ F.3.3 Proof of Theorem 6 ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref ltx_font_italic"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;&lt;span class="ltx_text ltx_font_italic"&gt; runs in $\mathrm{poly}(m,t)$ per-round time at every round $t\geq 1$ and, for any $T\geq 1$ and any sequence $(x_{t},y_{t})_{t=1}^{T}\in[m]^{2}\times[0,1]\text{,}$ satisfies $R_{T}\leq 4\,\Phi(T)+2\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S5.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="every-fixed-dimension-every-loss"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.4 &lt;/span&gt;Every Fixed Dimension, Every Loss&lt;/h3&gt;
&lt;div id="S5.SS4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The planar learner lifts to every dimension by slicing. Write each $x\in[m]^{d}$ as $(z,i,j)$ with $z\in[m]^{d-2}\text{:}$ the slices $\{z\}\times[m]^{2}$ partition the grid into $m^{d-2}$ copies of the plane, and the learner runs an independent planar instance on each, advancing only the queried one.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem7" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 7&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Slicing).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem7.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Fix an integer $d\geq 2$ and let $\ell$ be a loss of the &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; family. There is a horizon-free deterministic learner for $[m]^{d}$ with $\mathrm{poly}(m,t)$ per-round time achieving, for all integers $m\geq 2$ and $T\geq 1$ and every sequence,&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex10" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;C_{d,\ell}\,\min\bigl\{T,\;\Psi_{[m]^{d}}(T)\bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;with $C_{d,\ell}$ depending only on $d$ and the loss parameters.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.SS4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;A global comparator restricts isotonically to every slice, so the benchmark only tightens slicewise and regret adds across slices; Jensen’s inequality then recombines the per-slice bounds through the concave three-phase majorant of (&lt;a href="#S5.E7" title="Equation 7 ‣ 5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;), reproducing the three phases of &lt;a href="#Thmtheorem3" title="Corollary 3 (Three-Phase Scaling Law). ‣ 3.3 The Three Phases and the Phase Criterion ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; exactly (&lt;a href="#A11" title="Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;K&lt;/span&gt;&lt;/a&gt;). Behind the recombination is an entropy accounting: $m^{d-2}$ planar slices at $\Theta(mK)$ apiece reproduce the global $\Theta_{d}(m^{d-1}K)\text{,}$ while slicing into chains would inflate each factor by the logarithm behind the strip barrier of &lt;a href="#Thmtheorem44" title="Theorem 44 (Strip-Independent Transfer-Matrix Lower Bound). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;44&lt;/span&gt;&lt;/a&gt;; the plane is the smallest unit on which slicing is free. For losses beyond the squared one, &lt;a href="#A10" title="Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;J&lt;/span&gt;&lt;/a&gt; rebuilds the planar engine: the loss-increment surrogate keeps the layer factorization and the upset dynamic program, stationarity and the arcsine grid price the rounding, and the wrapper framework carries over with rescaled constants (&lt;a href="#Thmtheorem58" title="Proposition 58 (Planar Engine for the Loss Family). ‣ J.7 The Planar Engine Across the Loss Class ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;58&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The costs are explicit. At level $K\text{,}$ &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; runs in $O(mK)$ time and $O(m^{2}K)$ storage per round and &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; in $O(Km^{2})$ time and storage; at the rate-optimal levels this is $O(m^{5/3}T^{1/3})$ per round in Phase 1 and $O(\sqrt{T})$ per round with $O(m\sqrt{T})$ storage in Phase 2. These figures are for the planar engines; the sliced learner advances only the queried slice and stores state for the touched ones. Measured, &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; at $m=24\text{,}$ $K=6$ takes $1.3$ ms per round in unoptimized single-core Python, $35$ seconds for the calibration stream of &lt;a href="#A1" title="Appendix A Experiments ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;A&lt;/span&gt;&lt;/a&gt;, where synthetic runs locate the transition at $T\asymp m^{4}$ and the crossover between the two engines.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S6" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="discussion"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;6 &lt;/span&gt;Discussion&lt;/h2&gt;
&lt;div id="S6.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;On every grid $[m]^{d}$ with $d\geq 2$ fixed, the minimax regret of online isotonic regression is $\Theta(\min\{T,\Psi_{[m]^{d}}(T)\})$ for every loss of the &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; family, and a horizon-free polynomial-time learner attains the rate (&lt;a href="#Thmtheorem7" title="Theorem 7 (Slicing). ‣ 5.4 Every Fixed Dimension, Every Loss ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;): this settles, on these grids, the problem posed by &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Kotłowski&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt; (&lt;a href="#bib.bib3" title="Random permutation online isotonic regression" class="ltx_ref"&gt;2017&lt;/a&gt;)&lt;/cite&gt;. The boundary cases have their own laws: the square-root rate of &lt;a href="#Thmtheorem56" title="Theorem 56 (Pinball and Absolute Losses on Grids). ‣ J.5 Lipschitz Losses ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;56&lt;/span&gt;&lt;/a&gt; for the pinball family, and the complete chain law of &lt;a href="#Thmtheorem46" title="Theorem 46 (Chain Complete Minimax). ‣ Order polynomial of the chain. ‣ I.1 Setup and Main Theorem ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;46&lt;/span&gt;&lt;/a&gt; in dimension one.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Our protocol allows repeated queries. Every upper bound is pathwise, so the algorithms and their guarantees hold verbatim under distinct queries, in particular under the random-permutation model of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Kotłowski&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt; (&lt;a href="#bib.bib3" title="Random permutation online isotonic regression" class="ltx_ref"&gt;2017&lt;/a&gt;)&lt;/cite&gt;. Distinct queries reshape the minimax question itself: they force $T\leq m^{d}\text{,}$ so Phase 2, which begins at $T\gtrsim_{d}m^{d+2}\text{,}$ cannot even be posed; through $T\lesssim_{d}m^{d-1}$ the two protocols share the rate $\Theta_{d}(T)\text{,}$ since fair-coin labels on a central rank level, an antichain of $\Theta_{d}(m^{d-1})$ points, cost any learner at least $\tfrac{1}{4}$ per round in expectation while some isotonic function fits them exactly; and on the remaining window $m^{d-1}\lesssim_{d}T\leq m^{d}$ the sharp rate is open, between the $\Omega_{d}(m^{d-1})$ of the same construction and the pathwise $O_{d}(m^{2(d-1)/3}T^{1/3})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We conjecture that $R_{T}^{*}(\mathcal{P})=\Theta(\min\{T,\Psi_{\mathcal{P}}(T)\})$ for every finite $\mathcal{P}\text{,}$ matching &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;. The open problem is to establish the conjecture, and to match it in polynomial time, on every finite poset; Follow-the-Leader is the current baseline (&lt;a href="#Thmtheorem45" title="Theorem 45 (FTL Upper Bound on General Posets). ‣ Setup. ‣ Appendix H Follow-The-Leader on General Posets ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;45&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div class="ltx_pagination ltx_role_newpage"&gt;&lt;/div&gt;
&lt;/section&gt;
&lt;section id="bib" class="ltx_bibliography"&gt;
&lt;h2 class="ltx_title ltx_title_bibliography" id="references"&gt;References&lt;/h2&gt;
&lt;ul id="bib.L1" class="ltx_biblist"&gt;
&lt;li id="bib.bib9" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;V. S. Adamchik (2014)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Contributions to the theory of the Barnes function&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;International Journal of Mathematics and Computer Science&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;9&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;1&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 11–30&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;arXiv preprint math/0308086 (2003)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#Thmtheorem12.p1" title="Fact 12 (Barnes 𝐺-function asymptotic). ‣ C.3 Barnes 𝐺-function ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Fact 12&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib22" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;S. Agarwal (2014)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Surrogate regret bounds for bipartite ranking via strongly proper losses&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Journal of Machine Learning Research&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;15&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 1653–1674&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S2.SS1.p2" title="2.1 Setup ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2.1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib12" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;E. W. Barnes (1900)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;The theory of the G-function&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Quarterly Journal of Pure and Applied Mathematics&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;31&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 264–314&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#Thmtheorem12.p1" title="Fact 12 (Barnes 𝐺-function asymptotic). ‣ C.3 Barnes 𝐺-function ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Fact 12&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib26" class="ltx_bibitem ltx_bib_misc"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;B. Becker and R. Kohavi (1996)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Adult&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;UCI Machine Learning Repository&lt;a href="https://doi.org/10.24432/C5XW20" title="" class="ltx_ref ltx_href"&gt;DOI: 10.24432/C5XW20&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A1.SS2.p1" title="A.2 Real-Data Calibration ‣ Appendix A Experiments ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§A.2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib19" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;E. Berta, F. Bach, and M. I. Jordan (2024)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Classifier calibration with ROC-regularized isotonic regression&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Proceedings of the 27th International Conference on Artificial Intelligence and Statistics (AISTATS)&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_series"&gt;Proceedings of Machine Learning Research&lt;/span&gt;, Vol. &lt;span class="ltx_text ltx_bib_volume"&gt;238&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 1972–1980&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS0.SSS0.Px1.p1" title="Applications. ‣ 1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib13" class="ltx_bibitem ltx_bib_book"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;S. Boyd and L. Vandenberghe (2004)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Convex optimization&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; &lt;span class="ltx_text ltx_bib_publisher"&gt;Cambridge University Press&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_place"&gt;Cambridge&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;span class="ltx_text isbn ltx_bib_external"&gt;ISBN 9780521833783&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A8.SS0.SSS0.Px1.p5" title="Setup. ‣ Appendix H Follow-The-Leader on General Posets ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix H&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#Thmtheorem9.p1" title="Fact 9 (KKT for affine convex programs under Slater’s condition). ‣ Recall. ‣ Appendix B Block Residual Property ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Fact 9&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib1" class="ltx_bibitem ltx_bib_book"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;N. Cesa-Bianchi and G. Lugosi (2006)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Prediction, learning, and games&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; &lt;span class="ltx_text ltx_bib_publisher"&gt;Cambridge University Press&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;span class="ltx_text isbn ltx_bib_external"&gt;ISBN 9780521841085&lt;/span&gt;,
&lt;a href="https://dx.doi.org/10.1017/CBO9780511546921" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A10.SS5.p4" title="J.5 Lipschitz Losses ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§J.5&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#A6.SS1.SSS3.p4" title="F.1.3 Per-Column EW Analysis ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§F.1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#A8.SS0.SSS0.Px1.p4" title="Setup. ‣ Appendix H Follow-The-Leader on General Posets ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix H&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS0.SSS0.Px4.p1" title="Related work. ‣ 1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S2.SS1.p1" title="2.1 Setup ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2.1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib4" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;S. Chatterjee, A. Guntuboyina, and B. Sen (2018)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;On matrix estimation under monotonicity constraints&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Bernoulli&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;24&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 1072–1100&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.3150/16-BEJ865" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS0.SSS0.Px4.p1" title="Related work. ‣ 1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib20" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;M. R. Conaway, S. Dunbar, and S. D. Peddada (2004)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Designs for single- or multiple-agent phase I trials&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Biometrics&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;60&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;3&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 661–669&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1111/j.0006-341X.2004.00215.x" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS0.SSS0.Px1.p1" title="Applications. ‣ 1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib23" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;P. Gaillard and S. Gerchinovitz (2015)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;A chaining algorithm for online nonparametric regression&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Proceedings of the 28th Conference on Learning Theory (COLT)&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_series"&gt;Proceedings of Machine Learning Research&lt;/span&gt;, Vol. &lt;span class="ltx_text ltx_bib_volume"&gt;40&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 764–796&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A12.SS3.p2" title="L.3 One Scale Versus Chaining ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§L.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS0.SSS0.Px4.p1" title="Related work. ‣ 1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib8" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;R. D. Gill and B. Y. Levit (1995)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Applications of the van Trees inequality: a Bayesian Cramér–Rao bound&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Bernoulli&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;1&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;1–2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 59–79&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.2307/3318681" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS0.SSS0.Px4.p1" title="Related work. ‣ 1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S3.SS1.p2" title="3.1 Two Mechanisms ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§3.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#Thmtheorem30.p1" title="Fact 30 (Van Trees Inequality). ‣ E.2.5 Van Trees Inequality ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Fact 30&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib2" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;W. Kotłowski, W. M. Koolen, and A. Malek (2016)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Online isotonic regression&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Proceedings of the 29th Conference on Learning Theory (COLT)&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_series"&gt;Proceedings of Machine Learning Research&lt;/span&gt;, Vol. &lt;span class="ltx_text ltx_bib_volume"&gt;49&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 1165–1189&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A10.SS4.p8" title="J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§J.4&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#A10.SS5.SSS0.Px1.p4" title="Efficiency. ‣ J.5 Lipschitz Losses ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§J.5&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#A12.SS1.p2" title="L.1 The Entropy Sandwich ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§L.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS0.SSS0.Px4.p1" title="Related work. ‣ 1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p1" title="1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S2.SS3.p2" title="2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S2.SS3.p4" title="2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib3" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;W. Kotłowski, W. M. Koolen, and A. Malek (2017)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Random permutation online isotonic regression&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Advances in Neural Information Processing Systems 30 (NIPS 2017)&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_editor"&gt;I. Guyon, U. von Luxburg, S. Bengio, H. M. Wallach, R. Fergus, S. V. N. Vishwanathan, and R. Garnett (Eds.)&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 4180–4189&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS0.SSS0.Px4.p1" title="Related work. ‣ 1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p1" title="1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S6.p1" title="6 Discussion ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§6&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S6.p2" title="6 Discussion ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§6&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib25" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;P. Liautaud, P. Gaillard, and O. Wintenberger (2025a)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Minimax adaptive online nonparametric regression over Besov spaces&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Advances in Neural Information Processing Systems 38 (NeurIPS)&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A12.SS5.p4" title="L.5 Embeddings and the Smoothness Ladder ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§L.5&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#A12.SS6.p2" title="L.6 BV and Besov ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§L.6&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS0.SSS0.Px4.p1" title="Related work. ‣ 1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib24" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;P. Liautaud, P. Gaillard, and O. Wintenberger (2025b)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Minimax-optimal and locally-adaptive online nonparametric regression&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Proceedings of the 36th International Conference on Algorithmic Learning Theory (ALT)&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_series"&gt;Proceedings of Machine Learning Research&lt;/span&gt;, Vol. &lt;span class="ltx_text ltx_bib_volume"&gt;272&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A12.SS5.p4" title="L.5 Embeddings and the Smoothness Ladder ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§L.5&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#A12.SS6.p2" title="L.6 BV and Besov ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§L.6&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS0.SSS0.Px4.p1" title="Related work. ‣ 1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib7" class="ltx_bibitem ltx_bib_book"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;P. A. MacMahon (1916)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Combinatory analysis&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Vol. &lt;span class="ltx_text ltx_bib_volume"&gt;2&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_publisher"&gt;Cambridge University Press&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_place"&gt;Cambridge&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A11.SS5.p1" title="K.5 Rectangles ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§K.5&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS0.SSS0.Px4.p1" title="Related work. ‣ 1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#Thmtheorem4" title="Theorem 4 (MacMahon’s Formula (MacMahon, 1916)). ‣ 3.3 The Three Phases and the Phase Criterion ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem 4&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib10" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;G. Nemes (2014)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Error bounds and exponential improvement for the asymptotic expansion of the Barnes $G$-function&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Proceedings of the Royal Society A&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;470&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2172&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 20140534&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1098/rspa.2014.0534" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A3.SS5.p7" title="C.5 Main-Text Form ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§C.5&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib18" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;A. Niculescu-Mizil and R. Caruana (2005)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Predicting good probabilities with supervised learning&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Proceedings of the 22nd International Conference on Machine Learning (ICML)&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_place"&gt;Bonn, Germany&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 625–632&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/1102351.1102430" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS0.SSS0.Px1.p1" title="Applications. ‣ 1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib11" class="ltx_bibitem ltx_bib_misc"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;F. W. J. Olver, A. B. Olde Daalhuis, D. W. Lozier, B. I. Schneider, R. F. Boisvert, C. W. Clark, B. R. Miller, B. V. Saunders, H. S. Cohl, and M. A. McClain (2026)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;NIST Digital Library of Mathematical Functions&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;&lt;span class="ltx_ref ltx_nolink ltx_url ltx_font_typewriter ltx_ref_self"&gt;https://dlmf.nist.gov/&lt;/span&gt;, Release 1.2.7 of 2026-06-15&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A3.SS5.p7" title="C.5 Main-Text Form ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§C.5&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib16" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;A. Rakhlin and K. Sridharan (2014)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Online non-parametric regression&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Proceedings of the 27th Conference on Learning Theory (COLT)&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_series"&gt;Proceedings of Machine Learning Research&lt;/span&gt;, Vol. &lt;span class="ltx_text ltx_bib_volume"&gt;35&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 1232–1264&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A12.SS2.p1" title="L.2 Sequential Covering Numbers ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§L.2&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#A12.SS4.p2" title="L.4 The Generic Lower-Bound Route ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§L.4&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#A12.SS4.p3" title="L.4 The Generic Lower-Bound Route ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§L.4&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS0.SSS0.Px4.p1" title="Related work. ‣ 1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S2.SS2.p3" title="2.2 The Order Polynomial Is the Metric Entropy ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2.2&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S3.SS1.p1" title="3.1 Two Mechanisms ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§3.1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib6" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;R. P. Stanley (1970)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;A chromatic-like polynomial for ordered sets&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Proceedings of the Second Chapel Hill Conference on Combinatorial Mathematics and Its Applications&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_place"&gt;Chapel Hill, NC&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 421–427&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS0.SSS0.Px2.p1" title="Main results. ‣ 1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S2.SS2.p1" title="2.2 The Order Polynomial Is the Metric Entropy ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2.2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib14" class="ltx_bibitem ltx_bib_book"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;A. B. Tsybakov (2009)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Introduction to nonparametric estimation&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_series"&gt;Springer Series in Statistics&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_publisher"&gt;Springer&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_place"&gt;New York&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;span class="ltx_text isbn ltx_bib_external"&gt;ISBN 9780387790510&lt;/span&gt;,
&lt;a href="https://dx.doi.org/10.1007/978-0-387-79052-7" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A10.SS3.p5" title="J.3 Loss Substitutions in the Lower Bounds ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§J.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#A10.SS4.p6" title="J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§J.4&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#A11.SS1.p4" title="K.1 The Two Mechanisms in General Form ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§K.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#A5.SS1.SSS5.Px1.p8" title="Adversary’s strategy. ‣ E.1.5 Proof of Lemma 26 ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§E.1.5&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib15" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;V. Vovk (1998)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;A game of prediction with expert advice&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Journal of Computer and System Sciences&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;56&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 153–173&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1006/jcss.1997.1556" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A13.SS1.p2" title="M.1 The Upper End ‣ Appendix M The Phase-1 Constant ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§M.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS0.SSS0.Px4.p1" title="Related work. ‣ 1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib21" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;N. A. Wages, M. R. Conaway, and J. O’Quigley (2011)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Continual reassessment method for partial ordering&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Biometrics&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;67&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;4&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 1555–1563&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1111/j.1541-0420.2011.01560.x" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS0.SSS0.Px1.p1" title="Applications. ‣ 1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib5" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;A. C. Yao (1977)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Probabilistic computations: toward a unified measure of complexity&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;18th Annual Symposium on Foundations of Computer Science (FOCS)&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_place"&gt;Providence, RI, USA&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 222–227&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1109/SFCS.1977.24" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A5.SS1.SSS0.Px1.p1" title="Recall. ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§E.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#A5.SS2.SSS0.Px1.p1" title="Recall. ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§E.2&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S2.SS1.p1" title="2.1 Setup ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2.1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib17" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;B. Zadrozny and C. Elkan (2002)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Transforming classifier scores into accurate multiclass probability estimates&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Proceedings of the Eighth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD)&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_place"&gt;Edmonton, Alberta, Canada&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 694–699&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/775047.775151" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS0.SSS0.Px1.p1" title="Applications. ‣ 1 Introduction ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;div class="ltx_pagination ltx_role_newpage"&gt;&lt;/div&gt;
&lt;section id="A1" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="experiments"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix A &lt;/span&gt;Experiments&lt;/h2&gt;
&lt;div id="A1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We run the learners of &lt;a href="#S5" title="5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; on synthetic streams and on a real calibration task.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A1.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="synthetic-streams"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;A.1 &lt;/span&gt;Synthetic Streams&lt;/h3&gt;
&lt;div id="A1.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;a href="#A1.F3" title="In A.1 Synthetic Streams ‣ Appendix A Experiments ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Figure&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; reports the synthetic runs, every known-horizon engine at the level minimizing its bound for that horizon; the dynamic programs behind them agree with brute-force enumeration of their expert classes to within $10^{-13}$ on eight small $(m,K)$ pairs (&lt;a href="#A1.SS3" title="A.3 Correctness of the Dynamic Programs ‣ Appendix A Experiments ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;A.3&lt;/span&gt;&lt;/a&gt;). At $m=30$ both engines follow the $T^{1/3}$ reference until $T\approx m^{4}\text{;}$ beyond the transition &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; bends onto the logarithmic rate of &lt;a href="#Thmtheorem35" title="Theorem 35 (Column-Independent Upper Bound). ‣ F.1.4 Proof of Theorem 35 ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;35&lt;/span&gt;&lt;/a&gt;, while &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; stays on the cube-root envelope of (&lt;a href="#S5.E6" title="Equation 6 ‣ Theorem 5 (Surrogate Upper Bound). ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;). The paired ratio of panel (b) locates the crossover directly: near one before the transition and falling beyond it, to $0.77$ at $m=18$ and $c=T/m^{4}=10\text{.}$ Panel (c) resolves the horizon-free wrapper at $m=12\text{,}$ the rate-doubling restarts visible as steps and the full path within a factor of three of fresh known-horizon runs, consistent with the factor four of &lt;a href="#Thmtheorem6" title="Theorem 6 (Horizon-Free Polynomial-Time Rate-Optimal Algorithm). ‣ Rate-doubling wrapper. ‣ 5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;. The streams are benign, and the exponents owe nothing to adversarial labels: every upper bound is pathwise, an i.i.d. stream is among the covered sequences, and the labels inside both lower-bound constructions are themselves Bernoulli.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="A1.F3" class="ltx_figure"&gt;&lt;img style="width:100%" loading="lazy" src="figure1.svg" id="A1.F3.g1" class="ltx_graphics ltx_centering ltx_img_landscape" width="830" height="264" alt="Refer to caption"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;Figure 3: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Synthetic streams: transition, crossover, and the
horizon-free wrapper.&lt;/span&gt; Bernoulli labels with mean $f^{*}(i,j)=0.25+(i+j-2)/[4(m-1)]$ on $[m]^{2}\text{,}$ i.i.d. uniform queries, regret measured against $f^{*}\text{;}$ 100 seeds per configuration, each seed drawing both the queries and the labels; error bars $\pm 1$ SEM. (a) $m=30\text{:}$ the $\propto T^{1/3}$ reference is anchored to Surrogate TI-EW’s mean at $T=10{,}199\text{,}$ the $\propto\log T$ reference two-point anchored to Column-Ind. Chain EW’s final segment. (b) Paired per-seed ratio $R_{\mathrm{col}}/R_{\mathrm{surr}}$ of the two engines’ regrets against $c=T/m^{4}$ for $m\in\{8,12,18\}\text{.}$ (c) The horizon-free wrapper at $m=12\text{:}$ dashed verticals mark the rate-doubling restarts, crosses are fresh known-horizon runs of the better engine at each horizon, and the inset magnifies the restart at $t=12{,}880\text{,}$ where the wrapper switches from the surrogate to the column engine.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/section&gt;
&lt;section id="A1.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="real-data-calibration"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;A.2 &lt;/span&gt;Real-Data Calibration&lt;/h3&gt;
&lt;div id="A1.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The calibration experiment asks whether the two-dimensional monotone structure earns its keep on real data. A logistic model is trained on 40 percent of UCI Adult &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[Becker and Kohavi, &lt;a href="#bib.bib26" title="Adult" class="ltx_ref"&gt;1996&lt;/a&gt;]&lt;/cite&gt;, its incomplete rows discarded, with education withheld from its features, so the covariate keeps signal the model does not use; the remaining $T=27{,}134$ examples stream under squared loss on the $16\times 16$ grid formed by 16 model-score quantiles and the 16 ordinal education levels, with &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; at the discretization level minimizing (&lt;a href="#S5.E6" title="Equation 6 ‣ Theorem 5 (Surrogate Upper Bound). ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;). Margins are paired, mean $\pm$ one standard error over twenty splits and stream orders. &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; pays $2{,}975.0\pm 5.8$ in cumulative squared loss, beating the score-only calibrator (online isotonic regression on the score axis alone, the chain case of the problem) by $52.0\pm 2.8\text{,}$ and a per-cell smoothed running mean on the same grid by $31.9\pm 1.0\text{,}$ each on 20 of 20 splits; a global running mean, using neither feature, pays $5{,}057.8\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A1.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Both ingredients carry their weight: beating the score-only calibrator shows the covariate is used, and beating the per-cell mean, which sees the same two features, shows the order constraint doing work of its own. The constraint is worth more as the cells thin, and on the finest of three grids the per-cell mean has fallen behind the score-only calibrator while &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; leads both: refining the grid pays only when the order constraint is exploited. The tradeoff behind the phases is visible along the horizon. With the learners tuned to each horizon, the margin over the score-only calibrator runs $-16.0\text{,}$ $-11.3\text{,}$ $-0.2\text{,}$ $+52.0$ at $T=2{,}713\text{,}$ $6{,}783\text{,}$ $13{,}567\text{,}$ $27{,}134\text{:}$ the richer comparator class pays for its entropy first and collects afterwards, a crossover between two comparator classes.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A1.SS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Two controls pin the reading down. Shuffling the covariate within the stream destroys its signal and touches nothing else: the $+52.0$ margin flips to $-133.6\text{,}$ all twenty splits lost, so the gain is the signal. Replacing the logistic base model with gradient boosting shrinks the residual signal in the covariate, and the margin drops to $15.4\pm 2.3\text{,}$ still 19 of 20, while the margin over the per-cell mean holds at $26.6\pm 0.7$ on 20 of 20: the effect survives a stronger base model. On the $24\times 16$ grid even the horizon-free wrapper beats both baselines on 20 of 20 splits ($28.6\pm 3.1$ and $57.5\pm 1.3$), restart overhead included; on the $16\times 16$ grid that overhead measures about three percent of cumulative loss. Every margin in this paragraph is six standard errors or more.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A1.SS2.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Grid resolution.&lt;/h5&gt;
&lt;div id="A1.SS2.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Refining the score axis thins the cells and raises the value of the order constraint. Against the per-cell smoothed running mean the margin of &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; runs $+2.0\pm 0.7\text{,}$ $+31.9\pm 1.0\text{,}$ $+125.0\pm 1.0$ as the score axis refines from 12 to 16 to 24 quantiles (education pooled to 12 levels in the first case; the last is a $24\times 16$ grid), with roughly $188\text{,}$ $106\text{,}$ and $71$ observations per cell. The protocol is otherwise as above, with twenty splits and stream orders per configuration.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A1.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="correctness-of-the-dynamic-programs"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;A.3 &lt;/span&gt;Correctness of the Dynamic Programs&lt;/h3&gt;
&lt;div id="A1.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We verify the DP implementations from &lt;a href="#S5" title="5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; by directly comparing per-round predictions against brute-force enumeration. For Surrogate TI-EW, the brute force enumerates all $K$-tuples of upsets on $[m]^{2}$ ($\binom{2m}{m}^{K}$ generalized experts). For Column-Indep. Chain EW, the brute force maintains an independent exponential-weight measure on each column over the $\binom{m+K}{K}$ non-decreasing $K$-grid functions—equivalent to exponential weights over $\binom{m+K}{K}^{m}$ column-independent experts on $[m]^{2}\text{.}$ Both use standard exponential weights with $\eta=1/2$—surrogate loss for the former, squared loss for the latter.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A1.SS3.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The setup follows &lt;a href="#A1.SS1" title="A.1 Synthetic Streams ‣ Appendix A Experiments ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;A.1&lt;/span&gt;&lt;/a&gt;: Bernoulli labels with mean $f^{*}(i,j)=0.25+(i+j-2)/[4(m-1)]$ on $[m]^{2}\text{,}$ i.i.d. uniform queries, $T=200$ rounds, seed $=42\text{.}$ At each round $t\text{,}$ we compute the discrepancy $|\hat{y}_{t}^{\mathrm{DP}}-\hat{y}_{t}^{\mathrm{BF}}|$ between the DP and brute-force predictions.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A1.SS3.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;a href="#A1.T1" title="In A.3 Correctness of the Dynamic Programs ‣ Appendix A Experiments ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Table&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; reports $\max_{t}|\hat{y}_{t}^{\mathrm{DP}}-\hat{y}_{t}^{\mathrm{BF}}|$ for $8$ $(m,K)$ configurations. All values are $\leq 10^{-13}\text{;}$ the DP and brute-force predictions agree within machine precision.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="A1.T1" class="ltx_table"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_table"&gt;Table 1: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Numerical equivalence between DP and brute-force
predictions.&lt;/span&gt; $T=200$ rounds, seed $=42\text{.}$ $\max_{t}|\hat{y}_{t}^{\mathrm{DP}}-\hat{y}_{t}^{\mathrm{BF}}|$ on $8$ $(m,K)$ configurations.&lt;/figcaption&gt;
&lt;table class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle"&gt;
&lt;thead class="ltx_thead"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_th_row ltx_border_tt"&gt;$m$&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_th_row ltx_border_tt"&gt;$K$&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt"&gt;Surr. max disc&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt"&gt;Col. max disc&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody class="ltx_tbody"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_row ltx_border_t"&gt;3&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_row ltx_border_t"&gt;2&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_t"&gt;$1.33\times 10^{-15}$&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_t"&gt;$9.99\times 10^{-16}$&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_row"&gt;3&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_row"&gt;3&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center"&gt;$1.72\times 10^{-15}$&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center"&gt;$1.22\times 10^{-15}$&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_row"&gt;3&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_row"&gt;4&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center"&gt;$1.33\times 10^{-15}$&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center"&gt;$1.22\times 10^{-15}$&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_row"&gt;4&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_row"&gt;2&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center"&gt;$2.28\times 10^{-15}$&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center"&gt;$6.66\times 10^{-16}$&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_row"&gt;4&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_row"&gt;3&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center"&gt;$1.89\times 10^{-15}$&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center"&gt;$9.99\times 10^{-16}$&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_row"&gt;5&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_row"&gt;2&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center"&gt;$2.00\times 10^{-15}$&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center"&gt;$6.66\times 10^{-16}$&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_row"&gt;5&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_row"&gt;3&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center"&gt;$5.35\times 10^{-14}$&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center"&gt;$7.77\times 10^{-16}$&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_row ltx_border_bb"&gt;6&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_row ltx_border_bb"&gt;2&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb"&gt;$2.67\times 10^{-15}$&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb"&gt;$8.88\times 10^{-16}$&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/figure&gt;
&lt;section id="A1.SS3.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Code availability.&lt;/h5&gt;
&lt;div id="A1.SS3.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The complete implementation of the three algorithms, the brute-force verification harness, the calibration experiment, and the figure-generation scripts are available at &lt;a href="https://github.com/sichen-wang/Online-Isotonic-Regression_Code" title="" class="ltx_ref ltx_url ltx_font_typewriter"&gt;https://github.com/sichen-wang/Online-Isotonic-Regression_Code&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A2" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="block-residual-property"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix B &lt;/span&gt;Block Residual Property&lt;/h2&gt;
&lt;div id="A2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This appendix provides the complete proof of &lt;a href="#Thmtheorem8" title="Lemma 8 (Block Residual). ‣ Recall. ‣ Appendix B Block Residual Property ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt;. The argument proceeds in four steps: (i) a $[0,1]$-projection shows that the box-constrained and unconstrained isotonic least-squares problems share the same minimum, reducing the lemma to a statement about minimizers of the relaxed problem; (ii) a strictly feasible point built from a linear extension certifies Slater’s condition; (iii) the standard KKT theorem then yields stationarity and complementary slackness in explicit form; and (iv) summing the KKT stationarity equation over the &lt;em class="ltx_emph ltx_font_italic"&gt;complete&lt;/em&gt; level set $C_{c}$ of $f^{*}$ (which contains unqueried elements as well), interior dual multipliers cancel pairwise, boundary edges vanish by complementary slackness, and unqueried elements contribute zero (since $w_{u}=0$), yielding the Block Residual identity. The key observation is in step (iv): the summation must extend over the &lt;em class="ltx_emph ltx_font_italic"&gt;complete&lt;/em&gt; level set $C_{c}$ rather than over the queried subset $B_{c}$ alone, so that all complementary slackness relations on boundary edges are activated.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A2.SS0.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Recall.&lt;/h5&gt;
&lt;div id="A2.SS0.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We use the following notation. Let $\mathcal{F}_{\mathcal{P}}^{\uparrow}$ denote the class of $[0,1]$-valued order-preserving (isotonic) maps on a finite poset $(\mathcal{P},\preceq)$ with $n:=|\mathcal{P}|\text{.}$ Given a sequence $(x_{t},y_{t})_{t=1}^{T}\in\mathcal{P}\times[0,1]\text{,}$ let $w_{u}:=|\{t:x_{t}=u\}|$ denote the query count, set $s_{u}:=\sum_{t\,:\,x_{t}=u}y_{t}$ and $\bar{y}_{u}:=s_{u}/w_{u}$ (defined only for $w_{u}&amp;gt;0$); let $f^{*}\in\operatorname*{arg\,min}_{f\in\mathcal{F}_{\mathcal{P}}^{\uparrow}}\sum_{t=1}^{T}(f(x_{t})-y_{t})^{2}$ denote the constrained least-squares solution; let $B_{c}:=\{u\in\mathcal{P}:w_{u}&amp;gt;0,\,f^{*}(u)=c\}$ be the set of &lt;em class="ltx_emph ltx_font_italic"&gt;queried&lt;/em&gt; elements assigned value $c\text{;}$ and let $C_{c}:=\{u\in\mathcal{P}:f^{*}(u)=c\}$ be the corresponding &lt;em class="ltx_emph ltx_font_italic"&gt;complete&lt;/em&gt; level set, which includes unqueried elements (those with $w_{u}=0$). Thus $C_{c}\supseteq B_{c}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem8" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 8&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Block Residual).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem8.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $(\mathcal{P},\preceq)$ be a finite poset. Given any sequence $(x_{t},y_{t})_{t=1}^{T}\in\mathcal{P}\times[0,1]\text{,}$ let $f^{*}\in\operatorname*{arg\,min}_{f\in\mathcal{F}_{\mathcal{P}}^{\uparrow}}\sum_{t=1}^{T}(f(x_{t})-y_{t})^{2}\text{;}$ $w_{u}:=|\{t:x_{t}=u\}|\text{;}$ $\bar{y}_{u}:=w_{u}^{-1}\sum_{t:x_{t}=u}y_{t}$ (for $w_{u}&amp;gt;0$); and $B_{c}:=\{u\in\mathcal{P}:w_{u}&amp;gt;0,\,f^{*}(u)=c\}$ for each value $c$ attained by $f^{*}\text{.}$ Then $\sum_{u\in B_{c}}w_{u}(c-\bar{y}_{u})=0\text{,}$ equivalently, $\sum_{t\,:\,x_{t}\in B_{c}}(f^{*}(x_{t})-y_{t})=0\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A2.SS0.SSS0.Px1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 1 (Box-constraint reduction).&lt;/span&gt; Define the Euclidean projection $\Pi:\mathbb{R}\to[0,1]$ by $\Pi(z):=\min\{1,\max\{0,z\}\}\text{.}$ Since $\Pi$ is non-decreasing, isotonicity is preserved: if $\tilde{f}:\mathcal{P}\to\mathbb{R}$ is order-preserving, then $\Pi\circ\tilde{f}\in\mathcal{F}_{\mathcal{P}}^{\uparrow}\text{.}$ For any $y\in[0,1]$ and any $z\in\mathbb{R}\text{,}$&lt;/p&gt;
&lt;table id="A2.E9" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(\Pi(z)-y)^{2}\;\leq\;(z-y)^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(9)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;by direct case analysis on $z\text{:}$ equality holds for $z\in[0,1]\text{;}$ the inequality is immediate from $y\leq 1&amp;lt;z$ when $z&amp;gt;1\text{,}$ and follows by symmetry when $z&amp;lt;0\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.SS0.SSS0.Px1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Let $\mathcal{F}_{\mathcal{P}}^{\mathbb{R}}:=\{\tilde{f}:\mathcal{P}\to\mathbb{R}\mid u\preceq v\,\Rightarrow\,\tilde{f}(u)\leq\tilde{f}(v)\}$ denote the class of real-valued order-preserving functions (without the box constraint), and consider the &lt;em class="ltx_emph ltx_font_italic"&gt;relaxed problem&lt;/em&gt; $\min_{\tilde{f}\in\mathcal{F}_{\mathcal{P}}^{\mathbb{R}}}\sum_{t}(\tilde{f}(x_{t})-y_{t})^{2}\text{.}$ Any minimizer $\tilde{f}^{*}$ of the relaxed problem satisfies $\Pi\circ\tilde{f}^{*}\in\mathcal{F}_{\mathcal{P}}^{\uparrow}\text{,}$ and by (&lt;a href="#A2.E9" title="Equation 9 ‣ Recall. ‣ Appendix B Block Residual Property ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;9&lt;/span&gt;&lt;/a&gt;) together with $y_{t}\in[0,1]\text{,}$&lt;/p&gt;
&lt;table id="A2.Ex11" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{t}\bigl(\Pi(\tilde{f}^{*}(x_{t}))-y_{t}\bigr)^{2}\;\leq\;\sum_{t}\bigl(\tilde{f}^{*}(x_{t})-y_{t}\bigr)^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Hence the minimum over $\mathcal{F}_{\mathcal{P}}^{\uparrow}$ is no larger than that over $\mathcal{F}_{\mathcal{P}}^{\mathbb{R}}\text{;}$ the reverse inequality follows from $\mathcal{F}_{\mathcal{P}}^{\uparrow}\subseteq\mathcal{F}_{\mathcal{P}}^{\mathbb{R}}\text{,}$ so &lt;em class="ltx_emph ltx_font_italic"&gt;the two problems share the same minimum&lt;/em&gt;. Consequently, the $f^{*}$ in the lemma statement (whose loss equals this common minimum and which lies in $\mathcal{F}_{\mathcal{P}}^{\mathbb{R}}$) is also a minimizer of the relaxed problem.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.SS0.SSS0.Px1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The KKT analysis below is therefore applied to the relaxed problem; the Block Residual identity, being a statement about $f^{*}$ itself, transfers back to the original (box-constrained) setting once established for the relaxation.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.SS0.SSS0.Px1.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 2 (Convex program formulation).&lt;/span&gt; Expanding the squared sum and dropping the $f$-independent constant $\sum_{t}y_{t}^{2}\text{,}$&lt;/p&gt;
&lt;table id="A2.Ex12" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{t=1}^{T}(f(x_{t})-y_{t})^{2}\;=\;\widetilde{\Phi}(f)\,+\,\sum_{t=1}^{T}y_{t}^{2},\qquad\widetilde{\Phi}(f)\;:=\;\sum_{u\in\mathcal{P}}\bigl(w_{u}f(u)^{2}-2s_{u}f(u)\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The relaxed problem is therefore equivalent to&lt;/p&gt;
&lt;table id="A2.Ex13" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\min_{f\in\mathbb{R}^{\mathcal{P}}}\widetilde{\Phi}(f)\qquad\text{subject to}\qquad f(u)\leq f(v)\;\;\text{for all }u\prec v.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Let $E:=\{(u,v)\in\mathcal{P}^{2}:u\prec v\}\text{;}$ using all strict pairs (rather than only Hasse-diagram edges) does not affect the minimizer or the structure of the KKT analysis below. The constraint functions $g_{u,v}(f):=f(u)-f(v)\leq 0\text{,}$ $(u,v)\in E\text{,}$ are affine. Both $\widetilde{\Phi}$ and the $g_{u,v}$ are convex and differentiable.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.SS0.SSS0.Px1.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 3 (Slater’s condition and KKT).&lt;/span&gt; Let $\tau:\mathcal{P}\to\{1,\ldots,n\}$ be any linear extension of $\mathcal{P}$ (existence guaranteed by the Szpilrajn extension theorem). Setting $f_{0}(u):=\tau(u)\text{,}$ every constraint becomes strict: for each $(u,v)\in E\text{,}$&lt;/p&gt;
&lt;table id="A2.Ex14" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$g_{u,v}(f_{0})\;=\;\tau(u)-\tau(v)\;\leq\;-1\;&amp;lt;\;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Hence &lt;em class="ltx_emph ltx_font_italic"&gt;Slater’s condition is satisfied&lt;/em&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem9" class="ltx_theorem ltx_theorem_fact"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Fact 9&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (KKT for affine convex programs under Slater’s condition).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem9.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For a convex program $\min_{x\in\mathbb{R}^{d}}\Phi(x)$ subject to $g_{i}(x)\leq 0$ ($i\in I$), with $\Phi$ and $\{g_{i}\}_{i\in I}$ convex and differentiable and Slater’s condition satisfied, $x^{*}$ is a global minimizer if and only if there exist multipliers $\{\lambda_{i}\}_{i\in I}\subseteq\mathbb{R}_{+}$ such that:&lt;/p&gt;
&lt;ul id="A2.I1" class="ltx_itemize"&gt;
&lt;li id="A2.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A2.I1.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(&lt;em class="ltx_emph ltx_font_italic"&gt;stationarity&lt;/em&gt;) $\nabla\Phi(x^{*})+\sum_{i\in I}\lambda_{i}\nabla g_{i}(x^{*})=0\text{;}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A2.I1.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A2.I1.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(&lt;em class="ltx_emph ltx_font_italic"&gt;complementary slackness&lt;/em&gt;) $\lambda_{i}g_{i}(x^{*})=0$ for all $i\in I\text{;}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A2.I1.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A2.I1.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(&lt;em class="ltx_emph ltx_font_italic"&gt;primal feasibility&lt;/em&gt;) $g_{i}(x^{*})\leq 0\text{;}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A2.I1.i4" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A2.I1.i4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(&lt;em class="ltx_emph ltx_font_italic"&gt;dual feasibility&lt;/em&gt;) $\lambda_{i}\geq 0\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="ltx_p"&gt;See &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Boyd and Vandenberghe [&lt;a href="#bib.bib13" title="Convex optimization" class="ltx_ref"&gt;2004&lt;/a&gt;]&lt;/cite&gt; for a textbook treatment.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A2.SS0.SSS0.Px1.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Application to $f^{*}\text{.}$&lt;/span&gt; The component derivatives are $\partial_{u_{0}}\widetilde{\Phi}(f^{*})=2w_{u_{0}}f^{*}(u_{0})-2s_{u_{0}}$ and $\partial_{u_{0}}g_{u,v}(f^{*})=\mathbf{1}\!\left[u=u_{0}\right]-\mathbf{1}\!\left[v=u_{0}\right]\text{.}$ The stationarity equation at node $u_{0}$ reads&lt;/p&gt;
&lt;table id="A2.Ex15" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$2\bigl(w_{u_{0}}f^{*}(u_{0})-s_{u_{0}}\bigr)\,+\,\sum_{v\,:\,u_{0}\prec v}\lambda_{u_{0},v}\,-\,\sum_{u\,:\,u\prec u_{0}}\lambda_{u,u_{0}}\;=\;0,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;or equivalently,&lt;/p&gt;
&lt;table id="A2.E10" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$2\bigl(w_{u_{0}}f^{*}(u_{0})-s_{u_{0}}\bigr)\;=\;\sum_{u\,:\,u\prec u_{0}}\lambda_{u,u_{0}}\;-\;\sum_{v\,:\,u_{0}\prec v}\lambda_{u_{0},v}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(10)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Complementary slackness reads&lt;/p&gt;
&lt;table id="A2.E11" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\lambda_{u,v}\bigl(f^{*}(u)-f^{*}(v)\bigr)\;=\;0\qquad\forall\,(u,v)\in E,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(11)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;i.e., $f^{*}(u)&amp;lt;f^{*}(v)$ (strict slack) implies $\lambda_{u,v}=0\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.SS0.SSS0.Px1.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 4 (Summation over the complete level set).&lt;/span&gt; Fix any value $c$ attained by $f^{*}$ and consider the complete level set $C_{c}=\{u\in\mathcal{P}:f^{*}(u)=c\}\text{.}$ Summing (&lt;a href="#A2.E10" title="Equation 10 ‣ Recall. ‣ Appendix B Block Residual Property ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;10&lt;/span&gt;&lt;/a&gt;) over $u_{0}\in C_{c}\text{:}$&lt;/p&gt;
&lt;table id="A2.E12" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$2\sum_{u_{0}\in C_{c}}\bigl(w_{u_{0}}f^{*}(u_{0})-s_{u_{0}}\bigr)\;=\;\sum_{u_{0}\in C_{c}}\!\left[\,\sum_{u\,:\,u\prec u_{0}}\lambda_{u,u_{0}}\,-\,\sum_{v\,:\,u_{0}\prec v}\lambda_{u_{0},v}\,\right].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(12)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A2.SS0.SSS0.Px1.p9" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Edge-wise analysis of the right-hand side.&lt;/span&gt; For any edge $(a,b)\in E$ (i.e., $a\prec b$), trace the contribution of the multiplier $\lambda_{a,b}$ to the RHS of (&lt;a href="#A2.E12" title="Equation 12 ‣ Recall. ‣ Appendix B Block Residual Property ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;12&lt;/span&gt;&lt;/a&gt;):&lt;/p&gt;
&lt;ul id="A2.I2" class="ltx_itemize"&gt;
&lt;li id="A2.I2.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A2.I2.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;$\lambda_{a,b}$ appears in the inner sum
$\sum_{u\,:\,u\prec u_{0}}\lambda_{u,u_{0}}$ at $u_{0}=b$ (with
$u=a\text{,}$ coefficient $+1$); this term is included in the outer sum
if and only if $b\in C_{c}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A2.I2.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A2.I2.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;$\lambda_{a,b}$ appears in the inner sum
$\sum_{v\,:\,u_{0}\prec v}\lambda_{u_{0},v}$ at $u_{0}=a$ (with
$v=b\text{,}$ coefficient $-1$); this term is included in the outer sum
if and only if $a\in C_{c}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="ltx_p"&gt;Thus the &lt;em class="ltx_emph ltx_font_italic"&gt;net&lt;/em&gt; contribution of $\lambda_{a,b}$ to the RHS equals $\lambda_{a,b}\cdot\bigl(\mathbf{1}\!\left[b\in C_{c}\right]-\mathbf{1}\!\left[a\in C_{c}\right]\bigr)\text{.}$ We analyze the four cases by the membership of $a,b$ in $C_{c}\text{:}$&lt;/p&gt;
&lt;ul id="A2.I3" class="ltx_itemize"&gt;
&lt;li id="A2.I3.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A2.I3.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Interior edge&lt;/em&gt; ($a,b\in C_{c}$): coefficient $1-1=0\text{;}$
contribution $=0$ (interior cancellation).&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A2.I3.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A2.I3.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Boundary edge of type I&lt;/em&gt; ($a\in C_{c}\text{,}$ $b\notin C_{c}$): from
$a\prec b$ and isotonicity, $f^{*}(b)\geq f^{*}(a)=c\text{;}$ combined
with $b\notin C_{c}$ (so $f^{*}(b)\neq c$), this yields
$f^{*}(b)&amp;gt;c\text{.}$ The constraint
$g_{a,b}(f^{*})=c-f^{*}(b)&amp;lt;0$ is strictly slack, so
$\lambda_{a,b}=0$ by (&lt;a href="#A2.E11" title="Equation 11 ‣ Recall. ‣ Appendix B Block Residual Property ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;); contribution $=0\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A2.I3.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A2.I3.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Boundary edge of type II&lt;/em&gt; ($a\notin C_{c}\text{,}$ $b\in C_{c}$): by a
symmetric argument, $f^{*}(a)&amp;lt;c=f^{*}(b)$ gives a strictly slack
constraint, $\lambda_{a,b}=0\text{;}$ contribution $=0\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A2.I3.i4" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A2.I3.i4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Exterior edge&lt;/em&gt; ($a,b\notin C_{c}$): both indicators vanish, so
$\lambda_{a,b}$ does not appear in the RHS at all; contribution
$=0\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="ltx_p"&gt;These four cases exhaust all $(a,b)\in E\text{,}$ so the entire RHS of (&lt;a href="#A2.E12" title="Equation 12 ‣ Recall. ‣ Appendix B Block Residual Property ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;12&lt;/span&gt;&lt;/a&gt;) equals zero, simplifying it to&lt;/p&gt;
&lt;table id="A2.E13" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{u_{0}\in C_{c}}\bigl(w_{u_{0}}f^{*}(u_{0})-s_{u_{0}}\bigr)\;=\;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(13)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A2.SS0.SSS0.Px1.p10" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Simplifying the left-hand side.&lt;/span&gt; For $u_{0}\in C_{c}\text{,}$ $f^{*}(u_{0})=c\text{.}$ Decompose $C_{c}=B_{c}\sqcup(C_{c}\setminus B_{c})\text{:}$ for $u\in C_{c}\setminus B_{c}\text{,}$ $w_{u}=0$ by definition of $B_{c}\text{,}$ hence $s_{u}=\sum_{t\,:\,x_{t}=u}y_{t}=0$ and the contribution $w_{u}c-s_{u}$ vanishes. Substituting into (&lt;a href="#A2.E13" title="Equation 13 ‣ Recall. ‣ Appendix B Block Residual Property ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;13&lt;/span&gt;&lt;/a&gt;) yields&lt;/p&gt;
&lt;table id="A2.Ex16" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{u\in B_{c}}\bigl(w_{u}c-s_{u}\bigr)\;=\;0,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;which is exactly $\sum_{u\in B_{c}}w_{u}(c-\bar{y}_{u})=0$ (using $s_{u}=w_{u}\bar{y}_{u}$ for $u\in B_{c}$).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.SS0.SSS0.Px1.p11" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Equivalent form.&lt;/span&gt; Since $w_{u}c=c\cdot|\{t\,:\,x_{t}=u\}|=\sum_{t\,:\,x_{t}=u}c\text{,}$ $s_{u}=\sum_{t\,:\,x_{t}=u}y_{t}\text{,}$ and $f^{*}(x_{t})=c$ for $x_{t}\in B_{c}\text{,}$&lt;/p&gt;
&lt;table id="A2.Ex17" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{u\in B_{c}}w_{u}(c-\bar{y}_{u})\;=\;\sum_{u\in B_{c}}(w_{u}c-s_{u})\;=\;\sum_{t\,:\,x_{t}\in B_{c}}(c-y_{t})\;=\;\sum_{t\,:\,x_{t}\in B_{c}}\bigl(f^{*}(x_{t})-y_{t}\bigr)\;=\;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A3" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="asymptotic-analysis"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix C &lt;/span&gt;Asymptotic Analysis&lt;/h2&gt;
&lt;div id="A3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This appendix establishes the asymptotic expansions of $H_{[m]^{2}}(K)=\log\Omega([m]^{2},K{+}1)$ and $\Psi_{[m]^{2}}(T)$ that provide the technical basis for &lt;a href="#Thmtheorem14" title="Lemma 14 (Log-Order-Polynomial Asymptotic). ‣ C.5 Main-Text Form ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;14&lt;/span&gt;&lt;/a&gt; and the planar case of the three-phase scaling law (&lt;a href="#Thmtheorem3" title="Corollary 3 (Three-Phase Scaling Law). ‣ 3.3 The Three Phases and the Phase Criterion ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;). The principal tools are: (i) &lt;a href="#Thmtheorem10" title="Lemma 10 (Closed form of 𝜑). ‣ Notation. ‣ C.1 Closed Form of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;10&lt;/span&gt;&lt;/a&gt; provides a closed form for the integral $\varphi(\alpha)\text{;}$ (ii) &lt;a href="#Thmtheorem11" title="Lemma 11 (Properties of 𝜑). ‣ C.2 Properties of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmtheorem16" title="Lemma 16 (Properties of 𝜓). ‣ C.6 Properties of 𝜓 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;16&lt;/span&gt;&lt;/a&gt; consolidate the analytic properties of $\varphi$ and $\psi$ respectively; (iii) &lt;a href="#Thmtheorem12" title="Fact 12 (Barnes 𝐺-function asymptotic). ‣ C.3 Barnes 𝐺-function ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Fact&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;12&lt;/span&gt;&lt;/a&gt; recalls the standard asymptotic expansion of the Barnes $G$-function; (iv) the proof of &lt;a href="#Thmtheorem13" title="Lemma 13 (Refined Log-Order-Polynomial Asymptotic). ‣ C.4 Refined Log-Order-Polynomial Asymptotic ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;13&lt;/span&gt;&lt;/a&gt; hinges on an exact algebraic identity—$\log\Omega$ admits a five-term linear combination of Barnes $G$-values whose construction precisely cancels the quadratic and linear coefficients of the asymptotic expansion, leaving only the main term $m^{2}\,\varphi(K/m)\text{,}$ a logarithmic correction, and an absolute constant; (v) &lt;a href="#Thmtheorem17" title="Theorem 17 (Asymptotic of Ψ). ‣ C.7 Asymptotic of Ψ ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;17&lt;/span&gt;&lt;/a&gt; combines error propagation with an integer-to-continuum discretization estimate to establish $\Psi_{[m]^{2}}(T)=m^{2}\,\psi(T/m^{4})+O(m)$ as $T/m\to\infty\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A3.SS0.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Recall.&lt;/h5&gt;
&lt;div id="A3.SS0.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;By &lt;a href="#Thmtheorem4" title="Theorem 4 (MacMahon’s Formula (MacMahon, 1916)). ‣ 3.3 The Three Phases and the Phase Criterion ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;, $\Omega([m]^{2},K{+}1)=\prod_{i=1}^{m}\prod_{j=1}^{m}\frac{K+i+j-1}{i+j-1}\text{,}$ and $\varphi$ denotes&lt;/p&gt;
&lt;table id="A3.E14" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\varphi(\alpha)\;:=\;\int_{0}^{1}\int_{0}^{1}\log\!\left(1+\frac{\alpha}{s+t}\right)ds\,dt,\qquad\alpha\geq 0,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(14)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;throughout this appendix.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A3.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="closed-form-of-varphi"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;C.1 &lt;/span&gt;Closed Form of $\varphi$
&lt;/h3&gt;
&lt;section id="A3.SS1.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Notation.&lt;/h5&gt;
&lt;div id="A3.SS1.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Let $A(x):=\tfrac{x^{2}}{2}\log x$ (with $A(0):=0\text{,}$ by $\lim_{x\to 0^{+}}x^{2}\log x=0$). By integration by parts, $\int x\log x\,dx=A(x)-x^{2}/4\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem10" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 10&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Closed form of $\varphi$).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem10.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For all $\alpha\geq 0\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A3.Ex18" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\varphi(\alpha)\;=\;A(\alpha+2)-2A(\alpha+1)+A(\alpha)\;-\;2\log 2.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A3.SS1.SSS0.Px1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Inner integral.&lt;/span&gt; For $c\geq 0\text{,}$&lt;/p&gt;
&lt;table id="A3.Ex19" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\int_{0}^{1}\log(c+t)\,dt\;=\;\bigl[(c+t)\log(c+t)-(c+t)\bigr]_{t=0}^{t=1}\;=\;(c+1)\log(c+1)-c\log c-1$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;(with the convention $0\cdot\log 0:=0$). Expanding $\log(1+\alpha/(s+t))=\log(\alpha+s+t)-\log(s+t)$ and integrating over $t\text{,}$ the two $-1$ constants cancel:&lt;/p&gt;
&lt;table id="A3.E15" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\int_{0}^{1}\log\!\left(1+\frac{\alpha}{s+t}\right)dt\;=\;F(\alpha+s)-F(s),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(15)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where $F(c):=(c+1)\log(c+1)-c\log c\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS1.SSS0.Px1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Outer integral.&lt;/span&gt; Integrate each summand resulting from $F(\alpha+s)-F(s)$ over $s\text{.}$ Using $\int x\log x\,dx=A(x)-x^{2}/4\text{,}$&lt;/p&gt;
&lt;table id="A3.Ex20" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\int_{0}^{1}(c+s)\log(c+s)\,ds\;=\;\bigl[A(c+s)-\tfrac{(c+s)^{2}}{4}\bigr]_{s=0}^{s=1}\;=\;A(c+1)-A(c)-\tfrac{2c+1}{4}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Integrating (&lt;a href="#A3.E15" title="Equation 15 ‣ Notation. ‣ C.1 Closed Form of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;15&lt;/span&gt;&lt;/a&gt;) over $s$—substituting $c=\alpha+1$ and $c=\alpha$ for the two summands of $F(\alpha+s)\text{,}$ and $c=1$ and $c=0$ for those of $F(s)\text{,}$ giving four terms in total—and collecting the $A$-terms and fractional terms,&lt;/p&gt;
&lt;table id="A3.Ex21" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\varphi(\alpha)\;=\;\bigl[A(\alpha+2)-2A(\alpha+1)+A(\alpha)\bigr]\;-\;\bigl[A(2)-2A(1)+A(0)\bigr]\;+\;\Delta,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where $\Delta$ collects the four $-(2c+1)/4$ contributions (with $c=\alpha+1,\alpha,1,0$ and coefficients $+1,-1,-1,+1$):&lt;/p&gt;
&lt;table id="A3.Ex22" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Delta\;=\;\frac{-(2\alpha+3)+(2\alpha+1)+3-1}{4}\;=\;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Substituting $A(2)=2\log 2$ and $A(1)=A(0)=0$ yields the claimed identity.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A3.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="properties-of-varphi"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;C.2 &lt;/span&gt;Properties of $\varphi$
&lt;/h3&gt;
&lt;div id="Thmtheorem11" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 11&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Properties of $\varphi$).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem11.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;The function $\varphi:[0,\infty)\to[0,\infty)$ satisfies the following:&lt;/span&gt;&lt;/p&gt;
&lt;ol id="A3.I1" class="ltx_enumerate"&gt;
&lt;li id="A3.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(a)&lt;/span&gt;
&lt;div id="A3.I1.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Continuity)&lt;span class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;$\varphi$&lt;span class="ltx_text ltx_font_italic"&gt; is continuous on
&lt;/span&gt;$[0,\infty)$&lt;span class="ltx_text ltx_font_italic"&gt;, with &lt;/span&gt;$\varphi(0)=0$&lt;span class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A3.I1.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(b)&lt;/span&gt;
&lt;div id="A3.I1.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Monotonicity)&lt;span class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;$\varphi$&lt;span class="ltx_text ltx_font_italic"&gt; is strictly increasing on
&lt;/span&gt;$[0,\infty)$&lt;span class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A3.I1.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(c)&lt;/span&gt;
&lt;div id="A3.I1.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Concavity)&lt;span class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;$\varphi$&lt;span class="ltx_text ltx_font_italic"&gt; is strictly concave on
&lt;/span&gt;$[0,\infty)$&lt;span class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A3.I1.i4" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(d)&lt;/span&gt;
&lt;div id="A3.I1.i4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Bound near zero)&lt;span class="ltx_text ltx_font_italic"&gt;
&lt;/span&gt;$\varphi(\alpha)\leq 2(\log 2)\,\alpha$&lt;span class="ltx_text ltx_font_italic"&gt; for all &lt;/span&gt;$\alpha\geq 0$&lt;span class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A3.I1.i5" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(e)&lt;/span&gt;
&lt;div id="A3.I1.i5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Logarithmic bound)&lt;span class="ltx_text ltx_font_italic"&gt;
&lt;/span&gt;$\varphi(\alpha)\leq\log\alpha+2$&lt;span class="ltx_text ltx_font_italic"&gt; for all &lt;/span&gt;$\alpha\geq 1/2$&lt;span class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A3.I1.i6" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(f)&lt;/span&gt;
&lt;div id="A3.I1.i6.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Divergence)&lt;span class="ltx_text ltx_font_italic"&gt;
&lt;/span&gt;$\varphi(\alpha)\geq\log(1+\alpha/2)$&lt;span class="ltx_text ltx_font_italic"&gt; for all &lt;/span&gt;$\alpha\geq 0$&lt;span class="ltx_text ltx_font_italic"&gt;;
in particular &lt;/span&gt;$\varphi(\alpha)\to\infty$&lt;span class="ltx_text ltx_font_italic"&gt; as &lt;/span&gt;$\alpha\to\infty$&lt;span class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A3.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(a).&lt;/span&gt; By the closed form in &lt;a href="#Thmtheorem10" title="Lemma 10 (Closed form of 𝜑). ‣ Notation. ‣ C.1 Closed Form of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;10&lt;/span&gt;&lt;/a&gt; and the continuity of $A$ on $[0,\infty)$ (with $A(0)=0$), $\varphi$ is continuous on $[0,\infty)\text{.}$ Substituting $\alpha=0$ yields $\varphi(0)=A(2)-2A(1)+A(0)-2\log 2=0\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(b), (c).&lt;/span&gt; By the integral representation, for $\alpha&amp;gt;0$ differentiation under the integral sign is legitimate (on any compact sub-interval $[\alpha_{0},\alpha_{1}]\subset(0,\infty)\text{,}$ the integrand and its $\alpha$-partial derivative are uniformly dominated by an integrable function):&lt;/p&gt;
&lt;table id="A3.Ex23" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\varphi^{\prime}(\alpha)\;=\;\int_{0}^{1}\int_{0}^{1}\frac{ds\,dt}{\alpha+s+t}\;&amp;gt;\;0,\qquad\varphi^{\prime\prime}(\alpha)\;=\;-\int_{0}^{1}\int_{0}^{1}\frac{ds\,dt}{(\alpha+s+t)^{2}}\;&amp;lt;\;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Hence $\varphi$ is strictly increasing and strictly concave on $(0,\infty)\text{;}$ continuity extends both properties to $[0,\infty)\text{.}$ As $\alpha\downarrow 0$ the integrand $(\alpha+s+t)^{-1}$ increases pointwise to $(s+t)^{-1}\text{,}$ so by monotone convergence&lt;/p&gt;
&lt;table id="A3.E16" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\lim_{\alpha\downarrow 0}\varphi^{\prime}(\alpha)\;=\;\int_{0}^{1}\int_{0}^{1}\frac{ds\,dt}{s+t}\;=\;2\log 2,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(16)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;whence $\varphi^{\prime}$ extends continuously to $[0,\infty)$ with $\varphi^{\prime}(0)=2\log 2\text{;}$ since $\varphi$ is continuous at $0\text{,}$ the mean value theorem identifies this limit with the right derivative of $\varphi$ there.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(d).&lt;/span&gt; Since $\log(1+x)\leq x$ for $x\geq 0\text{,}$&lt;/p&gt;
&lt;table id="A3.Ex24" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\varphi(\alpha)\;\leq\;\alpha\int_{0}^{1}\int_{0}^{1}\frac{ds\,dt}{s+t}\;=\;2(\log 2)\,\alpha.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A3.SS2.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(e).&lt;/span&gt; Define $g(\alpha):=\log\alpha+2-\varphi(\alpha)$ for $\alpha&amp;gt;0\text{.}$ Then $g^{\prime}(\alpha)=1/\alpha-\varphi^{\prime}(\alpha)\text{.}$ Since $s+t&amp;gt;0$ almost everywhere on $(0,1]^{2}\text{,}$&lt;/p&gt;
&lt;table id="A3.Ex25" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\varphi^{\prime}(\alpha)\;=\;\int_{0}^{1}\int_{0}^{1}\frac{ds\,dt}{\alpha+s+t}\;&amp;lt;\;\int_{0}^{1}\int_{0}^{1}\frac{ds\,dt}{\alpha}\;=\;\frac{1}{\alpha},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;so $g^{\prime}(\alpha)&amp;gt;0$ and $g$ is strictly increasing on $(0,\infty)\text{.}$ At $\alpha=1/2\text{,}$ part (d) gives $\varphi(1/2)\leq 2(\log 2)(1/2)=\log 2\text{,}$ hence&lt;/p&gt;
&lt;table id="A3.Ex26" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$g(1/2)\;=\;\log(1/2)+2-\varphi(1/2)\;\geq\;-\log 2+2-\log 2\;=\;2-2\log 2\;&amp;gt;\;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Since $g$ is increasing, $g(\alpha)\geq g(1/2)&amp;gt;0$ for all $\alpha\geq 1/2\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS2.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(f).&lt;/span&gt; Since $s+t\leq 2$ on $[0,1]^{2}\text{,}$ the integrand obeys $\log(1+\alpha/(s+t))\geq\log(1+\alpha/2)$ pointwise, so&lt;/p&gt;
&lt;table id="A3.Ex27" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\varphi(\alpha)\;\geq\;\int_{0}^{1}\int_{0}^{1}\log\Bigl(1+\frac{\alpha}{2}\Bigr)\,ds\,dt\;=\;\log\Bigl(1+\frac{\alpha}{2}\Bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;which diverges as $\alpha\to\infty\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A3.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="barnes-g-function"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;C.3 &lt;/span&gt;Barnes $G$-function&lt;/h3&gt;
&lt;div id="A3.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The following asymptotic expansion of the Barnes $G$-function is the main tool for &lt;a href="#Thmtheorem13" title="Lemma 13 (Refined Log-Order-Polynomial Asymptotic). ‣ C.4 Refined Log-Order-Polynomial Asymptotic ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;13&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem12" class="ltx_theorem ltx_theorem_fact"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Fact 12&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Barnes $G$-function asymptotic).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem12.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The Barnes $G$-function satisfies $G(1)=G(2)=1\text{,}$ the recurrence $G(z+1)=\Gamma(z)\,G(z)$ for $z&amp;gt;0\text{,}$ and $\log G(n+1)=\sum_{j=1}^{n}\log\Gamma(j)$ for every positive integer $n\text{.}$ As $z\to+\infty\text{,}$&lt;/p&gt;
&lt;table id="A3.E17" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log G(z+1)\;=\;\tfrac{z^{2}}{2}\log z\,-\,\tfrac{3z^{2}}{4}\,+\,\tfrac{z}{2}\log(2\pi)\,-\,\tfrac{1}{12}\log z\,+\,\zeta^{\prime}(-1)\,+\,O(1/z^{2}),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(17)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where $\zeta^{\prime}(-1)=\frac{d}{ds}\zeta(s)\big|_{s=-1}$ denotes the derivative of the Riemann zeta function at $s=-1$ &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[Barnes, &lt;a href="#bib.bib12" title="The theory of the G-function" class="ltx_ref"&gt;1900&lt;/a&gt;, Adamchik, &lt;a href="#bib.bib9" title="Contributions to the theory of the Barnes function" class="ltx_ref"&gt;2014&lt;/a&gt;]&lt;/cite&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A3.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="refined-log-order-polynomial-asymptotic"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;C.4 &lt;/span&gt;Refined Log-Order-Polynomial Asymptotic&lt;/h3&gt;
&lt;div id="Thmtheorem13" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 13&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Refined Log-Order-Polynomial Asymptotic).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem13.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For all integers $m,K\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A3.E18" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H_{[m]^{2}}(K)\;=\;m^{2}\,\varphi(K/m)\,-\,\tfrac{1}{12}\log\frac{mK(K+2m)}{2(K+m)^{2}}\,+\,O(1),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(18)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;where the $O(1)$ term is uniformly bounded over $m,K\geq 1\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A3.SS4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The proof proceeds in three steps; throughout, abbreviate $\log\Omega:=\log\Omega([m]^{2},K{+}1)=H_{[m]^{2}}(K)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 1 (Barnes $G$ representation).&lt;/span&gt; By &lt;a href="#Thmtheorem4" title="Theorem 4 (MacMahon’s Formula (MacMahon, 1916)). ‣ 3.3 The Three Phases and the Phase Criterion ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;,&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A13.EGx1"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.Ex28"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.Ex29"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle\log\Omega &amp;amp; \displaystyle=\sum_{i=1}^{m}\sum_{j=1}^{m}\bigl[\log(K+i+j-1)-\log(i+j-1)\bigr] \\
&amp;amp; \displaystyle=\sum_{i=1}^{m}\bigl[\log\Gamma(K+i+m)-\log\Gamma(K+i)-\log\Gamma(i+m)+\log\Gamma(i)\bigr],
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;where the inner sum over $j$ telescopes via $\sum_{j=1}^{m}\log(N+j)=\log\Gamma(N+m+1)-\log\Gamma(N+1)\text{.}$ Define&lt;/p&gt;
&lt;table id="A3.Ex30" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$S(N)\;:=\;\sum_{i=1}^{m}\log\Gamma(N+i)\;=\;\sum_{j=N+1}^{N+m}\log\Gamma(j).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;By &lt;a href="#Thmtheorem12" title="Fact 12 (Barnes 𝐺-function asymptotic). ‣ C.3 Barnes 𝐺-function ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Fact&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;12&lt;/span&gt;&lt;/a&gt;, $\log G(n+1)=\sum_{j=1}^{n}\log\Gamma(j)$ for every positive integer $n\text{,}$ so&lt;/p&gt;
&lt;table id="A3.E19" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$S(N)\;=\;\log G(N+m+1)-\log G(N+1).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(19)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Since $\log\Omega=[S(K+m)-S(K)]-[S(m)-S(0)]\text{,}$ expanding (&lt;a href="#A3.E19" title="Equation 19 ‣ C.4 Refined Log-Order-Polynomial Asymptotic ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;19&lt;/span&gt;&lt;/a&gt;) gives&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A13.EGx2"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.Ex31"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.Ex32"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle S(K+m)-S(K) &amp;amp; \displaystyle=\log G(K+2m+1)-2\log G(K+m+1)+\log G(K+1), \\
\displaystyle S(m)-S(0) &amp;amp; \displaystyle=\log G(2m+1)-2\log G(m+1).
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;Subtracting,&lt;/p&gt;
&lt;table id="A3.E20" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log\Omega\;=\;\log G(K{+}2m{+}1)-2\log G(K{+}m{+}1)+\log G(K{+}1)-\log G(2m{+}1)+2\log G(m{+}1).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(20)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A3.SS4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 2 (Apply Barnes $G$ asymptotic).&lt;/span&gt; Apply the asymptotic expansion (&lt;a href="#A3.E17" title="Equation 17 ‣ Fact 12 (Barnes 𝐺-function asymptotic). ‣ C.3 Barnes 𝐺-function ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;17&lt;/span&gt;&lt;/a&gt;) of &lt;a href="#Thmtheorem12" title="Fact 12 (Barnes 𝐺-function asymptotic). ‣ C.3 Barnes 𝐺-function ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Fact&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;12&lt;/span&gt;&lt;/a&gt; to each term $\log G(z_{i}+1)$ in (&lt;a href="#A3.E20" title="Equation 20 ‣ C.4 Refined Log-Order-Polynomial Asymptotic ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;20&lt;/span&gt;&lt;/a&gt;), where&lt;/p&gt;
&lt;table id="A3.Ex33" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$z_{1}:=K+2m,\qquad z_{2}:=K+m,\qquad z_{3}:=K,\qquad z_{4}:=2m,\qquad z_{5}:=m,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;with coefficients $c:=(+1,-2,+1,-1,+2)\text{.}$ Aggregating term by term:&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS4.p4" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;$z^{2}$&lt;span class="ltx_text ltx_font_bold"&gt; coefficient.&lt;/span&gt;
$\sum_{i}c_{i}z_{i}^{2}=(K+2m)^{2}-2(K+m)^{2}+K^{2}-(2m)^{2}+2m^{2}=K^{2}+4Km+4m^{2}-2K^{2}-4Km-2m^{2}+K^{2}-4m^{2}+2m^{2}=0\text{.}$ Hence the $-\tfrac{3}{4}z^{2}$ contribution vanishes exactly; the $\tfrac{z^{2}}{2}\log z$ contribution is handled in Step 3.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS4.p5" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;$z$&lt;span class="ltx_text ltx_font_bold"&gt; coefficient.&lt;/span&gt;
$\sum_{i}c_{i}z_{i}=(K+2m)-2(K+m)+K-2m+2m=0\text{.}$ Hence the $\tfrac{z}{2}\log(2\pi)$ contribution vanishes exactly.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS4.p6" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Constant coefficient.&lt;/span&gt;
$\sum_{i}c_{i}=1\text{.}$ Hence the $\zeta^{\prime}(-1)$ terms aggregate to $\zeta^{\prime}(-1)\text{,}$ an absolute constant.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS4.p7" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Logarithmic coefficient.&lt;/span&gt;
$\sum_{i}c_{i}\log z_{i}=\log\bigl[mK(K+2m)/\bigl(2(K+m)^{2}\bigr)\bigr]\text{,}$ so $-\tfrac{1}{12}\sum_{i}c_{i}\log z_{i}=-\tfrac{1}{12}\log\frac{mK(K+2m)}{2(K+m)^{2}}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS4.p8" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Main term.&lt;/span&gt;
The identity $\sum_{i}c_{i}A(z_{i})=m^{2}\,\varphi(K/m)$ is established in Step 3.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS4.p9" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Remainder.&lt;/span&gt;
The $\sum_{i}c_{i}\cdot O(1/z_{i}^{2})$ contributions sum to $O(1/\min(m,K)^{2})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS4.p10" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;Combining the above contributions,&lt;/p&gt;
&lt;table id="A3.Ex34" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log\Omega\;=\;m^{2}\,\varphi(K/m)\,-\,\tfrac{1}{12}\log\frac{mK(K+2m)}{2(K+m)^{2}}\,+\,\zeta^{\prime}(-1)\,+\,O\bigl(1/\min(m,K)^{2}\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Since $\zeta^{\prime}(-1)$ is an absolute constant, absorbing all $O(1)$ contributions yields (&lt;a href="#A3.E18" title="Equation 18 ‣ Lemma 13 (Refined Log-Order-Polynomial Asymptotic). ‣ C.4 Refined Log-Order-Polynomial Asymptotic ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;18&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS4.p11" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 3 ($\sum_{i}c_{i}A(z_{i})=m^{2}\,\varphi(K/m)\text{:}$ an exact identity).&lt;/span&gt; From the scaling $A(cx)=c^{2}\,A(x)+\tfrac{(cx)^{2}}{2}\log c$ (for $c,x&amp;gt;0$), taking $c=m$ yields&lt;/p&gt;
&lt;table id="A3.Ex35" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$A(K+km)\;=\;m^{2}\,A\!\left(\tfrac{K}{m}+k\right)\,+\,\tfrac{(K+km)^{2}}{2}\log m,\qquad k=0,1,2.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Forming the linear combination with coefficients $+1,-2,+1$ for $k=2,1,0$ respectively,&lt;/p&gt;
&lt;table id="A3.E21" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$A(K+2m)-2A(K+m)+A(K)\;=\;m^{2}\bigl[A(K/m+2)-2A(K/m+1)+A(K/m)\bigr]\,+\,m^{2}\log m,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(21)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where the coefficient of $\log m$ is $[(K+2m)^{2}-2(K+m)^{2}+K^{2}]/2=m^{2}\text{.}$ Similarly, $A(2m)-2A(m)=2m^{2}\log(2m)-m^{2}\log m=2m^{2}\log 2+m^{2}\log m\text{.}$ Subtracting and applying &lt;a href="#Thmtheorem10" title="Lemma 10 (Closed form of 𝜑). ‣ Notation. ‣ C.1 Closed Form of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;10&lt;/span&gt;&lt;/a&gt; (the closed form of $\varphi$),&lt;/p&gt;
&lt;table id="A3.E22" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\begin{split}\sum_{i}c_{i}A(z_{i})&amp;amp;=\bigl[A(K+2m)-2A(K+m)+A(K)\bigr]-\bigl[A(2m)-2A(m)\bigr]\\ &amp;amp;=m^{2}\bigl[A(K/m+2)-2A(K/m+1)+A(K/m)-2\log 2\bigr]\\ &amp;amp;=m^{2}\,\varphi(K/m).\end{split}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A3.SS5" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="main-text-form"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;C.5 &lt;/span&gt;Main-Text Form&lt;/h3&gt;
&lt;div id="Thmtheorem14" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 14&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Log-Order-Polynomial Asymptotic).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem14.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For all integers $m\geq 2$ and $K\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A3.Ex36" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H_{[m]^{2}}(K)\;=\;m^{2}\,\varphi(K/m)\;+\;O(\log m),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;with the $O(\log m)$ error uniform in $K\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A3.SS5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;By &lt;a href="#Thmtheorem13" title="Lemma 13 (Refined Log-Order-Polynomial Asymptotic). ‣ C.4 Refined Log-Order-Polynomial Asymptotic ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;13&lt;/span&gt;&lt;/a&gt;, it suffices to show that the correction term $-\tfrac{1}{12}\log\frac{mK(K+2m)}{2(K+m)^{2}}$ is uniformly $O(\log m)$ over $m\geq 2$ and $K\geq 1\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS5.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Upper bound.&lt;/span&gt; From $(K+m)^{2}-K(K+2m)=m^{2}\geq 0\text{,}$ we have $K(K+2m)\leq(K+m)^{2}\text{,}$ hence&lt;/p&gt;
&lt;table id="A3.Ex37" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{mK(K+2m)}{2(K+m)^{2}}\;\leq\;\frac{m}{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A3.SS5.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lower bound.&lt;/span&gt; Rewriting the ratio as $\tfrac{m}{2}\bigl(1-m^{2}/(K+m)^{2}\bigr)$ and using $(K+m)^{2}\geq(1+m)^{2}$ for $m\geq 2\text{,}$ $K\geq 1\text{,}$&lt;/p&gt;
&lt;table id="A3.Ex38" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{mK(K+2m)}{2(K+m)^{2}}\;\geq\;\frac{m}{2}\cdot\frac{(1+m)^{2}-m^{2}}{(1+m)^{2}}\;=\;\frac{m(2m+1)}{2(1+m)^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;For $m\geq 2\text{,}$ $m(2m+1)-(m+1)^{2}=m^{2}-m-1\geq 0\text{,}$ so $\frac{mK(K+2m)}{2(K+m)^{2}}\geq\frac{1}{2}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS5.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Combining the two bounds, $1/2\leq\frac{mK(K+2m)}{2(K+m)^{2}}\leq m/2\text{,}$ so $\log\frac{mK(K+2m)}{2(K+m)^{2}}\in[-\log 2,\,\log(m/2)]\text{,}$ whose absolute value is at most $\max\{\log 2,\log(m/2)\}\leq\log m$ (for $m\geq 2\text{,}$ both $\log 2\leq\log m$ and $\log(m/2)\leq\log m$). Therefore $\bigl|\tfrac{1}{12}\log\frac{mK(K+2m)}{2(K+m)^{2}}\bigr|\leq\tfrac{1}{12}\log m=O(\log m)\text{,}$ uniformly in $K\text{.}$ The $O(1)$ term in &lt;a href="#Thmtheorem13" title="Lemma 13 (Refined Log-Order-Polynomial Asymptotic). ‣ C.4 Refined Log-Order-Polynomial Asymptotic ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;13&lt;/span&gt;&lt;/a&gt; is also $O(\log m)\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A3.SS5.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Combined with &lt;a href="#Thmtheorem68" title="Proposition 68 (Entropy Equivalence). ‣ L.1 The Entropy Sandwich ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;68&lt;/span&gt;&lt;/a&gt;, the lemma is the planar entropy law in closed form: $\log N_{\infty}(\varepsilon,\mathcal{F}_{[m]^{2}}^{\uparrow})=m^{2}\,\varphi\bigl(\tfrac{1}{2m\varepsilon}\bigr)+O(m)$ for $0&amp;lt;\varepsilon&amp;lt;\tfrac{1}{2}\text{,}$ the error absorbing the one-step gap between $K_{-}$ and $K_{+}$ through the bounded derivative of $\varphi\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem15" class="ltx_theorem ltx_theorem_corollary"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Corollary 15&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Quantitative refinement of &lt;a href="#Thmtheorem14" title="Lemma 14 (Log-Order-Polynomial Asymptotic). ‣ C.5 Main-Text Form ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;14&lt;/span&gt;&lt;/a&gt;).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem15.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;There exists an absolute constant $C_{1}\geq 0$ (and one may take $C_{1}\leq 1$) such that, for all integers $m\geq 2$ and $K\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A3.Ex39" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\bigl|H_{[m]^{2}}(K)-m^{2}\,\varphi(K/m)\bigr|\;\leq\;\tfrac{1}{12}\log m+C_{1}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A3.SS5.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;By &lt;a href="#Thmtheorem13" title="Lemma 13 (Refined Log-Order-Polynomial Asymptotic). ‣ C.4 Refined Log-Order-Polynomial Asymptotic ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;13&lt;/span&gt;&lt;/a&gt;, $H_{[m]^{2}}(K)-m^{2}\,\varphi=-\tfrac{1}{12}\log\frac{mK(K+2m)}{2(K+m)^{2}}+E\text{,}$ where $|E|\leq C_{1}^{*}$ uniformly over $m,K\geq 1$ for some absolute constant $C_{1}^{*}\geq 0\text{.}$ The proof of &lt;a href="#Thmtheorem14" title="Lemma 14 (Log-Order-Polynomial Asymptotic). ‣ C.5 Main-Text Form ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;14&lt;/span&gt;&lt;/a&gt; above established $\bigl|\tfrac{1}{12}\log\frac{mK(K+2m)}{2(K+m)^{2}}\bigr|\leq\tfrac{1}{12}\log m$ for $m\geq 2\text{,}$ $K\geq 1\text{.}$ Combining, $|H_{[m]^{2}}(K)-m^{2}\,\varphi|\leq\tfrac{1}{12}\log m+C_{1}^{*}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS5.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Bounding $C_{1}^{*}\text{.}$&lt;/span&gt; From the aggregation in Step 2 of the proof of &lt;a href="#Thmtheorem13" title="Lemma 13 (Refined Log-Order-Polynomial Asymptotic). ‣ C.4 Refined Log-Order-Polynomial Asymptotic ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;13&lt;/span&gt;&lt;/a&gt;, $E=\zeta^{\prime}(-1)+R\text{,}$ where $|\zeta^{\prime}(-1)|&amp;lt;1/6$ (the standard value is $\zeta^{\prime}(-1)\approx-0.1654$) and $R=\sum_{i=1}^{5}c_{i}\,\mathrm{tail}(z_{i})$ with $z_{i}\in\{K,\,K{+}m,\,K{+}2m,\,m,\,2m\}\text{,}$ $c_{i}=(+1,-2,+1,-1,+2)\text{,}$ and $\sum_{i}|c_{i}|=7\text{.}$ The remainder in (&lt;a href="#A3.E17" title="Equation 17 ‣ Fact 12 (Barnes 𝐺-function asymptotic). ‣ C.3 Barnes 𝐺-function ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;17&lt;/span&gt;&lt;/a&gt;) is the sum of the tails of the two classical series behind it, Binet’s for $z\log\Gamma(z+1)$ &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[Olver&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt;, &lt;a href="#bib.bib11" title="NIST Digital Library of Mathematical Functions" class="ltx_ref"&gt;2026&lt;/a&gt;, §5.11(ii)]&lt;/cite&gt; and Barnes’s own for the rest &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[Nemes, &lt;a href="#bib.bib10" title="Error bounds and exponential improvement for the asymptotic expansion of the Barnes G-function" class="ltx_ref"&gt;2014&lt;/a&gt;, Thm. 1.2]&lt;/cite&gt;; on the positive real axis each carries the sign of its first omitted term and is smaller in magnitude. Those first omitted terms are $B_{4}/(12z^{2})$ and $B_{4}/(24z^{2})\text{,}$ so&lt;/p&gt;
&lt;table id="A3.Ex40" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\lvert\mathrm{tail}(z)\rvert\;\leq\;\frac{|B_{4}|}{8z^{2}}\;=\;\frac{1}{240z^{2}}\;\leq\;\frac{1}{100}\qquad(z\geq 1);$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;at $z=1$ the remainder is exactly $\tfrac{3}{4}-\tfrac{1}{2}\log(2\pi)-\zeta^{\prime}(-1)=-0.00352\ldots$ Hence $|R|\leq 7\cdot(1/100)=7/100\text{,}$ so $C_{1}^{*}\leq|\zeta^{\prime}(-1)|+|R|&amp;lt;1/6+7/100&amp;lt;1/4\leq 1\text{.}$ Setting $C_{1}:=1$ completes the proof.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A3.SS6" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="properties-of-psi"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;C.6 &lt;/span&gt;Properties of $\psi$
&lt;/h3&gt;
&lt;div id="A3.SS6.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Recall the function&lt;/p&gt;
&lt;table id="A3.Ex41" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\psi(c)\;:=\;\inf_{\alpha&amp;gt;0}\Bigl[2\varphi(\alpha)+\tfrac{c}{4\alpha^{2}}\Bigr],\qquad c&amp;gt;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem16" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 16&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Properties of $\psi$).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem16.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;The function $\psi:(0,\infty)\to(0,\infty)$ satisfies the following:&lt;/span&gt;&lt;/p&gt;
&lt;ol id="A3.I2" class="ltx_enumerate"&gt;
&lt;li id="A3.I2.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(a)&lt;/span&gt;
&lt;div id="A3.I2.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Lower bound)&lt;span class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;$\psi(c)\geq 2\varphi(1)\cdot\min(c^{1/3},1)$&lt;span class="ltx_text ltx_font_italic"&gt; for all &lt;/span&gt;$c&amp;gt;0$&lt;span class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A3.I2.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(b)&lt;/span&gt;
&lt;div id="A3.I2.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Small-$c$ asymptotic)&lt;span class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;$\psi(c)=3(\log 2)^{2/3}\,c^{1/3}\,(1+o(1))$&lt;span class="ltx_text ltx_font_italic"&gt; as &lt;/span&gt;$c\to 0^{+}$&lt;span class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A3.I2.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(c)&lt;/span&gt;
&lt;div id="A3.I2.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Large-$c$ asymptotic)&lt;span class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;$\psi(c)=\log c+O(1)$&lt;span class="ltx_text ltx_font_italic"&gt;
as &lt;/span&gt;$c\to\infty$&lt;span class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A3.SS6.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Let $F(\alpha):=2\varphi(\alpha)+c/(4\alpha^{2})\text{,}$ so that $\psi(c)=\inf_{\alpha&amp;gt;0}F(\alpha)\text{.}$ Since $F$ is continuous on $(0,\infty)\text{,}$ blows up at $0$ through the penalty term, and diverges at infinity by &lt;a href="#Thmtheorem11" title="Lemma 11 (Properties of 𝜑). ‣ C.2 Properties of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;(f), the infimum is attained on $(0,\infty)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS6.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(a).&lt;/span&gt; We split into $\alpha\leq 1$ and $\alpha&amp;gt;1\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS6.p4" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Case 1&lt;/em&gt; ($\alpha\in(0,1]$). By the strict concavity
of $\varphi$ (&lt;a href="#Thmtheorem11" title="Lemma 11 (Properties of 𝜑). ‣ C.2 Properties of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;(c)) and $\varphi(0)=0$ (&lt;a href="#Thmtheorem11" title="Lemma 11 (Properties of 𝜑). ‣ C.2 Properties of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;(a)), the secant from $(0,0)$ to $(1,\varphi(1))$ lies below the graph of $\varphi\text{,}$ so $\varphi(\alpha)\geq\varphi(1)\,\alpha\text{.}$ Applying AM-GM to the three positive terms $\varphi(1)\alpha+\varphi(1)\alpha+c/(4\alpha^{2})\text{,}$&lt;/p&gt;
&lt;table id="A3.Ex42" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F(\alpha)\;\geq\;3\sqrt[3]{\varphi(1)^{2}\alpha^{2}\cdot\tfrac{c}{4\alpha^{2}}}\;=\;A\,c^{1/3},\qquad A:=3\bigl(\tfrac{\varphi(1)^{2}}{4}\bigr)^{1/3}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A3.SS6.p5" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Case 2&lt;/em&gt; ($\alpha&amp;gt;1$). By
&lt;a href="#Thmtheorem11" title="Lemma 11 (Properties of 𝜑). ‣ C.2 Properties of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;(b), $\varphi(\alpha)&amp;gt;\varphi(1)\text{,}$ so $F(\alpha)&amp;gt;2\varphi(1)=:B\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS6.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Combining the two cases, $\psi(c)\geq\min(A\,c^{1/3},\,B)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS6.p7" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;We claim $A\geq B\text{.}$ Indeed, $A^{3}\geq B^{3}\iff 27\varphi(1)^{2}/4\geq 8\varphi(1)^{3}\iff\varphi(1)\leq 27/32\text{;}$ by &lt;a href="#Thmtheorem10" title="Lemma 10 (Closed form of 𝜑). ‣ Notation. ‣ C.1 Closed Form of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;10&lt;/span&gt;&lt;/a&gt;, $\varphi(1)=\tfrac{9}{2}\log 3-6\log 2\approx 0.785&amp;lt;27/32\approx 0.844\text{,}$ so $A\geq B\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS6.p8" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;Given $A\geq B\text{:}$&lt;/p&gt;
&lt;ul id="A3.I3" class="ltx_itemize"&gt;
&lt;li id="A3.I3.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A3.I3.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $c\leq 1\text{:}$ $Ac^{1/3}\geq Bc^{1/3}$ (since $A\geq B$)
and $B\geq Bc^{1/3}$ (since $c^{1/3}\leq 1$), so
$\min(Ac^{1/3},B)\geq Bc^{1/3}=B\min(c^{1/3},1)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A3.I3.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A3.I3.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $c&amp;gt;1\text{:}$ $Ac^{1/3}&amp;gt;A\geq B\text{,}$ so
$\min(Ac^{1/3},B)=B=B\min(c^{1/3},1)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="ltx_p"&gt;Setting $\kappa:=B=2\varphi(1)$ yields (a).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS6.p9" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(b).&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS6.p10" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Upper bound.&lt;/em&gt;
Take $\alpha_{0}:=(c/(8\log 2))^{1/3}=c^{1/3}/(2(\log 2)^{1/3})\text{.}$ By &lt;a href="#Thmtheorem11" title="Lemma 11 (Properties of 𝜑). ‣ C.2 Properties of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;(d), $\varphi(\alpha_{0})\leq 2(\log 2)\alpha_{0}\text{,}$ so&lt;/p&gt;
&lt;table id="A3.Ex43" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F(\alpha_{0})\;\leq\;4(\log 2)\alpha_{0}+\frac{c}{4\alpha_{0}^{2}}\;=\;2(\log 2)^{2/3}c^{1/3}+(\log 2)^{2/3}c^{1/3}\;=\;3(\log 2)^{2/3}c^{1/3}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Hence $\psi(c)\leq 3(\log 2)^{2/3}c^{1/3}$ for all $c&amp;gt;0\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS6.p11" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Lower bound.&lt;/em&gt;
From the integral representation in the proof of &lt;a href="#Thmtheorem11" title="Lemma 11 (Properties of 𝜑). ‣ C.2 Properties of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;, $\varphi^{\prime}(\alpha)=\int_{0}^{1}\int_{0}^{1}(\alpha+s+t)^{-1}\,ds\,dt$ is continuous and strictly decreasing in $\alpha\geq 0\text{,}$ with $\varphi^{\prime}(0)=2\log 2$ by (&lt;a href="#A3.E16" title="Equation 16 ‣ C.2 Properties of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;16&lt;/span&gt;&lt;/a&gt;). For any $\eta\in(0,2\log 2)\text{,}$ there exists $\epsilon_{0}=\epsilon_{0}(\eta)&amp;gt;0$ such that $\varphi^{\prime}(u)\geq 2\log 2-\eta$ for $u\in[0,\epsilon_{0}]\text{;}$ integrating, $\varphi(\alpha)\geq(2\log 2-\eta)\alpha$ for $\alpha\in[0,\epsilon_{0}]\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS6.p12" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $\alpha\in(0,\epsilon_{0}]\text{,}$ AM-GM applied to $(2\log 2-\eta)\alpha+(2\log 2-\eta)\alpha+c/(4\alpha^{2})$ gives&lt;/p&gt;
&lt;table id="A3.Ex44" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F(\alpha)\;\geq\;3\bigl((2\log 2-\eta)^{2}c/4\bigr)^{1/3}\;=\;3(\log 2-\eta/2)^{2/3}c^{1/3}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;For $\alpha&amp;gt;\epsilon_{0}\text{,}$ $F(\alpha)\geq 2\varphi(\alpha)\geq 2\varphi(\epsilon_{0})&amp;gt;0\text{,}$ a positive constant independent of $c\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS6.p13" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Since $3(\log 2-\eta/2)^{2/3}c^{1/3}\to 0$ as $c\to 0\text{,}$ there exists $c_{\eta}&amp;gt;0$ such that $3(\log 2-\eta/2)^{2/3}c^{1/3}&amp;lt;2\varphi(\epsilon_{0})$ for $c\leq c_{\eta}\text{,}$ and consequently&lt;/p&gt;
&lt;table id="A3.Ex45" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\psi(c)\;\geq\;3(\log 2-\eta/2)^{2/3}c^{1/3}\qquad\text{for }c\leq c_{\eta}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Since $\eta&amp;gt;0$ was arbitrary, $\liminf_{c\to 0^{+}}\psi(c)/\bigl(3(\log 2)^{2/3}c^{1/3}\bigr)\geq 1\text{.}$ Combined with the upper bound $\psi(c)\leq 3(\log 2)^{2/3}c^{1/3}\text{,}$ this yields (b).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS6.p14" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(c).&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS6.p15" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Upper bound.&lt;/em&gt;
For $c\geq 1\text{,}$ $\sqrt{c}/2\geq 1/2\text{,}$ so by &lt;a href="#Thmtheorem11" title="Lemma 11 (Properties of 𝜑). ‣ C.2 Properties of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;(e), $\varphi(\sqrt{c}/2)\leq\log(\sqrt{c}/2)+2\text{.}$ Hence&lt;/p&gt;
&lt;table id="A3.Ex46" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\psi(c)\;\leq\;F(\sqrt{c}/2)\;=\;2\varphi(\sqrt{c}/2)+\frac{c}{4\cdot c/4}\;\leq\;2\bigl(\tfrac{1}{2}\log c-\log 2+2\bigr)+1\;=\;\log c-2\log 2+5.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A3.SS6.p16" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Lower bound.&lt;/em&gt;
For $\alpha\geq 0\text{,}$&lt;/p&gt;
&lt;table id="A3.Ex47" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\varphi^{\prime}(\alpha)\;=\;\int_{0}^{1}\int_{0}^{1}\frac{ds\,dt}{\alpha+s+t}\;\geq\;\int_{0}^{1}\int_{0}^{1}\frac{ds\,dt}{\alpha+2}\;=\;\frac{1}{\alpha+2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Integrating, $\varphi(\alpha)\geq\log((\alpha+2)/2)\geq\log\alpha-\log 2$ for $\alpha&amp;gt;0\text{,}$ so&lt;/p&gt;
&lt;table id="A3.Ex48" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F(\alpha)\;\geq\;2\log\alpha-2\log 2+c/(4\alpha^{2})\qquad\forall\,\alpha&amp;gt;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Minimizing the right-hand side over $\alpha&amp;gt;0\text{,}$ the first-order condition $2/\alpha=c/(2\alpha^{3})$ gives $\alpha=\sqrt{c}/2\text{,}$ with minimum value $\log c-2\log 2-2\log 2+1=\log c+1-4\log 2\text{.}$ Hence $\psi(c)\geq\log c+1-4\log 2\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS6.p17" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Combining the two bounds, $\psi(c)-\log c\in[1-4\log 2,\,5-2\log 2]$ uniformly for $c\geq 1\text{,}$ that is, $\psi(c)=\log c+O(1)\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A3.SS7" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="asymptotic-of-psi"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;C.7 &lt;/span&gt;Asymptotic of $\Psi$
&lt;/h3&gt;
&lt;div id="Thmtheorem17" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 17&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Asymptotic of $\Psi$).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem17.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For all integers $m\geq 2\text{,}$ as $T/m\to\infty\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A3.E23" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi_{[m]^{2}}(T)\;=\;m^{2}\,\psi(T/m^{4})\,+\,O(m).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(22)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;More precisely: there exist absolute constants $T_{0},C$ such that, for all integers $m\geq 2$ and $T$ with $T/m\geq T_{0}\text{,}$ $|\Psi_{[m]^{2}}(T)-m^{2}\,\psi(T/m^{4})|\leq Cm\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A3.SS7.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The proof proceeds in four steps.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS7.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 1 (Error propagation).&lt;/span&gt; By &lt;a href="#Thmtheorem15" title="Corollary 15 (Quantitative refinement of Lemma 14). ‣ C.5 Main-Text Form ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;15&lt;/span&gt;&lt;/a&gt;, there exists an absolute constant $\kappa$ (one may take $\kappa:=1/12+1/\log 2&amp;lt;1.53$) such that&lt;/p&gt;
&lt;table id="A3.Ex49" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$|H_{[m]^{2}}(K)-m^{2}\,\varphi(K/m)|\;\leq\;\kappa\log m\qquad\forall\,m\geq 2,\;K\geq 1$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;(combining the $\tfrac{1}{12}\log m+C_{1}$ form of &lt;a href="#Thmtheorem15" title="Corollary 15 (Quantitative refinement of Lemma 14). ‣ C.5 Main-Text Form ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;15&lt;/span&gt;&lt;/a&gt; with $C_{1}\leq 1\leq(1/\log 2)\log m$ for $m\geq 2$). Hence $|2H_{[m]^{2}}(K)+T/(4K^{2})-(2m^{2}\,\varphi(K/m)+T/(4K^{2}))|\leq 2\kappa\log m$ uniformly in $K\text{.}$ Taking the infimum over $K\text{,}$&lt;/p&gt;
&lt;table id="A3.E24" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$|\Psi_{[m]^{2}}(T)-M_{m}(T)|\;\leq\;2\kappa\log m\;=\;O(\log m),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(23)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where $M_{m}(T):=\inf_{K\in\mathbb{N},\,K\geq 1}\bigl[2m^{2}\,\varphi(K/m)+T/(4K^{2})\bigr]\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS7.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 2 (Continuous relaxation).&lt;/span&gt; Define $\tilde{M}_{m}(T):=\inf_{k&amp;gt;0}\bigl[2m^{2}\,\varphi(k/m)+T/(4k^{2})\bigr]\text{.}$ Substituting $\alpha:=k/m\text{,}$&lt;/p&gt;
&lt;table id="A3.E25" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tilde{M}_{m}(T)\;=\;m^{2}\inf_{\alpha&amp;gt;0}\Bigl[2\varphi(\alpha)+\frac{T/m^{4}}{4\alpha^{2}}\Bigr]\;=\;m^{2}\,\psi(T/m^{4}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(24)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Since $\{K\in\mathbb{N}:K\geq 1\}\subset(0,\infty)\text{,}$&lt;/p&gt;
&lt;table id="A3.E26" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$M_{m}(T)\;\geq\;\tilde{M}_{m}(T).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(25)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A3.SS7.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 3 (Discretization gap).&lt;/span&gt; Let $F(k):=2m^{2}\,\varphi(k/m)+T/(4k^{2})\text{.}$ Since $F$ is continuous on $(0,\infty)\text{,}$ blows up at $0$ through the penalty term, and diverges at infinity by &lt;a href="#Thmtheorem11" title="Lemma 11 (Properties of 𝜑). ‣ C.2 Properties of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;(f), $F$ attains its minimum on $(0,\infty)\text{;}$ let $k_{c}$ denote a minimizer. The first-order condition gives&lt;/p&gt;
&lt;table id="A3.E27" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$2m\,\varphi^{\prime}(k_{c}/m)\;=\;T/(2k_{c}^{3})\quad\Longleftrightarrow\quad T/k_{c}^{3}\;=\;4m\,\varphi^{\prime}(k_{c}/m)\;\leq\;8m\log 2,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(26)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where the final inequality uses that $\varphi^{\prime}$ is decreasing (&lt;a href="#Thmtheorem11" title="Lemma 11 (Properties of 𝜑). ‣ C.2 Properties of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;(c)) with $\varphi^{\prime}(0)=2\log 2\text{.}$ From (&lt;a href="#A3.E27" title="Equation 26 ‣ C.7 Asymptotic of Ψ ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;26&lt;/span&gt;&lt;/a&gt;), $k_{c}\geq(T/(8m\log 2))^{1/3}\text{,}$ so $T/m\to\infty$ implies $k_{c}\to\infty\text{.}$ Choose $T_{0}$ so that $T/m\geq T_{0}$ implies $k_{c}\geq 2$ (one may take $T_{0}:=64\log 2$).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS7.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Let $\hat{K}_{c}:=\mathrm{round}(k_{c})\in\mathbb{N}\text{,}$ so $|\hat{K}_{c}-k_{c}|\leq 1/2\text{.}$ From $k_{c}\geq 2\text{,}$ $\hat{K}_{c}\geq k_{c}-1/2\geq 3/2\text{,}$ and as an integer $\hat{K}_{c}\geq 2\text{;}$ moreover, $\hat{K}_{c}\in[k_{c}/2,\,3k_{c}/2]\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS7.p6" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Entropy change.&lt;/em&gt;
By $\varphi^{\prime}(\alpha)\leq\varphi^{\prime}(0)=2\log 2$ and $|\hat{K}_{c}-k_{c}|\leq 1/2\text{,}$&lt;/p&gt;
&lt;table id="A3.Ex50" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$2m^{2}\bigl|\varphi(\hat{K}_{c}/m)-\varphi(k_{c}/m)\bigr|\;\leq\;2m^{2}\cdot(2\log 2)\cdot\frac{1}{2m}\;=\;2m\log 2.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A3.SS7.p7" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Penalty change.&lt;/em&gt;
Let $\delta:=\hat{K}_{c}-k_{c}\text{,}$ so $|\delta|\leq 1/2\text{.}$ Then $|\hat{K}_{c}^{2}-k_{c}^{2}|=|2k_{c}\delta+\delta^{2}|\leq k_{c}+1/4\leq 5k_{c}/4$ (using $k_{c}\geq 1$). Combined with $\hat{K}_{c}^{2}\geq k_{c}^{2}/4\text{,}$&lt;/p&gt;
&lt;table id="A3.Ex51" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\left|\frac{T}{4\hat{K}_{c}^{2}}-\frac{T}{4k_{c}^{2}}\right|\;=\;\frac{T}{4}\cdot\frac{|\hat{K}_{c}^{2}-k_{c}^{2}|}{\hat{K}_{c}^{2}k_{c}^{2}}\;\leq\;\frac{T}{4}\cdot\frac{5k_{c}/4}{k_{c}^{4}/4}\;=\;\frac{5T}{4k_{c}^{3}}\;\leq\;10\,m\log 2.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A3.SS7.p8" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;Combining, $F(\hat{K}_{c})\leq F(k_{c})+2m\log 2+10m\log 2=\tilde{M}_{m}(T)+12\,m\log 2\text{.}$ Since $\hat{K}_{c}\in\mathbb{N}$ with $\hat{K}_{c}\geq 1\text{,}$ $M_{m}(T)\leq F(\hat{K}_{c})\text{,}$ hence&lt;/p&gt;
&lt;table id="A3.E28" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$M_{m}(T)-\tilde{M}_{m}(T)\;\leq\;12\,m\log 2\;=\;O(m).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(27)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Combined with (&lt;a href="#A3.E26" title="Equation 25 ‣ C.7 Asymptotic of Ψ ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;25&lt;/span&gt;&lt;/a&gt;), $|M_{m}(T)-\tilde{M}_{m}(T)|\leq 12\,m\log 2\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS7.p9" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 4 (Combining).&lt;/span&gt; From (&lt;a href="#A3.E24" title="Equation 23 ‣ C.7 Asymptotic of Ψ ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;23&lt;/span&gt;&lt;/a&gt;), (&lt;a href="#A3.E25" title="Equation 24 ‣ C.7 Asymptotic of Ψ ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;24&lt;/span&gt;&lt;/a&gt;), and (&lt;a href="#A3.E28" title="Equation 27 ‣ C.7 Asymptotic of Ψ ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;27&lt;/span&gt;&lt;/a&gt;),&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A13.EGx3"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.Ex52"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.Ex53"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle|\Psi_{[m]^{2}}(T)-m^{2}\,\psi(T/m^{4})| &amp;amp; \displaystyle\;\leq\;|\Psi_{[m]^{2}}(T)-M_{m}(T)|+|M_{m}(T)-\tilde{M}_{m}(T)| \\
&amp;amp; \displaystyle\;=\;O(\log m)+O(m)\;=\;O(m).
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A3.SS8" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="phase-asymptotics"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;C.8 &lt;/span&gt;Phase Asymptotics&lt;/h3&gt;
&lt;div id="Thmtheorem18" class="ltx_theorem ltx_theorem_corollary"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Corollary 18&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Phase asymptotics of $\Psi$).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem18.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For all integers $m\geq 2\text{,}$ as $T/m\to\infty\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;ol id="A3.I4" class="ltx_enumerate"&gt;
&lt;li id="A3.I4.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(i)&lt;/span&gt;
&lt;div id="A3.I4.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Phase 1, $T/m^{4}\to 0$)&lt;span class="ltx_text ltx_font_italic"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table id="A3.E29" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi_{[m]^{2}}(T)\;=\;3(\log 2)^{2/3}\,m^{2/3}T^{1/3}\,(1+o(1)).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(28)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A3.I4.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(ii)&lt;/span&gt;
&lt;div id="A3.I4.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Phase 2, $T/m^{4}\to\infty$)&lt;span class="ltx_text ltx_font_italic"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table id="A3.E30" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi_{[m]^{2}}(T)\;=\;m^{2}\log(T/m^{4})\,+\,O(m^{2}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(29)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A3.SS8.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Let $c:=T/m^{4}\text{.}$ By &lt;a href="#Thmtheorem17" title="Theorem 17 (Asymptotic of Ψ). ‣ C.7 Asymptotic of Ψ ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;17&lt;/span&gt;&lt;/a&gt;, $\Psi_{[m]^{2}}(T)=m^{2}\,\psi(c)+O(m)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS8.p2" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;(i).&lt;/em&gt;
For $c\to 0\text{,}$ &lt;a href="#Thmtheorem16" title="Lemma 16 (Properties of 𝜓). ‣ C.6 Properties of 𝜓 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;16&lt;/span&gt;&lt;/a&gt;(b) gives $\psi(c)=3(\log 2)^{2/3}c^{1/3}(1+o(1))\text{,}$ so&lt;/p&gt;
&lt;table id="A3.Ex54" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$m^{2}\,\psi(c)\;=\;3(\log 2)^{2/3}m^{2}c^{1/3}(1+o(1))\;=\;3(\log 2)^{2/3}m^{2/3}T^{1/3}(1+o(1)).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Since $T/m\to\infty\text{,}$ $m^{2/3}T^{1/3}/m=(T/m)^{1/3}\to\infty\text{,}$ hence $O(m)=o(m^{2/3}T^{1/3})=o(m^{2}\,\psi(c))\text{.}$ Substituting into &lt;a href="#Thmtheorem17" title="Theorem 17 (Asymptotic of Ψ). ‣ C.7 Asymptotic of Ψ ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;17&lt;/span&gt;&lt;/a&gt; yields (&lt;a href="#A3.E29" title="Equation 28 ‣ Item (i) ‣ Corollary 18 (Phase asymptotics of Ψ). ‣ C.8 Phase Asymptotics ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;28&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS8.p3" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;(ii).&lt;/em&gt;
For $c\to\infty\text{,}$ &lt;a href="#Thmtheorem16" title="Lemma 16 (Properties of 𝜓). ‣ C.6 Properties of 𝜓 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;16&lt;/span&gt;&lt;/a&gt;(c) gives $\psi(c)=\log c+O(1)\text{,}$ so $m^{2}\,\psi(c)=m^{2}\log c+O(m^{2})=m^{2}\log(T/m^{4})+O(m^{2})\text{.}$ Substituting into &lt;a href="#Thmtheorem17" title="Theorem 17 (Asymptotic of Ψ). ‣ C.7 Asymptotic of Ψ ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;17&lt;/span&gt;&lt;/a&gt;, the $O(m)$ term is absorbed into $O(m^{2})\text{,}$ yielding (&lt;a href="#A3.E30" title="Equation 29 ‣ Item (ii) ‣ Corollary 18 (Phase asymptotics of Ψ). ‣ C.8 Phase Asymptotics ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;29&lt;/span&gt;&lt;/a&gt;).
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A4" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="bridge-lemma"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix D &lt;/span&gt;Bridge Lemma&lt;/h2&gt;
&lt;div id="A4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This appendix proves the Bridge Lemma (&lt;a href="#Thmtheorem19" title="Lemma 19 (Bridge Lemma). ‣ D.1 Statement ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;19&lt;/span&gt;&lt;/a&gt;), which geometrically connects the lower-bound quantities $L_{1},L_{2}$ from &lt;a href="#Thmtheorem26" title="Lemma 26 (Ribbon-Path Lower Bound). ‣ E.1.5 Proof of Lemma 26 ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemmas&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;26&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmtheorem31" title="Lemma 31 (Interior-Cube Lower Bound). ‣ E.2.6 Proof of Lemma 31 ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;31&lt;/span&gt;&lt;/a&gt; to the unified envelope $\min\{T,\Psi_{[m]^{2}}(T)\}\text{,}$ completing the $d=2\text{,}$ squared-loss case of &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; with an explicit constant; the general case is proved in &lt;a href="#A11" title="Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;K&lt;/span&gt;&lt;/a&gt;. The main tools are &lt;a href="#Thmtheorem15" title="Corollary 15 (Quantitative refinement of Lemma 14). ‣ C.5 Main-Text Form ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;15&lt;/span&gt;&lt;/a&gt; (a quantitative bound on $\bigl|H_{[m]^{2}}(K)-m^{2}\,\varphi(K/m)\bigr|$) and &lt;a href="#Thmtheorem11" title="Lemma 11 (Properties of 𝜑). ‣ C.2 Properties of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;(d)(e) (two explicit upper bounds on $\varphi$). The argument invokes no abstract asymptotic of $\psi$ or $\Psi\text{;}$ it uses only $\varphi$-level analytic properties.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A4.SS0.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Recall.&lt;/h5&gt;
&lt;div id="A4.SS0.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;$\mathcal{F}_{[m]^{2}}^{\uparrow}$ denotes the class of $[0,1]$-valued isotonic functions on $[m]^{2}\text{,}$ and $R_{T}^{*}([m]^{2})$ the minimax regret on $[m]^{2}\text{.}$ The function $\Psi_{[m]^{2}}(T)$ from &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorems&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; is defined by&lt;/p&gt;
&lt;table id="A4.Ex55" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi_{[m]^{2}}(T)\;:=\;\inf_{K\in\mathbb{N}_{+}}\!\Bigl[2H_{[m]^{2}}(K)+\tfrac{T}{4K^{2}}\Bigr].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;By LB-I (&lt;a href="#Thmtheorem26" title="Lemma 26 (Ribbon-Path Lower Bound). ‣ E.1.5 Proof of Lemma 26 ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;26&lt;/span&gt;&lt;/a&gt;), $R_{T}^{*}([m]^{2})\geq c_{1}L_{1}$ for all $T\geq 1\text{,}$ where&lt;/p&gt;
&lt;table id="A4.Ex56" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$L_{1}\;:=\;\sup_{1\,\leq\,K\,\leq\,\lfloor m/8\rfloor}\!\min\!\bigl\{mK,\;T/K^{2}\bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;By LB-II (&lt;a href="#Thmtheorem31" title="Lemma 31 (Interior-Cube Lower Bound). ‣ E.2.6 Proof of Lemma 31 ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;31&lt;/span&gt;&lt;/a&gt;), $R_{T}^{*}([m]^{2})\geq c_{2}L_{2}$ for $T\geq m^{2}\text{,}$ where&lt;/p&gt;
&lt;table id="A4.Ex57" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$L_{2}\;:=\;m^{2}\log\!\Bigl(1+\tfrac{T}{C_{0}\,m^{4}}\Bigr),\qquad C_{0}=2160.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Here $C_{0}$ is the absolute constant arising in the proof of LB-II.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A4.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="statement"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;D.1 &lt;/span&gt;Statement&lt;/h3&gt;
&lt;div id="Thmtheorem19" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 19&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Bridge Lemma).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem19.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let&lt;/span&gt;&lt;/p&gt;
&lt;table id="A4.Ex58" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$L_{1}\;:=\;\sup_{1\,\leq\,K\,\leq\,\lfloor m/8\rfloor}\!\min\!\bigl\{mK,\;T/K^{2}\bigr\}\qquad\text{and}\qquad L_{2}\;:=\;m^{2}\log\!\Bigl(1+\tfrac{T}{2160\,m^{4}}\Bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For all integers $m\geq 16$ and $T\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A4.E31" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\max\{L_{1},\,L_{2}\}\;\geq\;c_{BL}\cdot\min\!\bigl\{T,\,\Psi_{[m]^{2}}(T)\bigr\},\qquad c_{BL}\,=\,1/342.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(30)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A4.SS1.p1" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;The explicit constant $c_{BL}=1/342$ holds. Moreover,
$L_{2}$ is needed only for $T&amp;gt;C_{0}^{2}\,m^{4}\text{:}$ for $T\leq C_{0}^{2}\,m^{4}\text{,}$ the inequality $L_{1}\geq c_{BL}\,\min\{T,\Psi_{[m]^{2}}(T)\}$ closes independently; for $T&amp;gt;C_{0}^{2}\,m^{4}\text{,}$ the inequality $L_{2}\geq c_{BL}\,\min\{T,\Psi_{[m]^{2}}(T)\}$ closes independently.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS1.p2" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Remark&lt;/span&gt; (small-$m$ closure).
The explicit constant in &lt;a href="#Thmtheorem19" title="Lemma 19 (Bridge Lemma). ‣ D.1 Statement ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;19&lt;/span&gt;&lt;/a&gt; requires $m\geq 16\text{.}$ The remaining finite range $2\leq m\leq 15$ is closed by &lt;a href="#Thmtheorem22" title="Proposition 22 (Three-Case Closure). ‣ D.4 Three-Case Closure ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;22&lt;/span&gt;&lt;/a&gt; below, which combines a trivial-adversary lower bound (Case (b)) with an extension of Interval D of the proof in &lt;a href="#A4.SS3" title="D.3 Proof of Bridge Lemma ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;D.3&lt;/span&gt;&lt;/a&gt; to $m\geq 2$ (Case (c)).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS1.p3" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Remark&lt;/span&gt; (relation to $\Psi$).
Inequality (&lt;a href="#A4.E31" title="Equation 30 ‣ Lemma 19 (Bridge Lemma). ‣ D.1 Statement ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;30&lt;/span&gt;&lt;/a&gt;) does not require the precise asymptotic of $\Psi$ (e.g., the Phase-1 and Phase-2 leading constants from &lt;a href="#Thmtheorem18" title="Corollary 18 (Phase asymptotics of Ψ). ‣ C.8 Phase Asymptotics ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;18&lt;/span&gt;&lt;/a&gt;); only quantitative upper bounds on $\Psi$ in the relevant regimes are needed. These bounds are established independently in &lt;a href="#A4.SS2" title="D.2 Quantitative Upper Bounds on Ψ ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;D.2&lt;/span&gt;&lt;/a&gt; from &lt;a href="#Thmtheorem15" title="Corollary 15 (Quantitative refinement of Lemma 14). ‣ C.5 Main-Text Form ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;15&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmtheorem11" title="Lemma 11 (Properties of 𝜑). ‣ C.2 Properties of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;(d)(e).&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A4.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="quantitative-upper-bounds-on-psi"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;D.2 &lt;/span&gt;Quantitative Upper Bounds on
$\Psi$
&lt;/h3&gt;
&lt;div id="A4.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This subsection establishes two explicit upper bounds on $\Psi\text{,}$ one in the Phase 1 regime and one in the Phase 2 regime. Both are obtained by applying &lt;a href="#Thmtheorem15" title="Corollary 15 (Quantitative refinement of Lemma 14). ‣ C.5 Main-Text Form ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;15&lt;/span&gt;&lt;/a&gt; to approximate $H_{[m]^{2}}(K)$ by $m^{2}\,\varphi(K/m)\text{,}$ then bounding $\varphi$ via &lt;a href="#Thmtheorem11" title="Lemma 11 (Properties of 𝜑). ‣ C.2 Properties of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;, and finally choosing $K$ explicitly. Throughout, $C_{1}\geq 0$ denotes the non-negative absolute constant from &lt;a href="#Thmtheorem15" title="Corollary 15 (Quantitative refinement of Lemma 14). ‣ C.5 Main-Text Form ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;15&lt;/span&gt;&lt;/a&gt;, with $C_{1}\leq 1\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem20" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 20&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Phase 1 Upper Bound).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem20.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For all integers $m\geq 16$ and $T\geq m\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A4.E32" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi_{[m]^{2}}(T)\;\leq\;6\,m^{2/3}\,T^{1/3}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(31)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A4.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;By &lt;a href="#Thmtheorem15" title="Corollary 15 (Quantitative refinement of Lemma 14). ‣ C.5 Main-Text Form ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;15&lt;/span&gt;&lt;/a&gt;, for all integers $m\geq 2$ and $K\geq 1\text{,}$&lt;/p&gt;
&lt;table id="A4.Ex59" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$2H_{[m]^{2}}(K)\;\leq\;2m^{2}\,\varphi(K/m)\,+\,\tfrac{1}{6}\log m\,+\,2C_{1}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;By &lt;a href="#Thmtheorem11" title="Lemma 11 (Properties of 𝜑). ‣ C.2 Properties of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;(d), $\varphi(K/m)\leq 2(\log 2)\,K/m\text{,}$ so $2m^{2}\,\varphi(K/m)\leq 4(\log 2)\,mK\text{.}$ Hence, for any integer $K\geq 1\text{,}$&lt;/p&gt;
&lt;table id="A4.E33" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi_{[m]^{2}}(T)\;\leq\;G(K)+\tfrac{1}{6}\log m+2C_{1},\qquad G(k)\,:=\,4(\log 2)\,mk+\frac{T}{4k^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(32)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A4.SS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Continuous optimization.&lt;/span&gt; The function $G$ is strictly convex on $k&amp;gt;0\text{,}$ with $G^{\prime}(k)=4(\log 2)\,m-T/(2k^{3})\text{.}$ The first-order condition gives the unique minimizer $k_{c}:=\bigl(T/(8(\log 2)\,m)\bigr)^{1/3}\text{.}$ From $T/k_{c}^{3}=8(\log 2)\,m\text{,}$ we have $T/(4k_{c}^{2})=2(\log 2)\,m\,k_{c}\text{,}$ so&lt;/p&gt;
&lt;table id="A4.E34" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$G(k_{c})\;=\;4(\log 2)\,m\,k_{c}+2(\log 2)\,m\,k_{c}\;=\;6(\log 2)\,m\,k_{c}\;=\;3\,(\log 2)^{2/3}\,m^{2/3}\,T^{1/3},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(33)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where the last equality follows from $m\,k_{c}=m^{2/3}T^{1/3}/(8(\log 2))^{1/3}=m^{2/3}T^{1/3}/(2(\log 2)^{1/3})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS2.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Integerization.&lt;/span&gt; Set $K_{0}:=\max(1,\,\lceil k_{c}\rceil)\in\mathbb{N}\text{,}$ so $K_{0}\geq 1\text{.}$ We claim $G(K_{0})-G(k_{c})\leq 4(\log 2)\,m\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS2.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Case 1&lt;/span&gt; ($k_{c}\geq 1$). Here $K_{0}=\lceil k_{c}\rceil$ and $K_{0}-k_{c}\leq 1\text{.}$ The derivative $G^{\prime}$ is strictly increasing on $(k_{c},\infty)$ with values in $(0,4(\log 2)\,m)$ (using $G^{\prime}(k_{c})=0$ and $G^{\prime}(k)\to 4(\log 2)\,m$ as $k\to\infty$). By the mean value theorem, there exists $\xi\in(k_{c},K_{0})$ with $G(K_{0})-G(k_{c})=G^{\prime}(\xi)(K_{0}-k_{c})\leq 4(\log 2)\,m\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS2.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Case 2&lt;/span&gt; ($k_{c}&amp;lt;1$). Here $K_{0}=1$ and $1-k_{c}&amp;lt;1\text{.}$ Since $G$ is convex and $G^{\prime}$ on $(k_{c},1]\subset(k_{c},\infty)$ takes values in $(0,G^{\prime}(1)]$ with $G^{\prime}(1)=4(\log 2)\,m-T/2\text{,}$ and since $k_{c}&amp;lt;1$ is equivalent to $T&amp;lt;8(\log 2)\,m\text{,}$ one has $G^{\prime}(1)\geq 0$ and $G^{\prime}(1)\leq 4(\log 2)\,m\text{.}$ The mean value theorem gives $G(1)-G(k_{c})\leq G^{\prime}(1)(1-k_{c})&amp;lt;4(\log 2)\,m\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS2.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Combining the two cases, for all $T&amp;gt;0\text{,}$&lt;/p&gt;
&lt;table id="A4.Ex60" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\inf_{K\in\mathbb{N}_{+}}G(K)\;\leq\;G(K_{0})\;\leq\;G(k_{c})+4(\log 2)\,m\;=\;3\,(\log 2)^{2/3}\,m^{2/3}\,T^{1/3}+4(\log 2)\,m.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A4.SS2.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Low-order term absorption.&lt;/span&gt; From $T\geq m\text{,}$ $m\leq m^{2/3}\,T^{1/3}\text{;}$ combined with $m\geq 16\text{,}$ $m^{2/3}\,T^{1/3}\geq m\geq 16\text{.}$ Hence $4(\log 2)\,m\leq 4(\log 2)\,m^{2/3}\,T^{1/3}\text{;}$ using $\log m\leq m\text{,}$ $\tfrac{1}{6}\log m\leq\tfrac{1}{6}\,m^{2/3}\,T^{1/3}\text{;}$ using $C_{1}\geq 0$ and $m^{2/3}\,T^{1/3}\geq 16\text{,}$ $2C_{1}\leq(C_{1}/8)\,m^{2/3}\,T^{1/3}\text{.}$ Combining,&lt;/p&gt;
&lt;table id="A4.Ex61" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi_{[m]^{2}}(T)\;\leq\;\Bigl[3\,(\log 2)^{2/3}+4(\log 2)+\tfrac{1}{6}+C_{1}/8\Bigr]\,m^{2/3}\,T^{1/3}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Numerically, $3\,(\log 2)^{2/3}+4(\log 2)+1/6\approx 5.30\text{;}$ combined with $C_{1}\leq 1$ (so $C_{1}/8\leq 1/8$), $\Psi_{[m]^{2}}(T)\leq 5.43\,m^{2/3}\,T^{1/3}\leq 6\,m^{2/3}\,T^{1/3}\text{,}$ which is (&lt;a href="#A4.E32" title="Equation 31 ‣ Lemma 20 (Phase 1 Upper Bound). ‣ D.2 Quantitative Upper Bounds on Ψ ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;31&lt;/span&gt;&lt;/a&gt;).
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem21" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 21&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Phase 2 Upper Bound).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem21.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For all integers $m\geq 16$ and $T\geq m^{4}\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A4.E35" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi_{[m]^{2}}(T)\;\leq\;m^{2}\log(T/m^{4})\,+\,6\,m^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(34)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A4.SS2.p9" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Set $K^{*}:=\lceil\sqrt{T}/(2m)\rceil\in\mathbb{N}\text{.}$ From $T\geq m^{4}\text{,}$ $\sqrt{T}/(2m)\geq m/2\text{,}$ so $K^{*}\geq\lceil m/2\rceil\geq m/2\text{;}$ in particular, $K^{*}/m\geq 1/2\text{,}$ and the hypothesis of &lt;a href="#Thmtheorem11" title="Lemma 11 (Properties of 𝜑). ‣ C.2 Properties of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;(e) is satisfied.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS2.p10" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Entropy term.&lt;/span&gt; By &lt;a href="#Thmtheorem15" title="Corollary 15 (Quantitative refinement of Lemma 14). ‣ C.5 Main-Text Form ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;15&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmtheorem11" title="Lemma 11 (Properties of 𝜑). ‣ C.2 Properties of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;(e),&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A4.Ex62"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A4.Ex62X"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A4.Ex62Xa"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle 2H_{[m]^{2}}(K^{*}) &amp;amp; \displaystyle\;\leq\;2m^{2}\,\varphi(K^{*}/m)+\tfrac{1}{6}\log m+2C_{1} \\
&amp;amp; \displaystyle\;\leq\;2m^{2}\,\bigl[\log(K^{*}/m)+2\bigr]+\tfrac{1}{6}\log m+2C_{1}.
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;From $K^{*}\leq\sqrt{T}/(2m)+1\text{,}$&lt;/p&gt;
&lt;table id="A4.Ex63" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log(K^{*}/m)\;\leq\;\log\!\Bigl(\tfrac{\sqrt{T}+2m}{2m^{2}}\Bigr)\;=\;\tfrac{1}{2}\log(T/m^{4})-\log 2+\log\!\Bigl(1+\tfrac{2m}{\sqrt{T}}\Bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;From $T\geq m^{4}\text{,}$ $\sqrt{T}\geq m^{2}\text{,}$ so $2m/\sqrt{T}\leq 2/m\text{;}$ combined with $m\geq 16\text{,}$ $2/m\leq 1/8\text{,}$ so $\log(1+2m/\sqrt{T})\leq\log(9/8)&amp;lt;1/8\text{.}$ Substituting,&lt;/p&gt;
&lt;table id="A4.Ex64" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$2m^{2}\log(K^{*}/m)\;\leq\;m^{2}\log(T/m^{4})-2(\log 2)\,m^{2}+\tfrac{1}{4}\,m^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A4.SS2.p11" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Penalty term.&lt;/span&gt; $K^{*}\geq\sqrt{T}/(2m)$ implies $(K^{*})^{2}\geq T/(4m^{2})\text{,}$ so&lt;/p&gt;
&lt;table id="A4.Ex65" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{T}{4(K^{*})^{2}}\;\leq\;m^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A4.SS2.p12" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Combining.&lt;/span&gt; Setting $K=K^{*}$ in the definition of $\Psi\text{,}$ $\Psi_{[m]^{2}}(T)\leq 2H_{[m]^{2}}(K^{*})+T/(4(K^{*})^{2})\text{.}$ Combining the entropy estimates,&lt;/p&gt;
&lt;table id="A4.Ex66" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$2H_{[m]^{2}}(K^{*})\;\leq\;m^{2}\log(T/m^{4})-2(\log 2)\,m^{2}+\tfrac{1}{4}\,m^{2}+4m^{2}+\tfrac{1}{6}\log m+2C_{1},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and adding the penalty term $T/(4(K^{*})^{2})\leq m^{2}\text{,}$ we collect the $m^{2}$ coefficients ($-2\log 2+1/4+4+1=21/4-2\log 2$) to obtain&lt;/p&gt;
&lt;table id="A4.Ex67" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi_{[m]^{2}}(T)\;\leq\;m^{2}\log(T/m^{4})+\bigl[\tfrac{21}{4}-2\log 2\bigr]\,m^{2}+\tfrac{1}{6}\log m+2C_{1}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A4.SS2.p13" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Low-order term absorption.&lt;/span&gt; $\tfrac{21}{4}-2\log 2\approx 3.864\text{.}$ For $m\geq 16\text{,}$ $\log m\leq m\leq m^{2}/16\text{,}$ so $\tfrac{1}{6}\log m\leq m^{2}/96\text{;}$ from $m^{2}\geq 256$ and $C_{1}\geq 0\text{,}$ $2C_{1}\leq(C_{1}/128)\,m^{2}\text{.}$ Hence&lt;/p&gt;
&lt;table id="A4.Ex68" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi_{[m]^{2}}(T)\;\leq\;m^{2}\log(T/m^{4})+\bigl[3.864+\tfrac{1}{96}+C_{1}/128\bigr]\,m^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;With $C_{1}\leq 1\text{,}$ $3.864+1/96+1/128&amp;lt;3.89&amp;lt;6\text{,}$ giving (&lt;a href="#A4.E35" title="Equation 34 ‣ Lemma 21 (Phase 2 Upper Bound). ‣ D.2 Quantitative Upper Bounds on Ψ ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;34&lt;/span&gt;&lt;/a&gt;).
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A4.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="proof-of-bridge-lemma"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;D.3 &lt;/span&gt;Proof of Bridge Lemma&lt;/h3&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of &lt;a href="#Thmtheorem19" title="Lemma 19 (Bridge Lemma). ‣ D.1 Statement ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;19&lt;/span&gt;&lt;/a&gt;.&lt;/h6&gt;
&lt;div id="A4.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The argument partitions the parameter range into four intervals A, B, C, D, each yielding an independent constant $c_{A},c_{B},c_{C},c_{D}\text{;}$ the final constant is $c:=\min\{c_{A},c_{B},c_{C},c_{D}\}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS3.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Interval A&lt;/span&gt; ($T\leq 15m$). Take $K=1\in[1,\lfloor m/8\rfloor]$ (the bound $\lfloor m/8\rfloor\geq 2$ follows from $m\geq 16$). Then&lt;/p&gt;
&lt;table id="A4.Ex69" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$L_{1}\;\geq\;\min\{m,\,T\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;If $T\leq m\text{,}$ then $L_{1}\geq T\geq\min\{T,\Psi_{[m]^{2}}(T)\}\text{,}$ giving $c_{A}^{(1)}=1\text{.}$ If $m&amp;lt;T\leq 15m\text{,}$ then $L_{1}\geq m\geq T/15\geq\min\{T,\Psi_{[m]^{2}}(T)\}/15\text{,}$ giving $c_{A}^{(2)}=1/15\text{.}$ Combining, $c_{A}:=1/15\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS3.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Interval B&lt;/span&gt; ($15m&amp;lt;T\leq m^{4}/512$). Let $k_{\mathrm{bal}}:=(T/m)^{1/3}$ be the continuous balance point of $\min\{mk,T/k^{2}\}\text{;}$ at this point, $m\,k_{\mathrm{bal}}=T/k_{\mathrm{bal}}^{2}=m^{2/3}\,T^{1/3}\text{.}$ From $T&amp;gt;15m\text{,}$ $k_{\mathrm{bal}}&amp;gt;15^{1/3}&amp;gt;2\text{.}$ From $T\leq m^{4}/512\text{,}$ $k_{\mathrm{bal}}\leq(m^{3}/512)^{1/3}=m/8\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS3.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Set $K_{0}:=\lfloor k_{\mathrm{bal}}\rfloor\in\mathbb{N}\text{.}$ Since $k_{\mathrm{bal}}&amp;gt;2\text{,}$ $K_{0}\geq k_{\mathrm{bal}}/2$ (using $\lfloor x\rfloor\geq x/2$ for $x\geq 2$); thus $K_{0}\leq\lfloor m/8\rfloor\text{,}$ so $K_{0}$ is admissible. We have&lt;/p&gt;
&lt;table id="A4.Ex70" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$mK_{0}\;\geq\;m\cdot k_{\mathrm{bal}}/2\;=\;m^{2/3}\,T^{1/3}/2,\qquad T/K_{0}^{2}\;\geq\;T/k_{\mathrm{bal}}^{2}\;=\;m^{2/3}\,T^{1/3}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Therefore $L_{1}\geq\min(mK_{0},\,T/K_{0}^{2})\geq m^{2/3}\,T^{1/3}/2\text{.}$ On the other hand, by &lt;a href="#Thmtheorem20" title="Lemma 20 (Phase 1 Upper Bound). ‣ D.2 Quantitative Upper Bounds on Ψ ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;20&lt;/span&gt;&lt;/a&gt;, $\Psi_{[m]^{2}}(T)\leq 6\,m^{2/3}\,T^{1/3}\text{,}$ so $\min\{T,\Psi_{[m]^{2}}(T)\}\leq\Psi_{[m]^{2}}(T)\leq 6\,m^{2/3}\,T^{1/3}\leq 12\,L_{1}\text{.}$ Combining, $c_{B}:=1/12\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS3.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Interval C&lt;/span&gt; ($m^{4}/512&amp;lt;T\leq C_{0}^{2}\,m^{4}$). Take $K=\lfloor m/8\rfloor\text{.}$ From $m\geq 16\text{,}$ $\lfloor m/8\rfloor\geq m/8-1\geq m/16$ (the second inequality is equivalent to $m\geq 16$). Hence&lt;/p&gt;
&lt;table id="A4.Ex71" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$L_{1}\;\geq\;\min\!\bigl(m\cdot m/16,\;T/(m/8)^{2}\bigr)\;=\;\min(m^{2}/16,\;64\,T/m^{2}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;From $T&amp;gt;m^{4}/512\text{,}$ $64\,T/m^{2}&amp;gt;64\,m^{2}/512=m^{2}/8&amp;gt;m^{2}/16\text{,}$ so $L_{1}\geq m^{2}/16\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS3.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The upper bound on $\Psi$ is obtained by combining two sub-intervals:&lt;/p&gt;
&lt;ul id="A4.I1" class="ltx_itemize"&gt;
&lt;li id="A4.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A4.I1.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $T\leq m^{4}\text{,}$ &lt;a href="#Thmtheorem20" title="Lemma 20 (Phase 1 Upper Bound). ‣ D.2 Quantitative Upper Bounds on Ψ ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;20&lt;/span&gt;&lt;/a&gt; gives
$\Psi_{[m]^{2}}(T)\leq 6\,m^{2/3}\,T^{1/3}\leq 6\,m^{2/3}\cdot m^{4/3}=6\,m^{2}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A4.I1.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A4.I1.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $m^{4}&amp;lt;T\leq C_{0}^{2}\,m^{4}\text{,}$
&lt;a href="#Thmtheorem21" title="Lemma 21 (Phase 2 Upper Bound). ‣ D.2 Quantitative Upper Bounds on Ψ ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;21&lt;/span&gt;&lt;/a&gt; gives
$\Psi_{[m]^{2}}(T)\leq m^{2}\log(T/m^{4})+6\,m^{2}\leq m^{2}\cdot 2\log C_{0}+6\,m^{2}=(2\log C_{0}+6)\,m^{2}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="ltx_p"&gt;Let $B^{*}:=2\log C_{0}+6\text{.}$ With $C_{0}=2160\text{,}$ the bound $\log 2160&amp;lt;7.679$ (numerically verified) gives $B^{*}&amp;lt;21.358\text{.}$ Since $B^{*}&amp;gt;6\text{,}$ the two sub-intervals unify to $\Psi_{[m]^{2}}(T)\leq B^{*}\,m^{2}\leq 22\,m^{2}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS3.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Combining, $L_{1}\geq m^{2}/16\geq\Psi_{[m]^{2}}(T)/(16\,B^{*})\text{.}$ Since $16\,B^{*}&amp;lt;16\cdot 21.358=341.728&amp;lt;342\text{,}$ $1/(16\,B^{*})&amp;gt;1/342\text{;}$ setting $c_{C}:=1/342$ gives $L_{1}\geq c_{C}\cdot\Psi_{[m]^{2}}(T)\geq c_{C}\cdot\min\{T,\Psi_{[m]^{2}}(T)\}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS3.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Interval D&lt;/span&gt; ($T&amp;gt;C_{0}^{2}\,m^{4}$). From $T&amp;gt;C_{0}^{2}\,m^{4}\text{,}$ $T/(C_{0}\,m^{4})&amp;gt;C_{0}\geq 1\text{,}$ so&lt;/p&gt;
&lt;table id="A4.Ex72" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log\!\Bigl(1+\tfrac{T}{C_{0}\,m^{4}}\Bigr)\;\geq\;\log\!\tfrac{T}{C_{0}\,m^{4}}\;=\;\log(T/m^{4})-\log C_{0}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Since $T&amp;gt;C_{0}^{2}\,m^{4}\text{,}$ $\log(T/m^{4})&amp;gt;2\log C_{0}\text{,}$ so $\log C_{0}&amp;lt;\log(T/m^{4})/2\text{.}$ Hence&lt;/p&gt;
&lt;table id="A4.Ex73" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$L_{2}\;\geq\;m^{2}\bigl(\log(T/m^{4})-\log C_{0}\bigr)\;\geq\;m^{2}\log(T/m^{4})/2.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;On the other hand, &lt;a href="#Thmtheorem21" title="Lemma 21 (Phase 2 Upper Bound). ‣ D.2 Quantitative Upper Bounds on Ψ ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;21&lt;/span&gt;&lt;/a&gt; gives $\Psi_{[m]^{2}}(T)\leq m^{2}\log(T/m^{4})+6\,m^{2}\text{.}$ Since $\log(T/m^{4})&amp;gt;2\log C_{0}\approx 15.36&amp;gt;15\text{,}$ $6\,m^{2}&amp;lt;(6/15)\,m^{2}\log(T/m^{4})=(2/5)\,m^{2}\log(T/m^{4})\text{,}$ so $\Psi_{[m]^{2}}(T)&amp;lt;(7/5)\,m^{2}\log(T/m^{4})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS3.p9" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Combining, $L_{2}/\Psi_{[m]^{2}}(T)&amp;gt;(1/2)/(7/5)=5/14&amp;gt;1/3\text{.}$ Since $\min\{T,\Psi_{[m]^{2}}(T)\}\leq\Psi_{[m]^{2}}(T)\text{,}$ this gives $L_{2}&amp;gt;\min\{T,\Psi_{[m]^{2}}(T)\}/3\text{,}$ and we set $c_{D}:=1/3\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS3.p10" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Combining intervals.&lt;/span&gt; $c:=\min\{c_{A},c_{B},c_{C},c_{D}\}=\min\{1/15,\,1/12,\,1/342,\,1/3\}=1/342\text{.}$ Intervals A, B, and C give $L_{1}\geq c\cdot\min\{T,\Psi_{[m]^{2}}(T)\}$ for all $T\leq C_{0}^{2}\,m^{4}\text{;}$ Interval D gives $L_{2}\geq c\cdot\min\{T,\Psi_{[m]^{2}}(T)\}$ for $T&amp;gt;C_{0}^{2}\,m^{4}\text{.}$ In either range, $\max\{L_{1},L_{2}\}$ inherits the corresponding bound, so&lt;/p&gt;
&lt;table id="A4.Ex74" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\max\{L_{1},\,L_{2}\}\;\geq\;\tfrac{1}{342}\cdot\min\!\bigl\{T,\,\Psi_{[m]^{2}}(T)\bigr\}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;for all integers $m\geq 16$ and $T\geq 1\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A4.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="three-case-closure"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;D.4 &lt;/span&gt;Three-Case Closure&lt;/h3&gt;
&lt;div id="Thmtheorem22" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Proposition 22&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Three-Case Closure).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem22.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;There exists an absolute constant $c&amp;gt;0$ (one may take $c=1/372096$) such that, for all integers $m\geq 2$ and $T\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A4.Ex75" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}([m]^{2})\;\geq\;c\cdot\min\!\bigl\{T,\,\Psi_{[m]^{2}}(T)\bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A4.SS4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Three exhaustive cases cover the parameter range: &lt;span class="ltx_text ltx_font_bold"&gt;(a)&lt;/span&gt; $m\geq 16\text{;}$ &lt;span class="ltx_text ltx_font_bold"&gt;(b)&lt;/span&gt; $2\leq m\leq 15$ with $T\leq C_{0}^{2}\,m^{4}\text{;}$ &lt;span class="ltx_text ltx_font_bold"&gt;(c)&lt;/span&gt; $2\leq m\leq 15$ with $T&amp;gt;C_{0}^{2}\,m^{4}\text{.}$ Throughout, $c_{1}:=1/1088$ is the LB-I constant (&lt;a href="#Thmtheorem26" title="Lemma 26 (Ribbon-Path Lower Bound). ‣ E.1.5 Proof of Lemma 26 ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;26&lt;/span&gt;&lt;/a&gt;, valid for all $T\geq 1$), $c_{2}:=3/16$ is the LB-II constant (&lt;a href="#Thmtheorem31" title="Lemma 31 (Interior-Cube Lower Bound). ‣ E.2.6 Proof of Lemma 31 ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;31&lt;/span&gt;&lt;/a&gt;, valid for $T\geq m^{2}$), and $c_{BL}:=1/342$ is the constant from &lt;a href="#Thmtheorem19" title="Lemma 19 (Bridge Lemma). ‣ D.1 Statement ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;19&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Case (a).&lt;/span&gt; The separated form of &lt;a href="#Thmtheorem19" title="Lemma 19 (Bridge Lemma). ‣ D.1 Statement ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;19&lt;/span&gt;&lt;/a&gt; combined with LB-I and LB-II gives:&lt;/p&gt;
&lt;ul id="A4.I2" class="ltx_itemize"&gt;
&lt;li id="A4.I2.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A4.I2.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $T\leq C_{0}^{2}\,m^{4}\text{,}$
$L_{1}\geq c_{BL}\,\min\{T,\Psi_{[m]^{2}}(T)\}\text{,}$ and LB-I
applies, yielding
$R_{T}^{*}\geq c_{1}\,c_{BL}\,\min\{T,\Psi_{[m]^{2}}(T)\}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A4.I2.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A4.I2.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $T&amp;gt;C_{0}^{2}\,m^{4}\text{,}$
$L_{2}\geq c_{BL}\,\min\{T,\Psi_{[m]^{2}}(T)\}\text{.}$ Since
$T&amp;gt;C_{0}^{2}\,m^{4}\geq m^{2}\text{,}$ LB-II applies, yielding
$R_{T}^{*}\geq c_{2}\,c_{BL}\,\min\{T,\Psi_{[m]^{2}}(T)\}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="ltx_p"&gt;Since $c_{1}&amp;lt;c_{2}$ ($1/1088&amp;lt;3/16$), set $c^{(a)}:=c_{BL}\,c_{1}=(1/342)(1/1088)=1/372096\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Case (b).&lt;/span&gt; &lt;em class="ltx_emph ltx_font_italic"&gt;Trivial-adversary lower bound.&lt;/em&gt; Fix a grid point $x_{0}\in[m]^{2}$ and a constant label $b\in\{0,1\}\text{.}$ Any randomized learner’s first-round prediction $\hat{y}_{1}$ is a $[0,1]$-valued random variable. Since $\hat{y}_{1}^{2}+(1{-}\hat{y}_{1})^{2}\geq 1/2$ pointwise, linearity of expectation gives $\mathbb{E}[\hat{y}_{1}^{2}]+\mathbb{E}[(1{-}\hat{y}_{1})^{2}]\geq 1/2\text{,}$ so $\max_{b\in\{0,1\}}\mathbb{E}[(\hat{y}_{1}-b)^{2}]\geq 1/4\text{.}$ Letting $b^{*}$ achieve this maximum, the comparator $f\equiv b^{*}\in\mathcal{F}_{[m]^{2}}^{\uparrow}$ has zero loss; taking the Yao expectation over the adversary’s prior $\mathrm{Unif}\{0,1\}$ yields $R_{T}^{*}\geq 1/4\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS4.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;$\Psi$ upper bounds for $m\geq 2\text{.}$&lt;/em&gt; The proofs of &lt;a href="#Thmtheorem20" title="Lemma 20 (Phase 1 Upper Bound). ‣ D.2 Quantitative Upper Bounds on Ψ ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemmas&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;20&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmtheorem21" title="Lemma 21 (Phase 2 Upper Bound). ‣ D.2 Quantitative Upper Bounds on Ψ ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;21&lt;/span&gt;&lt;/a&gt; are independent of $m\geq 16$ except for the low-order term absorption step. Redoing that step for $m\geq 2\text{:}$&lt;/p&gt;
&lt;ul id="A4.I3" class="ltx_itemize"&gt;
&lt;li id="A4.I3.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A4.I3.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(&lt;a href="#Thmtheorem20" title="Lemma 20 (Phase 1 Upper Bound). ‣ D.2 Quantitative Upper Bounds on Ψ ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;20&lt;/span&gt;&lt;/a&gt; for $m\geq 2\text{,}$ $T\geq m\text{.}$) From
$m^{2/3}\,T^{1/3}\geq m\geq 2\text{,}$
$2C_{1}\leq m^{2/3}\,T^{1/3}$ (using $C_{1}\leq 1$); the other
terms are unchanged. Combining,&lt;/p&gt;
&lt;table id="A4.E36" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi_{[m]^{2}}(T)\;\leq\;\bigl[3\,(\log 2)^{2/3}+4\log 2+\tfrac{1}{6}+1\bigr]\,m^{2/3}\,T^{1/3}\;&amp;lt;\;7\,m^{2/3}\,T^{1/3}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(35)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A4.I3.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A4.I3.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(&lt;a href="#Thmtheorem21" title="Lemma 21 (Phase 2 Upper Bound). ‣ D.2 Quantitative Upper Bounds on Ψ ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;21&lt;/span&gt;&lt;/a&gt; for $m\geq 2\text{,}$ $T\geq m^{4}\text{.}$) From
$2m/\sqrt{T}\leq 2/m\leq 1\text{,}$ so $\log(1+2m/\sqrt{T})\leq\log 2$
and the $m^{2}$ coefficient before absorption is $5$ in place of
$\tfrac{21}{4}-2\log 2\text{;}$ and from $\log m\leq m\leq m^{2}/2$ and
$m^{2}\geq 4\text{,}$ $\tfrac{1}{6}\log m\leq m^{2}/12$ and $2C_{1}\leq m^{2}/2\text{.}$
Combining,&lt;/p&gt;
&lt;table id="A4.E37" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi_{[m]^{2}}(T)\;\leq\;m^{2}\log(T/m^{4})+\bigl[5+\tfrac{1}{12}+\tfrac{1}{2}\bigr]\,m^{2}\;&amp;lt;\;m^{2}\log(T/m^{4})+6\,m^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(36)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div id="A4.SS4.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Let $B^{\prime}:=2\log C_{0}+6\approx 21.36\text{.}$ The bound $\min\{T,\Psi_{[m]^{2}}(T)\}\leq B^{\prime}\,m^{2}$ holds for all $2\leq m\leq 15$ and $T\leq C_{0}^{2}\,m^{4}\text{,}$ from a three-way sub-interval split:&lt;/p&gt;
&lt;ul id="A4.I4" class="ltx_itemize"&gt;
&lt;li id="A4.I4.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A4.I4.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $T&amp;lt;m\text{,}$ $\min\{T,\Psi_{[m]^{2}}(T)\}\leq T&amp;lt;m\leq m^{2}&amp;lt;B^{\prime}\,m^{2}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A4.I4.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A4.I4.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $m\leq T\leq m^{4}\text{,}$ by (&lt;a href="#A4.E36" title="Equation 35 ‣ 1st item ‣ D.4 Three-Case Closure ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;35&lt;/span&gt;&lt;/a&gt;),
$\Psi_{[m]^{2}}(T)\leq 7\,m^{2/3}\,T^{1/3}\leq 7\,m^{2}&amp;lt;B^{\prime}\,m^{2}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A4.I4.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A4.I4.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $m^{4}&amp;lt;T\leq C_{0}^{2}\,m^{4}\text{,}$ by
(&lt;a href="#A4.E37" title="Equation 36 ‣ 2nd item ‣ D.4 Three-Case Closure ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;36&lt;/span&gt;&lt;/a&gt;), $\Psi_{[m]^{2}}(T)\leq m^{2}\cdot 2\log C_{0}+6\,m^{2}=B^{\prime}\,m^{2}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="ltx_p"&gt;Combined with $m\leq 15\text{,}$ $\min\{T,\Psi_{[m]^{2}}(T)\}\leq 225\,B^{\prime}\text{.}$ Hence $R_{T}^{*}\geq 1/4\geq\min\{T,\Psi_{[m]^{2}}(T)\}/(900\,B^{\prime})\text{,}$ giving $c^{(b)}:=1/(900\,B^{\prime})\approx 1/19221\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS4.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Case (c).&lt;/span&gt; The argument paralleling Interval D of the proof of &lt;a href="#Thmtheorem19" title="Lemma 19 (Bridge Lemma). ‣ D.1 Statement ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;19&lt;/span&gt;&lt;/a&gt;, based on the $m\geq 2$ Phase 2 upper bound (&lt;a href="#A4.E37" title="Equation 36 ‣ 2nd item ‣ D.4 Three-Case Closure ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;36&lt;/span&gt;&lt;/a&gt;) and the definition of $L_{2}\text{,}$ proceeds as follows. The first step $L_{2}\geq m^{2}\log(T/m^{4})/2$ is independent of the size of $m$ (as in Interval D). The second step uses (&lt;a href="#A4.E37" title="Equation 36 ‣ 2nd item ‣ D.4 Three-Case Closure ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;36&lt;/span&gt;&lt;/a&gt;): $\Psi_{[m]^{2}}(T)\leq m^{2}\log(T/m^{4})+6\,m^{2}\text{.}$ Since $\log(T/m^{4})&amp;gt;2\log C_{0}&amp;gt;15\text{,}$ $6\,m^{2}&amp;lt;(2/5)\,m^{2}\log(T/m^{4})\text{,}$ so $\Psi_{[m]^{2}}(T)&amp;lt;(7/5)\,m^{2}\log(T/m^{4})$ and $L_{2}/\Psi_{[m]^{2}}(T)&amp;gt;(1/2)/(7/5)=5/14\text{,}$ i.e., $L_{2}\geq\Psi_{[m]^{2}}(T)/2.8\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS4.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Since $T&amp;gt;C_{0}^{2}\,m^{4}\geq m^{2}\text{,}$ LB-II applies:&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A4.Ex76"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A4.Ex76X"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A4.Ex76Xa"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle R_{T}^{*} &amp;amp; \displaystyle\;\geq\;c_{2}\,L_{2}\;\geq\;(3/16)(5/14)\,\Psi_{[m]^{2}}(T) \\
&amp;amp; \displaystyle\;=\;(15/224)\,\Psi_{[m]^{2}}(T)\;\geq\;(15/224)\,\min\{T,\Psi_{[m]^{2}}(T)\},
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;giving $c^{(c)}:=15/224\approx 1/14.9\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.SS4.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Combining the three cases.&lt;/span&gt; $c:=\min\{c^{(a)},c^{(b)},c^{(c)}\}=\min\{1/372096,\,1/(900\,B^{\prime}),\,15/224\}=1/372096\text{,}$ with Case (a) being binding.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;section id="A4.SS4.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Application to the main theorem.&lt;/h5&gt;
&lt;div id="A4.SS4.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Combining the upper bound $R_{T}^{*}([m]^{2})\leq\min\{T,\Psi_{[m]^{2}}(T)\}$ (&lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; together with the trivial $R_{T}^{*}\leq T$) with &lt;a href="#Thmtheorem22" title="Proposition 22 (Three-Case Closure). ‣ D.4 Three-Case Closure ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;22&lt;/span&gt;&lt;/a&gt; yields the $d=2\text{,}$ squared-loss case of &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;table id="A4.Ex77" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}([m]^{2})\;=\;\Theta\!\bigl(\min\!\bigl\{T,\,\Psi_{[m]^{2}}(T)\bigr\}\bigr)\qquad\text{for all integers }m\geq 2\text{ and }T\geq 1.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;$\blacksquare$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A5" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="lower-bound-proofs"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix E &lt;/span&gt;Lower Bound Proofs&lt;/h2&gt;
&lt;section id="A5.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="ribbon-path-lower-bound"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;E.1 &lt;/span&gt;Ribbon-Path Lower Bound&lt;/h3&gt;
&lt;div id="A5.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This appendix provides the complete proof of &lt;a href="#Thmtheorem26" title="Lemma 26 (Ribbon-Path Lower Bound). ‣ E.1.5 Proof of Lemma 26 ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;26&lt;/span&gt;&lt;/a&gt; (Ribbon-Path Lower Bound). The contents are organized as follows. (i) &lt;a href="#Thmtheorem23" title="Lemma 23 (Construction Validity). ‣ E.1.2 Construction Validity ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;23&lt;/span&gt;&lt;/a&gt; validates the construction: column monotonicity of the cutoff, inter-layer nesting, isotonicity of $f_{\theta}\text{,}$ and the handling of odd $m$ via padding. (ii) &lt;a href="#Thmtheorem24" title="Lemma 24 (Complete Isolation). ‣ E.1.3 Complete Isolation ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;24&lt;/span&gt;&lt;/a&gt; gives a complete case-by-case proof of Complete Isolation, the core mechanism that decouples the $\ell K$-dimensional problem into independent two-point tests. (iii) &lt;a href="#Thmtheorem25" title="Lemma 25 (𝜒²–TV Posterior-Variance Link). ‣ E.1.4 Posterior-Variance Link ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;25&lt;/span&gt;&lt;/a&gt; establishes a general link between posterior variance and total variation distance in equiprobable two-point Bayesian problems, controlling the per-episode estimation-error lower bound. (iv) &lt;a href="#A5.SS1.SSS5" title="E.1.5 Proof of Lemma 26 ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;E.1.5&lt;/span&gt;&lt;/a&gt; contains the complete four-step proof of &lt;a href="#Thmtheorem26" title="Lemma 26 (Ribbon-Path Lower Bound). ‣ E.1.5 Proof of Lemma 26 ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;26&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A5.SS1.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Recall.&lt;/h5&gt;
&lt;div id="A5.SS1.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We use the following notation: $[m]^{2}:=[m]\times[m]$ denotes the product order, $\mathcal{F}_{[m]^{2}}^{\uparrow}$ the class of $[0,1]$-valued isotonic functions on $[m]^{2}\text{,}$ and $R_{T}^{*}([m]^{2})$ the minimax regret. The lower bound is established via Yao’s principle &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[Yao, &lt;a href="#bib.bib5" title="Probabilistic computations: toward a unified measure of complexity" class="ltx_ref"&gt;1977&lt;/a&gt;]&lt;/cite&gt;: against a randomized oblivious adversary, the expected regret of every deterministic learner lower-bounds the minimax regret, randomized learners included.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A5.SS1.SSS1" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="construction"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;E.1.1 &lt;/span&gt;Construction&lt;/h4&gt;
&lt;section id="A5.SS1.SSS1.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Parameters.&lt;/h5&gt;
&lt;div id="A5.SS1.SSS1.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Fix integers $m\geq 16$ and $1\leq K\leq\lfloor m/8\rfloor\text{.}$ Set $\ell:=\lfloor m/2\rfloor\text{,}$ $q:=K^{2}\text{,}$ and $\lambda:=1/(8K)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A5.SS1.SSS1.Px2" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Random bits.&lt;/h5&gt;
&lt;div id="A5.SS1.SSS1.Px2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Sample $\theta_{r,b}\sim\mathrm{Ber}(1/2)$ independently for $(r,b)\in[K]\times[\ell]\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A5.SS1.SSS1.Px3" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Cutoff.&lt;/h5&gt;
&lt;div id="A5.SS1.SSS1.Px3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For each layer $r\in[K]\text{,}$ define $c_{r}^{\theta}:[m]\to[m]$ by&lt;/p&gt;
&lt;table id="A5.Ex78" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$c_{r}^{\theta}(i)\;:=\;\begin{cases}\ell+r-b+1,&amp;amp;i=2b-1,\quad b\in[\ell],\\ \ell+r-b+1-\theta_{r,b},&amp;amp;i=2b,\quad b\in[\ell],\\ r,&amp;amp;i=m\text{ and }m\text{ is odd}.\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;When $m$ is even, $2\ell=m$ and the first two cases cover all columns; when $m$ is odd, $2\ell=m-1$ and the third case fixes the $m$-th column.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A5.SS1.SSS1.Px4" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Upset.&lt;/h5&gt;
&lt;div id="A5.SS1.SSS1.Px4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;$U_{r}^{\theta}:=\{(i,j)\in[m]^{2}:j\geq c_{r}^{\theta}(i)\}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A5.SS1.SSS1.Px5" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Adversary’s isotonic function.&lt;/h5&gt;
&lt;div id="A5.SS1.SSS1.Px5.p1" class="ltx_para"&gt;
&lt;table id="A5.Ex79" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$f_{\theta}(x)\;:=\;\frac{1}{2}+\lambda\sum_{r=1}^{K}\mathbf{1}\!\left[x\in U_{r}^{\theta}\right].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A5.SS1.SSS1.Px6" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Probe points.&lt;/h5&gt;
&lt;div id="A5.SS1.SSS1.Px6.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $(r,b)\in[K]\times[\ell]\text{,}$ set $\mathrm{Rib}_{r,b}:=(2b,\,\ell+r-b)\in[m]^{2}\text{.}$ &lt;a href="#S3.F1" title="In 3.1 Two Mechanisms ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Figure&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; (left) illustrates the construction at $m=16\text{,}$ $K=2\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A5.SS1.SSS2" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="construction-validity"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;E.1.2 &lt;/span&gt;Construction Validity&lt;/h4&gt;
&lt;div id="Thmtheorem23" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 23&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Construction Validity).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem23.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For all $m\geq 16\text{,}$ $1\leq K\leq\lfloor m/8\rfloor\text{,}$ and every realization $\theta\in\{0,1\}^{[K]\times[\ell]}\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;ol id="A5.I1" class="ltx_enumerate"&gt;
&lt;li id="A5.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(a)&lt;/span&gt;
&lt;div id="A5.I1.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Cutoff well-definedness and column monotonicity)&lt;span class="ltx_text ltx_font_italic"&gt;
For each layer &lt;/span&gt;$r\in[K]$&lt;span class="ltx_text ltx_font_italic"&gt;, &lt;/span&gt;$c_{r}^{\theta}$&lt;span class="ltx_text ltx_font_italic"&gt; maps into
&lt;/span&gt;$\{1,\ldots,m\}$&lt;span class="ltx_text ltx_font_italic"&gt;, and &lt;/span&gt;$c_{r}^{\theta}(i)$&lt;span class="ltx_text ltx_font_italic"&gt; is non-increasing in &lt;/span&gt;$i$&lt;span class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A5.I1.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(b)&lt;/span&gt;
&lt;div id="A5.I1.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Layer nesting)&lt;span class="ltx_text ltx_font_italic"&gt; For all &lt;/span&gt;$r\in[K-1]$&lt;span class="ltx_text ltx_font_italic"&gt; and
&lt;/span&gt;$i\in[m]$&lt;span class="ltx_text ltx_font_italic"&gt;, &lt;/span&gt;$c_{r+1}^{\theta}(i)\geq c_{r}^{\theta}(i)$&lt;span class="ltx_text ltx_font_italic"&gt;
(equivalently, &lt;/span&gt;$U_{r+1}^{\theta}\subseteq U_{r}^{\theta}$&lt;span class="ltx_text ltx_font_italic"&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A5.I1.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(c)&lt;/span&gt;
&lt;div id="A5.I1.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Isotonicity and value range)&lt;span class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;$f_{\theta}\in\mathcal{F}_{[m]^{2}}^{\uparrow}$&lt;span class="ltx_text ltx_font_italic"&gt;
and &lt;/span&gt;$f_{\theta}([m]^{2})\subseteq[1/2,\,5/8]$&lt;span class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A5.SS1.SSS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(a).&lt;/span&gt; We proceed in three parts: value range, column monotonicity, and the odd-$m$ junction.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS2.p2" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Value range.&lt;/em&gt;
The maximum occurs at $c_{r}^{\theta}(1)=\ell+r$ (taking $b=1$). Since $r\leq K\leq\lfloor m/8\rfloor$ and $\ell\leq m/2\text{,}$&lt;/p&gt;
&lt;table id="A5.Ex80" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\ell+K\;\leq\;\frac{m}{2}+\frac{m}{8}\;=\;\frac{5m}{8}\;\leq\;m.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The minimum occurs either at the end of an even column or at the padding column. For even columns, $c_{r}^{\theta}(2\ell)=r+1-\theta_{r,\ell}\geq r\geq 1\text{;}$ for the padding column (odd $m$), $c_{r}^{\theta}(m)=r\geq 1\text{.}$ Hence $c_{r}^{\theta}:[m]\to\{1,\ldots,m\}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS2.p3" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Column monotonicity.&lt;/em&gt;
We show $c_{r}^{\theta}(i)\geq c_{r}^{\theta}(i+1)$ for all $i\in[m-1]$ (including $i=m-1$ when $m$ is odd), splitting into three subcases by column parity.&lt;/p&gt;
&lt;ul id="A5.I2" class="ltx_itemize"&gt;
&lt;li id="A5.I2.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A5.I2.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Odd to even&lt;/em&gt; ($i=2b-1\to i+1=2b\text{,}$
$b\in[\ell]$):&lt;/p&gt;
&lt;table id="A5.Ex81" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$c_{r}^{\theta}(2b-1)-c_{r}^{\theta}(2b)\;=\;\theta_{r,b}\;\geq\;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A5.I2.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A5.I2.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Even to odd&lt;/em&gt; ($i=2b\to i+1=2b+1=2(b+1)-1\text{,}$ $b\in[\ell-1]$):&lt;/p&gt;
&lt;table id="A5.Ex82" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$c_{r}^{\theta}(2b)-c_{r}^{\theta}(2b+1)\;=\;(\ell+r-b+1-\theta_{r,b})-(\ell+r-b)\;=\;1-\theta_{r,b}\;\geq\;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A5.I2.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A5.I2.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Even to padding&lt;/em&gt; (only when $m$ is odd,
$i=2\ell=m-1\text{,}$ $i+1=m$):&lt;/p&gt;
&lt;table id="A5.Ex83" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$c_{r}^{\theta}(2\ell)-c_{r}^{\theta}(m)\;=\;(r+1-\theta_{r,\ell})-r\;=\;1-\theta_{r,\ell}\;\geq\;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS2.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(b).&lt;/span&gt; For all $r\in[K-1]$ and $i\in[m]\text{,}$ we show that $c_{r+1}^{\theta}(i)\geq c_{r}^{\theta}(i)\text{:}$&lt;/p&gt;
&lt;ul id="A5.I3" class="ltx_itemize"&gt;
&lt;li id="A5.I3.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A5.I3.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Odd column&lt;/em&gt; ($i=2b-1$):
$c_{r+1}^{\theta}(2b-1)-c_{r}^{\theta}(2b-1)=1&amp;gt;0\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A5.I3.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A5.I3.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Even column&lt;/em&gt; ($i=2b$):&lt;/p&gt;
&lt;table id="A5.Ex84" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$c_{r+1}^{\theta}(2b)-c_{r}^{\theta}(2b)\;=\;1+\theta_{r,b}-\theta_{r+1,b}\;\geq\;1-1\;=\;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A5.I3.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A5.I3.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Padding column&lt;/em&gt; ($m$ odd, $i=m$):
$c_{r+1}^{\theta}(m)-c_{r}^{\theta}(m)=(r+1)-r=1&amp;gt;0\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="ltx_p"&gt;Hence $c_{r+1}^{\theta}(i)\geq c_{r}^{\theta}(i)$ for all $r$ and $i\text{,}$ equivalently $U_{r+1}^{\theta}\subseteq U_{r}^{\theta}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS2.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(c).&lt;/span&gt; By the column monotonicity from (a), each $U_{r}^{\theta}=\{(i,j):j\geq c_{r}^{\theta}(i)\}$ is an upset of $[m]^{2}\text{:}$ if $(i,j)\in U_{r}^{\theta}$ and $(i^{\prime},j^{\prime})\succeq(i,j)\text{,}$ then $j^{\prime}\geq j\geq c_{r}^{\theta}(i)\geq c_{r}^{\theta}(i^{\prime})\text{,}$ so $(i^{\prime},j^{\prime})\in U_{r}^{\theta}\text{.}$ The indicator $\mathbf{1}\!\left[\cdot\in U_{r}^{\theta}\right]$ of any upset is isotonic, so the non-negatively weighted sum $f_{\theta}=1/2+\lambda\sum_{r}\mathbf{1}\!\left[\cdot\in U_{r}^{\theta}\right]$ is also isotonic. The value range follows: the minimum $f_{\theta}=1/2$ occurs when $x\notin U_{r}^{\theta}$ for all $r\text{,}$ and the maximum $f_{\theta}=1/2+K\lambda=5/8$ occurs when $x\in U_{r}^{\theta}$ for all $r\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A5.SS1.SSS3" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="complete-isolation"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;E.1.3 &lt;/span&gt;Complete Isolation&lt;/h4&gt;
&lt;div id="Thmtheorem24" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 24&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Complete Isolation).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem24.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For all $(r,b)\in[K]\times[\ell]$ and $s\in[K]\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A5.Ex85" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbf{1}\!\left[\mathrm{Rib}_{r,b}\in U_{s}^{\theta}\right]\;=\;\mathbf{1}\!\left[s&amp;lt;r\right]\,+\,\theta_{r,b}\cdot\mathbf{1}\!\left[s=r\right],$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;and the right-hand side does not depend on any $\theta$-bit when $s\neq r\text{.}$ In particular,&lt;/span&gt;&lt;/p&gt;
&lt;table id="A5.Ex86" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$f_{\theta}(\mathrm{Rib}_{r,b})\;=\;a_{r}+\lambda\,\theta_{r,b},\qquad a_{r}:=\frac{1}{2}+(r-1)\lambda,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;so $f_{\theta}(\mathrm{Rib}_{r,b})$ depends only on the single bit $\theta_{r,b}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A5.SS1.SSS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Substituting the probe coordinates $\mathrm{Rib}_{r,b}=(2b,\,\ell+r-b)\text{,}$&lt;/p&gt;
&lt;table id="A5.E38" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathrm{Rib}_{r,b}\in U_{s}^{\theta}\;\iff\;\ell+r-b\;\geq\;c_{s}^{\theta}(2b)\;=\;\ell+s-b+1-\theta_{s,b}\;\iff\;(r-s)+\theta_{s,b}\;\geq\;1.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(37)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;We split into three cases by the relationship between $s$ and $r\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS3.p2" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Case $s&amp;lt;r\text{.}$&lt;/span&gt;
Since $r-s\geq 1\text{,}$ the inequality $(r-s)+\theta_{s,b}\geq 1$ holds regardless of $\theta_{s,b}\text{,}$ so $\mathbf{1}\!\left[\mathrm{Rib}_{r,b}\in U_{s}^{\theta}\right]=1=\mathbf{1}\!\left[s&amp;lt;r\right]\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS3.p3" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Case $s=r\text{.}$&lt;/span&gt;
With $r-s=0\text{,}$ (&lt;a href="#A5.E38" title="Equation 37 ‣ E.1.3 Complete Isolation ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;37&lt;/span&gt;&lt;/a&gt;) reduces to $\theta_{r,b}\geq 1\text{,}$ i.e., $\theta_{r,b}=1\text{,}$ so $\mathbf{1}\!\left[\mathrm{Rib}_{r,b}\in U_{r}^{\theta}\right]=\theta_{r,b}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS3.p4" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Case $s&amp;gt;r\text{.}$&lt;/span&gt;
Since $r-s\leq-1\text{,}$ $(r-s)+\theta_{s,b}\leq-1+1=0&amp;lt;1$ regardless of $\theta_{s,b}\text{,}$ so $\mathbf{1}\!\left[\mathrm{Rib}_{r,b}\in U_{s}^{\theta}\right]=0=\mathbf{1}\!\left[s&amp;lt;r\right]\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS3.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Combining the three cases yields the first identity. Substituting,&lt;/p&gt;
&lt;table id="A5.Ex87" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$f_{\theta}(\mathrm{Rib}_{r,b})\;=\;\frac{1}{2}+\lambda\sum_{s=1}^{K}\mathbf{1}\!\left[\mathrm{Rib}_{r,b}\in U_{s}^{\theta}\right]\;=\;\frac{1}{2}+\lambda\bigl((r-1)+\theta_{r,b}\bigr)\;=\;a_{r}+\lambda\,\theta_{r,b}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A5.SS1.SSS4" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="posterior-variance-link"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;E.1.4 &lt;/span&gt;Posterior-Variance Link&lt;/h4&gt;
&lt;div id="A5.SS1.SSS4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We establish a general lower bound for equiprobable two-point Bayesian problems, used in Step C of the proof of &lt;a href="#Thmtheorem26" title="Lemma 26 (Ribbon-Path Lower Bound). ‣ E.1.5 Proof of Lemma 26 ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;26&lt;/span&gt;&lt;/a&gt; (&lt;a href="#A5.SS1.SSS5" title="E.1.5 Proof of Lemma 26 ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;E.1.5&lt;/span&gt;&lt;/a&gt;) to control the per-episode posterior variance.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem25" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 25&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; ($\chi^{2}$–TV Posterior-Variance Link).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem25.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $\Theta\in\{0,1\}$ satisfy $\mathbb{P}(\Theta=1)=1/2\text{,}$ and let $Y$ be an observation with conditional law $P_{i}:=\mathcal{L}(Y\mid\Theta=i)\text{,}$ $i=0,1\text{,}$ having densities $f_{0},f_{1}$ with respect to $\mu:=P_{0}+P_{1}$ (every pair of laws is dominated by their sum, and $f_{0}+f_{1}=1$ holds $\mu$-a.e.). Let $\pi:=\mathbb{P}(\Theta=1\mid Y)\text{.}$ Then&lt;/span&gt;&lt;/p&gt;
&lt;table id="A5.E39" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[\pi(1-\pi)]\;=\;\frac{1}{4}\;-\;\frac{1}{8}\int\frac{(f_{0}-f_{1})^{2}}{f_{0}+f_{1}}\,d\mu\;\geq\;\frac{1-\mathrm{TV}(P_{0},\,P_{1})}{4},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(38)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;where $\mathrm{TV}(P_{0},P_{1}):=\tfrac{1}{2}\int|f_{0}-f_{1}|\,d\mu$ is the total variation distance.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A5.SS1.SSS4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;By the equiprobable prior and Bayes’s rule, the marginal density of $Y$ is $\bar{m}(y)=(f_{0}(y)+f_{1}(y))/2\text{,}$ the posterior is $\pi(y)=f_{1}(y)/(f_{0}(y)+f_{1}(y))\text{,}$ and $\mathbb{E}[\pi]=1/2\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 1 (Compute $\mathbb{E}[\pi^{2}]$).&lt;/span&gt; Expanding under the marginal,&lt;/p&gt;
&lt;table id="A5.Ex88" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[\pi^{2}]\;=\;\int\frac{f_{1}(y)^{2}}{(f_{0}(y)+f_{1}(y))^{2}}\cdot\frac{f_{0}(y)+f_{1}(y)}{2}\,d\mu(y)\;=\;\frac{1}{2}\int\frac{f_{1}^{2}}{f_{0}+f_{1}}\,d\mu.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;By symmetry ($\mathbb{E}[(1-\pi)^{2}]$ corresponds to swapping $f_{1}$ and $f_{0}$),&lt;/p&gt;
&lt;table id="A5.Ex89" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[(1-\pi)^{2}]\;=\;\frac{1}{2}\int\frac{f_{0}^{2}}{f_{0}+f_{1}}\,d\mu.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Adding,&lt;/p&gt;
&lt;table id="A5.E40" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[\pi^{2}]+\mathbb{E}[(1-\pi)^{2}]\;=\;\frac{1}{2}\int\frac{f_{0}^{2}+f_{1}^{2}}{f_{0}+f_{1}}\,d\mu.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(39)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS4.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 2 (Algebraic simplification).&lt;/span&gt; Using $\pi^{2}+(1-\pi)^{2}=2\pi^{2}-2\pi+1$ and taking expectations,&lt;/p&gt;
&lt;table id="A5.Ex90" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[\pi^{2}]+\mathbb{E}[(1-\pi)^{2}]\;=\;2\mathbb{E}[\pi^{2}]-2\cdot\frac{1}{2}+1\;=\;2\mathbb{E}[\pi^{2}].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Combined with (&lt;a href="#A5.E40" title="Equation 39 ‣ E.1.4 Posterior-Variance Link ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;39&lt;/span&gt;&lt;/a&gt;), $\mathbb{E}[\pi^{2}]=\tfrac{1}{4}\int(f_{0}^{2}+f_{1}^{2})/(f_{0}+f_{1})\,d\mu\text{.}$ Using the identity $f_{0}^{2}+f_{1}^{2}=\tfrac{1}{2}\bigl((f_{0}+f_{1})^{2}+(f_{0}-f_{1})^{2}\bigr)$ together with $\int(f_{0}+f_{1})\,d\mu=2\text{,}$&lt;/p&gt;
&lt;table id="A5.Ex91" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[\pi^{2}]\;=\;\frac{1}{4}\left[\frac{1}{2}\int(f_{0}+f_{1})\,d\mu\;+\;\frac{1}{2}\int\frac{(f_{0}-f_{1})^{2}}{f_{0}+f_{1}}\,d\mu\right]\;=\;\frac{1}{4}+\frac{1}{8}\int\frac{(f_{0}-f_{1})^{2}}{f_{0}+f_{1}}\,d\mu.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS4.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 3 (Posterior variance).&lt;/span&gt; $\mathbb{E}[\pi(1-\pi)]=\mathbb{E}[\pi]-\mathbb{E}[\pi^{2}]=\tfrac{1}{2}-\tfrac{1}{4}-\tfrac{1}{8}\int(f_{0}-f_{1})^{2}/(f_{0}+f_{1})\,d\mu=\tfrac{1}{4}-\tfrac{1}{8}\int(f_{0}-f_{1})^{2}/(f_{0}+f_{1})\,d\mu\text{,}$ which is the first equality of (&lt;a href="#A5.E39" title="Equation 38 ‣ Lemma 25 (𝜒²–TV Posterior-Variance Link). ‣ E.1.4 Posterior-Variance Link ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;38&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS4.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 4 (TV bound).&lt;/span&gt; Since $|f_{0}-f_{1}|\leq f_{0}+f_{1}$ ($\mu$-a.e. as densities are non-negative), $(f_{0}-f_{1})^{2}/(f_{0}+f_{1})\leq|f_{0}-f_{1}|\text{.}$ Integrating,&lt;/p&gt;
&lt;table id="A5.Ex92" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\int\frac{(f_{0}-f_{1})^{2}}{f_{0}+f_{1}}\,d\mu\;\leq\;\int|f_{0}-f_{1}|\,d\mu\;=\;2\,\mathrm{TV}(P_{0},P_{1}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Substituting into Step 3, $\mathbb{E}[\pi(1-\pi)]\geq 1/4-\mathrm{TV}/4=(1-\mathrm{TV})/4\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A5.SS1.SSS5" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="proof-of-lemma-26"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;E.1.5 &lt;/span&gt;Proof of &lt;a href="#Thmtheorem26" title="Lemma 26 (Ribbon-Path Lower Bound). ‣ E.1.5 Proof of Lemma 26 ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;26&lt;/span&gt;&lt;/a&gt;
&lt;/h4&gt;
&lt;div id="Thmtheorem26" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 26&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Ribbon-Path Lower Bound).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem26.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For all integers $m\geq 16$ and $T\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A5.Ex93" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}([m]^{2})\;\geq\;c_{1}\sup_{1\leq K\leq\lfloor m/8\rfloor}\min\!\left\{\,mK,\;\frac{T}{K^{2}}\,\right\},\qquad c_{1}=\frac{1}{1088}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A5.SS1.SSS5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Fix $1\leq K\leq\lfloor m/8\rfloor\text{.}$ We construct an oblivious adversary and show that every deterministic learner suffers $\mathbb{E}[R_{T}]\geq\min\{mK,\,T/K^{2}\}/1088\text{.}$ Taking the supremum over $K$ and applying Yao’s principle then yields the claim.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;section id="A5.SS1.SSS5.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Adversary’s strategy.&lt;/h5&gt;
&lt;div id="A5.SS1.SSS5.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Sample $\theta$ as in &lt;a href="#A5.SS1.SSS1" title="E.1.1 Construction ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;E.1.1&lt;/span&gt;&lt;/a&gt; and form $f_{\theta}\in\mathcal{F}_{[m]^{2}}^{\uparrow}$ (&lt;a href="#Thmtheorem23" title="Lemma 23 (Construction Validity). ‣ E.1.2 Construction Validity ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;23&lt;/span&gt;&lt;/a&gt;(c)). Fix an arbitrary total ordering $e_{1},e_{2},\ldots,e_{\ell K}$ of $[K]\times[\ell]\text{,}$ and partition the first $L:=\min\{T,\,\ell Kq\}$ rounds into at most $\ell K$ episodes: in episode $j\text{,}$ query $x_{t}=\mathrm{Rib}_{e_{j}}$ for $\ell_{j}:=\min\{q,\,L-\sum_{i&amp;lt;j}\ell_{i}\}$ consecutive rounds (the final episode may be truncated, with $\ell_{j}&amp;lt;q$) with labels $Y_{t}\sim\mathrm{Ber}(f_{\theta}(\mathrm{Rib}_{e_{j}}))$ sampled independently. The remaining $T-L$ rounds query $(m,m)$ with labels $Y_{t}\sim\mathrm{Ber}(f_{\theta}(m,m))\text{.}$ This strategy is oblivious: the entire sequence $(x_{t},y_{t})_{t=1}^{T}$ is determined before the game by $\theta$ and the label randomness, independent of the learner’s actions. Since the learner is deterministic, each of its predictions is a function of the history revealed so far.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS5.Px1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step A (Regret to estimation error).&lt;/span&gt; For each realization of $\theta\text{,}$ $f_{\theta}\in\mathcal{F}_{[m]^{2}}^{\uparrow}$ (&lt;a href="#Thmtheorem23" title="Lemma 23 (Construction Validity). ‣ E.1.2 Construction Validity ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;23&lt;/span&gt;&lt;/a&gt;(c)), so&lt;/p&gt;
&lt;table id="A5.Ex94" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\geq\;\sum_{t=1}^{T}\bigl[(\hat{y}_{t}-y_{t})^{2}-(f_{\theta}(x_{t})-y_{t})^{2}\bigr].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Expanding $(\hat{y}_{t}-y_{t})^{2}-(f_{\theta}(x_{t})-y_{t})^{2}=(\hat{y}_{t}-f_{\theta}(x_{t}))^{2}+2(\hat{y}_{t}-f_{\theta}(x_{t}))(f_{\theta}(x_{t})-y_{t})\text{.}$ Given $\theta$ and $\mathcal{H}_{t-1}:=\sigma(x_{1},y_{1},\ldots,x_{t-1},y_{t-1},x_{t})\text{,}$ the prediction $\hat{y}_{t}$ is $\mathcal{H}_{t-1}$-measurable, $f_{\theta}(x_{t})$ is deterministic, and $\mathbb{E}[y_{t}\mid\theta,\mathcal{H}_{t-1}]=f_{\theta}(x_{t})$ (the Bernoulli mean). Hence the cross term has zero conditional expectation:&lt;/p&gt;
&lt;table id="A5.Ex95" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\bigl[(\hat{y}_{t}-f_{\theta}(x_{t}))(f_{\theta}(x_{t})-y_{t})\mid\theta,\mathcal{H}_{t-1}\bigr]\;=\;(\hat{y}_{t}-f_{\theta}(x_{t}))\cdot 0\;=\;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Taking total expectation,&lt;/p&gt;
&lt;table id="A5.E41" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[R_{T}]\;\geq\;\sum_{t=1}^{T}\mathbb{E}\bigl[(\hat{y}_{t}-f_{\theta}(x_{t}))^{2}\bigr]\;\geq\;\sum_{t=1}^{L}\mathbb{E}\bigl[(\hat{y}_{t}-f_{\theta}(x_{t}))^{2}\bigr],$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(40)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where the last inequality discards non-negative terms.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS5.Px1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step B (Episode independence).&lt;/span&gt; By &lt;a href="#Thmtheorem24" title="Lemma 24 (Complete Isolation). ‣ E.1.3 Complete Isolation ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;24&lt;/span&gt;&lt;/a&gt;, $f_{\theta}(\mathrm{Rib}_{r,b})=a_{r}+\lambda\,\theta_{r,b}$ depends only on the single bit $\theta_{r,b}\text{.}$ The bits $\theta_{r_{j},b_{j}}$ across different episodes $e_{j}=(r_{j},b_{j})$ are mutually independent (by the product prior), and the conditional distribution of the labels $Y_{t}$ in episode $j$ depends only on $\theta_{r_{j},b_{j}}\text{.}$ Consequently, the joint distribution of the informative data factorizes exactly:&lt;/p&gt;
&lt;table id="A5.E42" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{P}(d\theta,\,dZ)\;=\;\prod_{j=1}^{\ell K}\left[\tfrac{1}{2}\delta_{0}(d\theta_{e_{j}})+\tfrac{1}{2}\delta_{1}(d\theta_{e_{j}})\right]\cdot P_{e_{j},\,\theta_{e_{j}}}^{\otimes\ell_{j}}(dZ_{j}),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(41)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where $P_{e_{j},i}$ denotes $\mathrm{Ber}(a_{r_{j}}+i\lambda)$ for $i\in\{0,1\}\text{,}$ and $Z_{j}=(Y_{e_{j}}^{1},\ldots,Y_{e_{j}}^{\ell_{j}})$ is the label sequence in episode $j\text{.}$ In particular, $\theta_{e_{j}}$ is conditionally independent of all data from other episodes: the global isotonic constraint introduces no indirect leakage, because &lt;em class="ltx_emph ltx_font_italic"&gt;every&lt;/em&gt; realization of $\theta$ yields a valid isotonic $f_{\theta}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS5.Px1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step C (Single-episode posterior-variance lower bound).&lt;/span&gt; Fix episode $j\text{,}$ and let $\Theta:=\theta_{e_{j}}\text{,}$ $p_{\Theta}:=a_{r_{j}}+\lambda\Theta\text{.}$ Let $\pi_{s}:=\mathbb{P}(\Theta=1\mid Y_{e_{j}}^{1:s})$ denote the posterior probability after $s$ observations (with $\pi_{0}=1/2$).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS5.Px1.p5" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;C.1.&lt;/span&gt;
For step $s$ within the episode ($1\leq s\leq\ell_{j}$), the prediction $\hat{y}_{s}$ is measurable with respect to $\mathcal{G}_{s-1}:=\sigma(\mathcal{H}_{t_{0}-1},\,Y_{e_{j}}^{1:s-1})$ (with $t_{0}$ the starting round of the episode), and conditionally on $\mathcal{G}_{s-1}\text{,}$ $p_{\Theta}$ takes value $a_{r_{j}}$ with probability $1-\pi_{s-1}$ and $a_{r_{j}}+\lambda$ with probability $\pi_{s-1}\text{.}$ Hence&lt;/p&gt;
&lt;table id="A5.E43" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\bigl[(\hat{y}_{s}-p_{\Theta})^{2}\mid\mathcal{G}_{s-1}\bigr]\;\geq\;\mathrm{Var}(p_{\Theta}\mid\mathcal{G}_{s-1})\;=\;\lambda^{2}\,\pi_{s-1}(1-\pi_{s-1}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(42)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS5.Px1.p6" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;C.2.&lt;/span&gt;
The sequence $(\pi_{s})_{s\geq 0}$ is a $[0,1]$-valued martingale. By Jensen’s inequality, $\pi_{s}^{2}=\mathbb{E}[\pi_{s+1}\mid\mathcal{G}_{s}]^{2}\leq\mathbb{E}[\pi_{s+1}^{2}\mid\mathcal{G}_{s}]\text{;}$ taking expectations, $\mathbb{E}[\pi_{s}^{2}]$ is non-decreasing in $s\text{,}$ so&lt;/p&gt;
&lt;table id="A5.Ex96" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[\pi_{s}(1-\pi_{s})]\;=\;\mathbb{E}[\pi_{s}]-\mathbb{E}[\pi_{s}^{2}]\;=\;\frac{1}{2}-\mathbb{E}[\pi_{s}^{2}]$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;is non-increasing in $s\text{.}$ Taking expectations in (&lt;a href="#A5.E43" title="Equation 42 ‣ Adversary’s strategy. ‣ E.1.5 Proof of Lemma 26 ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;42&lt;/span&gt;&lt;/a&gt;) and summing from $s=1$ to $\ell_{j}\text{,}$ the non-increasing property gives&lt;/p&gt;
&lt;table id="A5.E44" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{s=1}^{\ell_{j}}\mathbb{E}\bigl[(\hat{y}_{s}-p_{\Theta})^{2}\bigr]\;\geq\;\lambda^{2}\sum_{s=0}^{\ell_{j}-1}\mathbb{E}[\pi_{s}(1-\pi_{s})]\;\geq\;\ell_{j}\,\lambda^{2}\,\mathbb{E}[\pi_{\ell_{j}}(1-\pi_{\ell_{j}})].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(43)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS5.Px1.p7" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;C.3 (TV control).&lt;/span&gt;
Let $P_{0}:=\mathrm{Ber}(a_{r_{j}})$ and $P_{1}:=\mathrm{Ber}(a_{r_{j}}+\lambda)\text{.}$ Applying &lt;a href="#Thmtheorem25" title="Lemma 25 (𝜒²–TV Posterior-Variance Link). ‣ E.1.4 Posterior-Variance Link ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;25&lt;/span&gt;&lt;/a&gt; to $\Theta$ and the observations $Y_{e_{j}}^{1:\ell_{j}}$ (whose conditional laws are $P_{0}^{\otimes\ell_{j}}$ and $P_{1}^{\otimes\ell_{j}}$),&lt;/p&gt;
&lt;table id="A5.E45" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[\pi_{\ell_{j}}(1-\pi_{\ell_{j}})]\;\geq\;\frac{1-\mathrm{TV}(P_{0}^{\otimes\ell_{j}},\,P_{1}^{\otimes\ell_{j}})}{4}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(44)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS5.Px1.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We now bound the TV distance. By the standard inequality $\mathrm{KL}(P_{0}\,\|\,P_{1})\leq\chi^{2}(P_{0}\,\|\,P_{1})$ &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[Tsybakov, &lt;a href="#bib.bib14" title="Introduction to nonparametric estimation" class="ltx_ref"&gt;2009&lt;/a&gt;]&lt;/cite&gt;, applied to Bernoulli distributions,&lt;/p&gt;
&lt;table id="A5.Ex97" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\chi^{2}(P_{0}\,\|\,P_{1})\;=\;\frac{(a_{r_{j}}-a_{r_{j}}-\lambda)^{2}}{(a_{r_{j}}+\lambda)(1-a_{r_{j}}-\lambda)}\;=\;\frac{\lambda^{2}}{p_{1}(1-p_{1})},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where $p_{1}:=a_{r_{j}}+\lambda=1/2+r_{j}\lambda\in[1/2+\lambda,\,5/8]\text{.}$ Since $p_{1}(1-p_{1})$ is concave in $p_{1}\text{,}$ its minimum on this closed interval is attained at an endpoint:&lt;/p&gt;
&lt;table id="A5.Ex98" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\text{at }p_{1}=\tfrac{5}{8}:\quad p_{1}(1-p_{1})=\tfrac{15}{64};\qquad\text{at }p_{1}=\tfrac{1}{2}+\lambda:\quad p_{1}(1-p_{1})=\tfrac{1}{4}-\lambda^{2}\geq\tfrac{1}{4}-\tfrac{1}{64}=\tfrac{15}{64},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;so $p_{1}(1-p_{1})\geq 15/64$ uniformly (the second inequality uses $\lambda=1/(8K)\leq 1/8\text{,}$ so $\lambda^{2}\leq 1/64$). It follows that&lt;/p&gt;
&lt;table id="A5.Ex99" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathrm{kl}(a_{r_{j}},\,a_{r_{j}}+\lambda)\;\leq\;\frac{64\lambda^{2}}{15}\;=\;\frac{64}{15\cdot 64\,K^{2}}\;=\;\frac{1}{15\,K^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS5.Px1.p9" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $\ell_{j}$ independent observations, the total KL is $\mathrm{KL}(P_{0}^{\otimes\ell_{j}}\,\|\,P_{1}^{\otimes\ell_{j}})=\ell_{j}\cdot\mathrm{kl}(a_{r_{j}},\,a_{r_{j}}+\lambda)\leq q/(15\,K^{2})=1/15$ (using $\ell_{j}\leq q=K^{2}$). By Pinsker’s inequality,&lt;/p&gt;
&lt;table id="A5.E46" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathrm{TV}(P_{0}^{\otimes\ell_{j}},\,P_{1}^{\otimes\ell_{j}})\;\leq\;\sqrt{\frac{\mathrm{KL}}{2}}\;\leq\;\sqrt{\frac{1}{30}}\;&amp;lt;\;\frac{1}{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(45)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS5.Px1.p10" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Substituting into (&lt;a href="#A5.E45" title="Equation 44 ‣ Adversary’s strategy. ‣ E.1.5 Proof of Lemma 26 ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;44&lt;/span&gt;&lt;/a&gt;), $\mathbb{E}[\pi_{\ell_{j}}(1-\pi_{\ell_{j}})]\geq(1-1/2)/4=1/8\text{.}$ Substituting into (&lt;a href="#A5.E44" title="Equation 43 ‣ Adversary’s strategy. ‣ E.1.5 Proof of Lemma 26 ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;43&lt;/span&gt;&lt;/a&gt;),&lt;/p&gt;
&lt;table id="A5.E47" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{s=1}^{\ell_{j}}\mathbb{E}\bigl[(\hat{y}_{s}-p_{\Theta})^{2}\bigr]\;\geq\;\frac{\ell_{j}\lambda^{2}}{8}\;=\;\frac{\ell_{j}}{8\cdot 64\,K^{2}}\;=\;\frac{\ell_{j}}{512\,q}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(46)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS5.Px1.p11" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step D (Accumulation and constant derivation).&lt;/span&gt; Summing over all episodes and substituting into (&lt;a href="#A5.E41" title="Equation 40 ‣ Adversary’s strategy. ‣ E.1.5 Proof of Lemma 26 ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;40&lt;/span&gt;&lt;/a&gt;),&lt;/p&gt;
&lt;table id="A5.Ex100" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[R_{T}]\;\geq\;\sum_{j=1}^{\ell K}\frac{\ell_{j}}{512\,q}\;=\;\frac{L}{512\,q}\;=\;\frac{\min\{\ell Kq,\,T\}}{512\,q}\;=\;\frac{\min\{\ell K,\,T/K^{2}\}}{512}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS5.Px1.p12" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Lower bound on $\ell/m\text{.}$&lt;/em&gt;
We have $\ell=\lfloor m/2\rfloor\geq(m-1)/2\text{.}$ For $m\geq 16\text{,}$ if $m$ is even, $\ell/m=1/2&amp;gt;8/17\text{;}$ if $m$ is odd, $\ell/m=(m-1)/(2m)\text{,}$ which attains its minimum $8/17$ at $m=17$ (thereafter $\ell/m$ increases strictly towards $1/2$). Hence $\ell\geq(8/17)\,m$ uniformly for $m\geq 16\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS5.Px1.p13" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;This gives $\min\{\ell K,\,T/K^{2}\}\geq(8/17)\min\{mK,\,T/K^{2}\}\text{.}$ Indeed, set $a:=\ell K\geq(8/17)\,mK=:(8/17)\,A$ and $b:=T/K^{2}=:B\text{.}$ If $A\leq B\text{,}$ then $\min\{a,b\}\geq\min\{(8/17)A,\,B\}=(8/17)A=(8/17)\min\{A,B\}\text{;}$ if $A&amp;gt;B\text{,}$ then $\min\{a,b\}\geq\min\{(8/17)A,\,B\}\geq\min\{(8/17)B,\,B\}=(8/17)B=(8/17)\min\{A,B\}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS1.SSS5.Px1.p14" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Combining,&lt;/p&gt;
&lt;table id="A5.Ex101" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[R_{T}]\;\geq\;\frac{8/17}{512}\cdot\min\!\left\{mK,\,\frac{T}{K^{2}}\right\}\;=\;\frac{1}{1088}\cdot\min\!\left\{mK,\,\frac{T}{K^{2}}\right\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;using $8/(17\cdot 512)=1/1088\text{.}$ The bound holds in expectation over the prior on $\theta$ and the label randomness; since the adversary is oblivious, Yao’s principle gives $R_{T}^{*}([m]^{2})\geq(1/1088)\min\{mK,\,T/K^{2}\}\text{.}$ Taking the supremum over $K\in\{1,\ldots,\lfloor m/8\rfloor\}$ completes the proof.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A5.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="interior-cube-lower-bound"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;E.2 &lt;/span&gt;Interior-Cube Lower Bound&lt;/h3&gt;
&lt;div id="A5.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This appendix provides the complete proof of &lt;a href="#Thmtheorem31" title="Lemma 31 (Interior-Cube Lower Bound). ‣ E.2.6 Proof of Lemma 31 ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;31&lt;/span&gt;&lt;/a&gt; (Interior-Cube Lower Bound). The contents are organized as follows. (i) &lt;a href="#Thmtheorem27" title="Lemma 27 (Construction Validity). ‣ E.2.2 Construction Validity ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;27&lt;/span&gt;&lt;/a&gt; validates the construction: $P$ is strictly isotonic on the entire prior support, $P_{u}$ takes values in $[1/4,\,3/4]\text{,}$ and the Bernoulli Fisher information satisfies $I_{1}\leq 16/3\text{.}$ (ii) &lt;a href="#Thmtheorem28" title="Lemma 28 (Prior Fisher Information). ‣ E.2.3 Prior Fisher Information ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;28&lt;/span&gt;&lt;/a&gt; computes the prior Fisher information $J(\pi_{\varepsilon})=10/\varepsilon^{2}$ explicitly. (iii) &lt;a href="#Thmtheorem29" title="Lemma 29 (Posterior Factorization). ‣ Setup. ‣ E.2.4 Posterior Factorization ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;29&lt;/span&gt;&lt;/a&gt; establishes posterior factorization: for any sub-history consisting of arbitrary per-point prefix observations, the posterior of the target grid-point parameter $\Theta_{u}$ depends only on the observations at $u\text{.}$ (iv) &lt;a href="#Thmtheorem30" title="Fact 30 (Van Trees Inequality). ‣ E.2.5 Van Trees Inequality ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Fact&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;30&lt;/span&gt;&lt;/a&gt; states the van Trees inequality together with the regularity conditions required under the present setup. (v) &lt;a href="#A5.SS2.SSS6" title="E.2.6 Proof of Lemma 31 ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;E.2.6&lt;/span&gt;&lt;/a&gt; contains the complete four-step proof of &lt;a href="#Thmtheorem31" title="Lemma 31 (Interior-Cube Lower Bound). ‣ E.2.6 Proof of Lemma 31 ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;31&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A5.SS2.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Recall.&lt;/h5&gt;
&lt;div id="A5.SS2.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We use the following notation: $V:=[m]^{2}$ denotes the grid, $\mathcal{F}_{[m]^{2}}^{\uparrow}$ the class of $[0,1]$-valued isotonic functions on $V\text{,}$ and $R_{T}^{*}([m]^{2})$ the minimax regret. The lower bound is established via Yao’s principle &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[Yao, &lt;a href="#bib.bib5" title="Probabilistic computations: toward a unified measure of complexity" class="ltx_ref"&gt;1977&lt;/a&gt;]&lt;/cite&gt;: against a randomized oblivious adversary, the expected regret of every deterministic learner lower-bounds the minimax regret, randomized learners included.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A5.SS2.SSS1" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="construction-1"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;E.2.1 &lt;/span&gt;Construction&lt;/h4&gt;
&lt;div id="A5.SS2.SSS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Fix integers $m\geq 2$ and $T\geq m^{2}\text{.}$ Set $\varepsilon:=1/(24m)$ and $q:=\lfloor T/m^{2}\rfloor\geq 1\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A5.SS2.SSS1.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Base points.&lt;/h5&gt;
&lt;div id="A5.SS2.SSS1.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;$b_{ij}:=\tfrac{1}{3}+(i+j-2)/(6m)$ for $(i,j)\in V\text{.}$ The gap between adjacent grid points satisfies $b_{i^{\prime}j^{\prime}}-b_{ij}=((i^{\prime}+j^{\prime})-(i+j))/(6m)\text{,}$ so for any $u\prec u^{\prime}$ in the strict partial order, $b_{u^{\prime}}-b_{u}\geq 1/(6m)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A5.SS2.SSS1.Px2" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Prior.&lt;/h5&gt;
&lt;div id="A5.SS2.SSS1.Px2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The density of $\pi_{\varepsilon}$ (with respect to Lebesgue measure) is&lt;/p&gt;
&lt;table id="A5.E48" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\pi_{\varepsilon}(\theta)\;:=\;\frac{15}{16\,\varepsilon}\left(1-\frac{\theta^{2}}{\varepsilon^{2}}\right)^{2}\mathbf{1}\!\left[|\theta|\leq\varepsilon\right].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(47)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Note that $\pi_{\varepsilon}\in C^{1}([-\varepsilon,\varepsilon])$ with $\pi_{\varepsilon}(\pm\varepsilon)=\pi_{\varepsilon}^{\prime}(\pm\varepsilon)=0\text{.}$ Sample $\Theta_{ij}\sim\pi_{\varepsilon}$ independently for $(i,j)\in V\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A5.SS2.SSS1.Px3" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Adversary’s parameters.&lt;/h5&gt;
&lt;div id="A5.SS2.SSS1.Px3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;$P_{ij}:=b_{ij}+\Theta_{ij}$ for $(i,j)\in V\text{.}$ &lt;a href="#S3.F1" title="In 3.1 Two Mechanisms ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Figure&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; (right) shows the slice of this construction at a single strict pair $u\prec u^{\prime}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A5.SS2.SSS2" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="construction-validity-1"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;E.2.2 &lt;/span&gt;Construction Validity&lt;/h4&gt;
&lt;div id="Thmtheorem27" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 27&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Construction Validity).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem27.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For all integers $m\geq 2\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;ol id="A5.I4" class="ltx_enumerate"&gt;
&lt;li id="A5.I4.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(a)&lt;/span&gt;
&lt;div id="A5.I4.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Strict isotonicity)&lt;span class="ltx_text ltx_font_italic"&gt; For every realization
&lt;/span&gt;$\theta\in[-\varepsilon,\varepsilon]^{V}$&lt;span class="ltx_text ltx_font_italic"&gt;, the function
&lt;/span&gt;$b+\theta$&lt;span class="ltx_text ltx_font_italic"&gt; is strictly isotonic on &lt;/span&gt;$[m]^{2}$&lt;span class="ltx_text ltx_font_italic"&gt; (i.e.,
&lt;/span&gt;$u\prec u^{\prime}\Rightarrow b_{u}+\theta_{u}&amp;lt;b_{u^{\prime}}+\theta_{u^{\prime}}$&lt;span class="ltx_text ltx_font_italic"&gt;).
In particular, &lt;/span&gt;$P\in\mathcal{F}_{[m]^{2}}^{\uparrow}$&lt;span class="ltx_text ltx_font_italic"&gt; with prior probability &lt;/span&gt;$1$&lt;span class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A5.I4.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(b)&lt;/span&gt;
&lt;div id="A5.I4.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Value range)&lt;span class="ltx_text ltx_font_italic"&gt; For all &lt;/span&gt;$u\in V$&lt;span class="ltx_text ltx_font_italic"&gt; and &lt;/span&gt;$\theta_{u}\in[-\varepsilon,\varepsilon]$&lt;span class="ltx_text ltx_font_italic"&gt;, &lt;/span&gt;$P_{u}=b_{u}+\theta_{u}\in[1/4,\,3/4]$&lt;span class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A5.I4.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(c)&lt;/span&gt;
&lt;div id="A5.I4.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Bernoulli Fisher bound)&lt;span class="ltx_text ltx_font_italic"&gt; The Bernoulli Fisher
information at &lt;/span&gt;$P_{u}$&lt;span class="ltx_text ltx_font_italic"&gt;, defined as
&lt;/span&gt;$I_{1}(\theta_{u}):=1/[P_{u}(1-P_{u})]$&lt;span class="ltx_text ltx_font_italic"&gt;, satisfies
&lt;/span&gt;$I_{1}(\theta_{u})\leq 16/3$&lt;span class="ltx_text ltx_font_italic"&gt; uniformly over &lt;/span&gt;$(i,j)\in V$&lt;span class="ltx_text ltx_font_italic"&gt; and
&lt;/span&gt;$\theta_{u}\in[-\varepsilon,\varepsilon]$&lt;span class="ltx_text ltx_font_italic"&gt; (and hence uniformly
on the prior support).&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A5.SS2.SSS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(a).&lt;/span&gt; For any $u\prec u^{\prime}$ (i.e., $(i,j)\prec(i^{\prime},j^{\prime})$), $(i^{\prime}+j^{\prime})-(i+j)\geq 1\text{,}$ so&lt;/p&gt;
&lt;table id="A5.Ex102" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$b_{u^{\prime}}-b_{u}\;=\;\frac{(i^{\prime}+j^{\prime})-(i+j)}{6m}\;\geq\;\frac{1}{6m}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Meanwhile, $|\theta_{u^{\prime}}-\theta_{u}|\leq 2\varepsilon=1/(12m)\text{.}$ Since $1/(6m)&amp;gt;1/(12m)\text{,}$&lt;/p&gt;
&lt;table id="A5.Ex103" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(b_{u^{\prime}}+\theta_{u^{\prime}})-(b_{u}+\theta_{u})\;\geq\;\frac{1}{6m}-\frac{1}{12m}\;=\;\frac{1}{12m}\;&amp;gt;\;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A5.SS2.SSS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(b).&lt;/span&gt; Since $b_{ij}\in[1/3,\,1/3+(2m-2)/(6m)]=[1/3,\,2/3-1/(3m)]$ and $\theta\in[-1/(24m),\,1/(24m)]\text{,}$&lt;/p&gt;
&lt;table id="A5.Ex104" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$P_{u}\;\geq\;\frac{1}{3}-\frac{1}{24m}\;\geq\;\frac{1}{3}-\frac{1}{48}\;=\;\frac{5}{16}\;&amp;gt;\;\frac{1}{4},\qquad P_{u}\;\leq\;\frac{2}{3}-\frac{1}{3m}+\frac{1}{24m}\;=\;\frac{2}{3}-\frac{7}{24m}\;&amp;lt;\;\frac{2}{3}\;&amp;lt;\;\frac{3}{4}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A5.SS2.SSS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(c).&lt;/span&gt; The function $p\mapsto p(1-p)$ is concave on $[1/4,\,3/4]\text{,}$ so its minimum is attained at an endpoint: $(1/4)(3/4)=3/16\text{.}$ Since $P_{u}\in[1/4,\,3/4]$ by (b), $P_{u}(1-P_{u})\geq 3/16\text{,}$ and hence $I_{1}(\theta_{u})=1/[P_{u}(1-P_{u})]\leq 16/3\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A5.SS2.SSS3" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="prior-fisher-information"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;E.2.3 &lt;/span&gt;Prior Fisher Information&lt;/h4&gt;
&lt;div id="Thmtheorem28" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 28&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Prior Fisher Information).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem28.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For every $\varepsilon&amp;gt;0\text{,}$ the density $\pi_{\varepsilon}$ of (&lt;a href="#A5.E48" title="Equation 47 ‣ Prior. ‣ E.2.1 Construction ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;47&lt;/span&gt;&lt;/a&gt;) is a properly normalized probability density ($\int\pi_{\varepsilon}=1$), and its Fisher information is&lt;/span&gt;&lt;/p&gt;
&lt;table id="A5.Ex105" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$J(\pi_{\varepsilon})\;:=\;\int_{-\varepsilon}^{\varepsilon}\frac{\bigl(\pi_{\varepsilon}^{\prime}(\theta)\bigr)^{2}}{\pi_{\varepsilon}(\theta)}\,d\theta\;=\;\frac{10}{\varepsilon^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A5.SS2.SSS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Normalization.&lt;/span&gt; Substituting $\theta=\varepsilon u\text{,}$&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A5.Ex106"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A5.Ex106X"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A5.Ex106Xa"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle\int_{-\varepsilon}^{\varepsilon}\left(1-\frac{\theta^{2}}{\varepsilon^{2}}\right)^{2}\,d\theta &amp;amp; \displaystyle\;=\;\varepsilon\int_{-1}^{1}(1-u^{2})^{2}\,du\;=\;\varepsilon\int_{-1}^{1}(1-2u^{2}+u^{4})\,du \\
&amp;amp; \displaystyle\;=\;\varepsilon\left(2-\frac{4}{3}+\frac{2}{5}\right)\;=\;\frac{16\,\varepsilon}{15}.
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;Hence $\int\pi_{\varepsilon}=(15/(16\,\varepsilon))\cdot(16\varepsilon/15)=1\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS2.SSS3.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Derivative.&lt;/span&gt; For $|\theta|&amp;lt;\varepsilon\text{,}$&lt;/p&gt;
&lt;table id="A5.Ex107" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\pi_{\varepsilon}^{\prime}(\theta)\;=\;\frac{15}{16\,\varepsilon}\cdot 2\left(1-\frac{\theta^{2}}{\varepsilon^{2}}\right)\cdot\left(-\frac{2\theta}{\varepsilon^{2}}\right)\;=\;-\frac{15\,\theta}{4\,\varepsilon^{3}}\left(1-\frac{\theta^{2}}{\varepsilon^{2}}\right).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;At the endpoints $\theta=\pm\varepsilon\text{,}$ both $\pi_{\varepsilon}=0$ and $\pi_{\varepsilon}^{\prime}=0$ (the factor $1-\theta^{2}/\varepsilon^{2}$ vanishes), so $\pi_{\varepsilon}\in C^{1}([-\varepsilon,\varepsilon])$ with the derivative also vanishing at the endpoints.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS2.SSS3.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Fisher information.&lt;/span&gt; For $|\theta|&amp;lt;\varepsilon\text{,}$&lt;/p&gt;
&lt;table id="A5.Ex108" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{\bigl(\pi_{\varepsilon}^{\prime}(\theta)\bigr)^{2}}{\pi_{\varepsilon}(\theta)}\;=\;\frac{\bigl[-\tfrac{15\theta}{4\,\varepsilon^{3}}(1-\theta^{2}/\varepsilon^{2})\bigr]^{2}}{\tfrac{15}{16\,\varepsilon}(1-\theta^{2}/\varepsilon^{2})^{2}}\;=\;\frac{(225\theta^{2}/(16\,\varepsilon^{6}))\,(1-\theta^{2}/\varepsilon^{2})^{2}}{(15/(16\,\varepsilon))\,(1-\theta^{2}/\varepsilon^{2})^{2}}\;=\;\frac{15\,\theta^{2}}{\varepsilon^{5}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Integrating,&lt;/p&gt;
&lt;table id="A5.Ex109" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$J(\pi_{\varepsilon})\;=\;\frac{15}{\varepsilon^{5}}\int_{-\varepsilon}^{\varepsilon}\theta^{2}\,d\theta\;=\;\frac{15}{\varepsilon^{5}}\cdot\frac{2\varepsilon^{3}}{3}\;=\;\frac{10}{\varepsilon^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A5.SS2.SSS4" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="posterior-factorization"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;E.2.4 &lt;/span&gt;Posterior Factorization&lt;/h4&gt;
&lt;div id="A5.SS2.SSS4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We establish a posterior factorization lemma for the product-prior, separable-likelihood setup: for any sub-history consisting of arbitrary per-point prefix observations, the posterior of a target parameter depends only on the prefix at that point. The lemma is used in the proof of &lt;a href="#Thmtheorem31" title="Lemma 31 (Interior-Cube Lower Bound). ‣ E.2.6 Proof of Lemma 31 ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;31&lt;/span&gt;&lt;/a&gt; to handle conditioning on mid-round histories.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A5.SS2.SSS4.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Setup.&lt;/h5&gt;
&lt;div id="A5.SS2.SSS4.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Let $V$ be a finite set, and let $\Theta=(\Theta_{v})_{v\in V}$ be $\mathbb{R}$-valued random variables with independent priors: $\Theta_{v}\sim\pi_{v}$ independently (here $\pi_{v}=\pi_{\varepsilon}$ for all $v\text{,}$ but the lemma holds for any product prior). Given $\Theta=\theta\text{,}$ observations $Y_{v}^{1},Y_{v}^{2},\ldots$ are generated independently across $v\in V\text{,}$ those at $v$ being conditionally i.i.d. across $r$ given $\theta_{v}$ and depending on $\theta$ through that coordinate alone. Write $L_{v}(\theta_{v};\,y_{v}):=\mathbb{P}(Y_{v}^{1}=y_{v}\mid\Theta_{v}=\theta_{v})$ for the single-observation likelihood.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem29" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 29&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Posterior Factorization).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem29.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For any fixed $u\in V$ and any sequence of non-negative integers $(s_{v})_{v\in V}\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A5.Ex110" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{L}\!\left(\Theta_{u}\,\Big|\,\{Y_{v}^{1:s_{v}}\}_{v\in V}\right)\;=\;\mathcal{L}\!\left(\Theta_{u}\,\Big|\,Y_{u}^{1:s_{u}}\right)\qquad\mathbb{P}\textup{-a.s.}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;That is, the posterior of $\Theta_{u}$ depends only on the $s_{u}$ observations at $u\text{,}$ and is independent of any prefix observations at the other grid points.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A5.SS2.SSS4.Px1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;By prior independence and conditional likelihood separability, the joint density (with respect to the common dominating measure of the prior and the likelihoods) factorizes as&lt;/p&gt;
&lt;table id="A5.E49" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$p\bigl(\theta,\,\{y_{v}^{1:s_{v}}\}_{v\in V}\bigr)\;=\;\prod_{v\in V}\pi_{v}(\theta_{v})\prod_{r=1}^{s_{v}}L_{v}(\theta_{v};\,y_{v}^{r}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(48)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Separating the factor at $u$ from the rest,&lt;/p&gt;
&lt;table id="A5.Ex111" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$p\bigl(\theta,\,\{y_{v}^{1:s_{v}}\}_{v}\bigr)\;=\;\underbrace{\pi_{u}(\theta_{u})\prod_{r=1}^{s_{u}}L_{u}(\theta_{u};\,y_{u}^{r})}_{A(\theta_{u})}\;\cdot\;\underbrace{\prod_{v\neq u}\pi_{v}(\theta_{v})\prod_{r=1}^{s_{v}}L_{v}(\theta_{v};\,y_{v}^{r})}_{B(\theta_{-u})}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Integrating over $\theta_{-u}:=(\theta_{v})_{v\neq u}\text{,}$&lt;/p&gt;
&lt;table id="A5.E50" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\int B(\theta_{-u})\,d\theta_{-u}\;=\;\prod_{v\neq u}\int\pi_{v}(\theta_{v})\prod_{r=1}^{s_{v}}L_{v}(\theta_{v};\,y_{v}^{r})\,d\theta_{v}\;=:\;C\bigl(\{y_{v}^{1:s_{v}}\}_{v\neq u}\bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(49)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where $C$ does not depend on $\theta_{u}\text{.}$ The conditional density of $\theta_{u}$ given the data is therefore&lt;/p&gt;
&lt;table id="A5.E51" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$p\bigl(\theta_{u}\,\big|\,\{y_{v}^{1:s_{v}}\}_{v}\bigr)\;=\;\frac{A(\theta_{u})\cdot C}{\int A(\theta_{u}^{\prime})\,d\theta_{u}^{\prime}\cdot C}\;=\;\frac{\pi_{u}(\theta_{u})\prod_{r=1}^{s_{u}}L_{u}(\theta_{u};\,y_{u}^{r})}{\int\pi_{u}(\theta_{u}^{\prime})\prod_{r=1}^{s_{u}}L_{u}(\theta_{u}^{\prime};\,y_{u}^{r})\,d\theta_{u}^{\prime}}\;=\;p\bigl(\theta_{u}\,\big|\,y_{u}^{1:s_{u}}\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(50)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The factor $C$ cancels in the numerator and denominator, leaving the posterior of $\theta_{u}$ depending only on its own data.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A5.SS2.SSS5" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="van-trees-inequality"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;E.2.5 &lt;/span&gt;Van Trees Inequality&lt;/h4&gt;
&lt;div id="Thmtheorem30" class="ltx_theorem ltx_theorem_fact"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Fact 30&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Van Trees Inequality).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem30.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Let $\Theta\sim\pi\text{,}$ where $\pi$ is an absolutely continuous probability density on $\mathbb{R}$ (with support either a finite closed interval $[a,b]$ or all of $\mathbb{R}$), satisfying:&lt;/p&gt;
&lt;ol id="A5.I5" class="ltx_enumerate"&gt;
&lt;li id="A5.I5.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(V1)&lt;/span&gt;
&lt;div id="A5.I5.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Boundary vanishing) If the support is a finite
closed interval $[a,b]\text{,}$ then $\pi(a)=\pi(b)=0$ (if the
support is $\mathbb{R}\text{,}$ this condition is vacuous).&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A5.I5.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(V2)&lt;/span&gt;
&lt;div id="A5.I5.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;(Prior Fisher information) $J(\pi):=\int(\pi^{\prime}(\theta))^{2}/\pi(\theta)\,d\theta&amp;lt;\infty$ (the
integral being restricted to $\{\pi&amp;gt;0\}$).&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p class="ltx_p"&gt;Given $\theta\text{,}$ the observation $Y$ has conditional density $f_{Y}(\cdot\mid\theta)\text{,}$ differentiable in $\theta$ and satisfying the standard regularity conditions of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Gill and Levit [&lt;a href="#bib.bib8" title="Applications of the van Trees inequality: a Bayesian Cramér–Rao bound" class="ltx_ref"&gt;1995&lt;/a&gt;]&lt;/cite&gt; (the score $\partial_{\theta}\log f_{Y}(Y\mid\theta)$ is square-integrable, and integration commutes with $\partial_{\theta}$). The Fisher information $I(\theta):=\mathbb{E}_{Y\mid\theta}\bigl[(\partial_{\theta}\log f_{Y}(Y\mid\theta))^{2}\bigr]$ satisfies $\mathbb{E}_{\Theta\sim\pi}[I(\Theta)]&amp;lt;\infty\text{.}$ Then for any ($Y$-measurable) estimator $\hat{\Theta}(Y)\text{,}$&lt;/p&gt;
&lt;table id="A5.Ex112" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\bigl[(\hat{\Theta}(Y)-\Theta)^{2}\bigr]\;\geq\;\frac{1}{\mathbb{E}_{\pi}[I(\Theta)]\,+\,J(\pi)}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;section id="A5.SS2.SSS5.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Application to the present setup.&lt;/h5&gt;
&lt;div id="A5.SS2.SSS5.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Fix a grid point $u$ and an integer $n\geq 0\text{,}$ and consider the sub-problem: prior $\Theta_{u}\sim\pi_{\varepsilon}\text{,}$ observations $Y_{u}^{1:n}$ i.i.d. from $\mathrm{Ber}(b_{u}+\Theta_{u})\text{.}$&lt;/p&gt;
&lt;ul id="A5.I6" class="ltx_itemize"&gt;
&lt;li id="A5.I6.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A5.I6.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(V1) holds:&lt;/span&gt; $\pi_{\varepsilon}(\pm\varepsilon)=0$
(&lt;a href="#Thmtheorem28" title="Lemma 28 (Prior Fisher Information). ‣ E.2.3 Prior Fisher Information ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;28&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A5.I6.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A5.I6.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(V2) holds:&lt;/span&gt; $J(\pi_{\varepsilon})=10/\varepsilon^{2}&amp;lt;\infty$ (&lt;a href="#Thmtheorem28" title="Lemma 28 (Prior Fisher Information). ‣ E.2.3 Prior Fisher Information ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;28&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A5.I6.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A5.I6.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Regularity:&lt;/span&gt; the Bernoulli likelihood $f(y\mid\theta)=(b_{u}+\theta)^{y}(1-b_{u}-\theta)^{1-y}$ is smooth in
$\theta\in[-\varepsilon,\varepsilon]\text{,}$ and $b_{u}+\theta\in[1/4,\,3/4]$ is bounded away from $0$ and $1$
(&lt;a href="#Thmtheorem27" title="Lemma 27 (Construction Validity). ‣ E.2.2 Construction Validity ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;27&lt;/span&gt;&lt;/a&gt;(b)), so the log-likelihood score
$\partial_{\theta}\log f$ is uniformly bounded.&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A5.I6.i4" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A5.I6.i4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Fisher information aggregation:&lt;/span&gt; for $n$ i.i.d. observations, $I_{n}(\theta_{u})=n\,I_{1}(\theta_{u})\text{;}$ by
&lt;a href="#Thmtheorem27" title="Lemma 27 (Construction Validity). ‣ E.2.2 Construction Validity ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;27&lt;/span&gt;&lt;/a&gt;(c), $\mathbb{E}_{\pi_{\varepsilon}}[I_{n}(\Theta_{u})]\leq 16n/3\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="ltx_p"&gt;&lt;a href="#Thmtheorem30" title="Fact 30 (Van Trees Inequality). ‣ E.2.5 Van Trees Inequality ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Fact&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;30&lt;/span&gt;&lt;/a&gt; therefore yields&lt;/p&gt;
&lt;table id="A5.E52" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\bigl[(\hat{\Theta}_{u}(Y_{u}^{1:n})-\Theta_{u})^{2}\bigr]\;\geq\;\frac{1}{\mathbb{E}_{\pi_{\varepsilon}}[I_{n}(\Theta_{u})]+J(\pi_{\varepsilon})}\;\geq\;\frac{1}{16n/3+10/\varepsilon^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(51)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A5.SS2.SSS6" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="proof-of-lemma-31"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;E.2.6 &lt;/span&gt;Proof of &lt;a href="#Thmtheorem31" title="Lemma 31 (Interior-Cube Lower Bound). ‣ E.2.6 Proof of Lemma 31 ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;31&lt;/span&gt;&lt;/a&gt;
&lt;/h4&gt;
&lt;div id="Thmtheorem31" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 31&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Interior-Cube Lower Bound).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem31.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For all integers $m\geq 2$ and $T\geq m^{2}\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A5.Ex113" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}([m]^{2})\;\geq\;\frac{3}{16}\,m^{2}\log\!\left(1+\frac{T}{2160\,m^{4}}\right).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A5.SS2.SSS6.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We construct an oblivious adversary and show that every deterministic learner suffers at least the claimed expected regret; Yao’s principle then gives the claim.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;section id="A5.SS2.SSS6.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Adversary’s strategy.&lt;/h5&gt;
&lt;div id="A5.SS2.SSS6.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Fix an arbitrary total ordering $u_{1},u_{2},\ldots,u_{m^{2}}$ of $V=[m]^{2}\text{.}$ Sample $\Theta\sim\prod_{u\in V}\pi_{\varepsilon}$ as in &lt;a href="#A5.SS2.SSS1" title="E.2.1 Construction ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;E.2.1&lt;/span&gt;&lt;/a&gt;, and form $P_{u}=b_{u}+\Theta_{u}\text{.}$ The query schedule (deterministic, independent of the learner’s actions) is as follows: partition the first $m^{2}q$ rounds into $m^{2}$ blocks; in block $k$ ($k\in\{1,\ldots,m^{2}\}$), query $x_{t}=u_{k}$ for $q$ consecutive rounds; the remaining $T-m^{2}q\in[0,m^{2})$ rounds query $x_{t}=u_{1}$ (a fixed grid point). Labels are sampled independently as $Y_{t}\sim\mathrm{Ber}(P_{x_{t}})\text{.}$ The entire sequence $(x_{t},y_{t})_{t=1}^{T}$ is determined by $\Theta$ and the label randomness, so the adversary is oblivious.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A5.SS2.SSS6.Px2" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Notation.&lt;/h5&gt;
&lt;div id="A5.SS2.SSS6.Px2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $t\leq m^{2}q\text{,}$ let $u(t):=x_{t}$ and let $s(t)\in\{1,\ldots,q\}$ denote the visit index of $u(t)$ in the schedule (i.e., $t$ is the $s(t)$-th visit to $u(t)$). Write $Y_{u}^{r}$ for the label observed during the $r$-th visit to grid point $u\text{,}$ and let $\mathcal{H}_{t-1}$ be the $\sigma$-algebra of all labels through round $t-1$ (the queries $x_{1:t}$ are deterministic and hence included automatically).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS2.SSS6.Px2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step A (Regret to estimation error).&lt;/span&gt; For each realization of $\Theta\text{,}$ $P\in\mathcal{F}_{[m]^{2}}^{\uparrow}$ by &lt;a href="#Thmtheorem27" title="Lemma 27 (Construction Validity). ‣ E.2.2 Construction Validity ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;27&lt;/span&gt;&lt;/a&gt;(a), so&lt;/p&gt;
&lt;table id="A5.Ex114" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\geq\;\sum_{t=1}^{T}\bigl[(\hat{y}_{t}-y_{t})^{2}-(P_{x_{t}}-y_{t})^{2}\bigr].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Expanding $(\hat{y}_{t}-y_{t})^{2}-(P_{x_{t}}-y_{t})^{2}=(\hat{y}_{t}-P_{x_{t}})^{2}+2(\hat{y}_{t}-P_{x_{t}})(P_{x_{t}}-y_{t})\text{.}$ Since the learner is deterministic and the queries are fixed in advance, the prediction $\hat{y}_{t}$ is $\mathcal{H}_{t-1}$-measurable; given $(\Theta,\,\mathcal{H}_{t-1})\text{,}$ $\mathbb{E}[y_{t}\mid\Theta,\mathcal{H}_{t-1}]=P_{x_{t}}\text{.}$ Hence the cross term has zero conditional expectation:&lt;/p&gt;
&lt;table id="A5.Ex115" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\bigl[(\hat{y}_{t}-P_{x_{t}})(P_{x_{t}}-y_{t})\mid\Theta,\mathcal{H}_{t-1}\bigr]\;=\;(\hat{y}_{t}-P_{x_{t}})\cdot 0\;=\;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Taking total expectation and discarding the non-negative contribution from $t&amp;gt;m^{2}q\text{,}$&lt;/p&gt;
&lt;table id="A5.E53" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[R_{T}]\;\geq\;\sum_{t=1}^{m^{2}q}\mathbb{E}\bigl[(\hat{y}_{t}-P_{x_{t}})^{2}\bigr].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(52)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A5.SS2.SSS6.Px2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step B (Per-round Bayesian reduction).&lt;/span&gt; For $t\leq m^{2}q$ and $u:=u(t)\text{,}$ the history $\mathcal{H}_{t-1}$ contains the prefix $Y_{u}^{1:s(t)-1}$ at $u$ together with prefix observations $Y_{v}^{1:s_{v}(t)}$ at every other grid point $v\neq u$ (where $s_{v}(t)\in\{0,\ldots,q\}$ is determined by the schedule and $t$). By &lt;a href="#Thmtheorem29" title="Lemma 29 (Posterior Factorization). ‣ Setup. ‣ E.2.4 Posterior Factorization ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;29&lt;/span&gt;&lt;/a&gt; (taking $s_{u}=s(t)-1$ and $(s_{v})_{v\neq u}$ as above),&lt;/p&gt;
&lt;table id="A5.E54" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{L}(\Theta_{u}\mid\mathcal{H}_{t-1})\;=\;\mathcal{L}(\Theta_{u}\mid Y_{u}^{1:s(t)-1}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(53)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Hence $\mathrm{Var}(\Theta_{u}\mid\mathcal{H}_{t-1})=\mathrm{Var}(\Theta_{u}\mid Y_{u}^{1:s(t)-1})\text{,}$ and similarly $\mathrm{Var}(P_{u}\mid\mathcal{H}_{t-1})=\mathrm{Var}(\Theta_{u}\mid Y_{u}^{1:s(t)-1})$ (since $P_{u}=b_{u}+\Theta_{u}$ is a constant translate of $\Theta_{u}\text{,}$ the conditional variances coincide).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A5.SS2.SSS6.Px2.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;By the minimum-MSE property of conditional expectation ($\hat{y}_{t}$ is $\mathcal{H}_{t-1}$-measurable),&lt;/p&gt;
&lt;table id="A5.Ex116" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\bigl[(\hat{y}_{t}-P_{x_{t}})^{2}\mid\mathcal{H}_{t-1}\bigr]\;\geq\;\mathrm{Var}(P_{x_{t}}\mid\mathcal{H}_{t-1})\;=\;\mathrm{Var}(\Theta_{u}\mid Y_{u}^{1:s(t)-1}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Taking total expectation,&lt;/p&gt;
&lt;table id="A5.E55" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\bigl[(\hat{y}_{t}-P_{x_{t}})^{2}\bigr]\;\geq\;\mathbb{E}\bigl[\mathrm{Var}(\Theta_{u}\mid Y_{u}^{1:s(t)-1})\bigr].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(54)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A5.SS2.SSS6.Px2.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step C (Van Trees applied).&lt;/span&gt; The posterior mean $\hat{\Theta}_{u}:=\mathbb{E}[\Theta_{u}\mid Y_{u}^{1:s(t)-1}]$ is a $Y_{u}^{1:s(t)-1}$-measurable estimator, and its MSE equals the expected posterior variance: $\mathbb{E}[(\hat{\Theta}_{u}-\Theta_{u})^{2}]=\mathbb{E}[\mathrm{Var}(\Theta_{u}\mid Y_{u}^{1:s(t)-1})]\text{.}$ Applying (&lt;a href="#A5.E52" title="Equation 51 ‣ Application to the present setup. ‣ E.2.5 Van Trees Inequality ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;51&lt;/span&gt;&lt;/a&gt;) to $\hat{\Theta}_{u}$ with $n=s(t)-1\text{,}$&lt;/p&gt;
&lt;table id="A5.E56" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\bigl[\mathrm{Var}(\Theta_{u}\mid Y_{u}^{1:s(t)-1})\bigr]\;\geq\;\frac{1}{16(s(t)-1)/3+10/\varepsilon^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(55)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A5.SS2.SSS6.Px2.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step D (Accumulation).&lt;/span&gt; Combining (&lt;a href="#A5.E53" title="Equation 52 ‣ Notation. ‣ E.2.6 Proof of Lemma 31 ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;52&lt;/span&gt;&lt;/a&gt;), (&lt;a href="#A5.E55" title="Equation 54 ‣ Notation. ‣ E.2.6 Proof of Lemma 31 ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;54&lt;/span&gt;&lt;/a&gt;), and (&lt;a href="#A5.E56" title="Equation 55 ‣ Notation. ‣ E.2.6 Proof of Lemma 31 ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;55&lt;/span&gt;&lt;/a&gt;) and reorganizing by block (each $u\in V$ contributes $q$ visits, with $s(t)$ ranging over $1,\ldots,q$),&lt;/p&gt;
&lt;table id="A5.E57" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[R_{T}]\;\geq\;\sum_{u\in V}\sum_{s=1}^{q}\frac{1}{16(s-1)/3+10/\varepsilon^{2}}\;=\;m^{2}\sum_{k=0}^{q-1}\frac{1}{16k/3+10/\varepsilon^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(56)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A5.SS2.SSS6.Px2.p7" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Lower bound on the sum.&lt;/em&gt;
Set $a:=16/3$ and $b:=10/\varepsilon^{2}\text{.}$ The summand $f(k):=1/(ak+b)$ is strictly decreasing in $k\text{,}$ so $f(k)\geq\int_{k}^{k+1}f(t)\,dt\text{,}$ and summing,&lt;/p&gt;
&lt;table id="A5.E58" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\begin{split}\sum_{k=0}^{q-1}f(k)&amp;amp;\;\geq\;\int_{0}^{q}\frac{dt}{at+b}\;=\;\frac{1}{a}\log\!\left(\frac{aq+b}{b}\right)\\ &amp;amp;\;=\;\frac{3}{16}\log\!\left(1+\frac{16q\varepsilon^{2}/3}{10}\right)\;=\;\frac{3}{16}\log\!\left(1+\frac{8q\varepsilon^{2}}{15}\right).\end{split}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(57)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A5.SS2.SSS6.Px2.p8" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Substituting $\varepsilon^{2}$ and bounding $q\text{.}$&lt;/em&gt;
With $\varepsilon^{2}=1/(576\,m^{2})\text{,}$ $8\varepsilon^{2}/15=8/(576\cdot 15\,m^{2})=1/(1080\,m^{2})\text{.}$ From $T\geq m^{2}\text{:}$ if $T\in[m^{2},\,2m^{2})\text{,}$ then $q=\lfloor T/m^{2}\rfloor=1\geq T/(2m^{2})$ (since $T/(2m^{2})&amp;lt;1$); if $T\geq 2m^{2}\text{,}$ then $q\geq T/m^{2}-1\geq T/m^{2}-T/(2m^{2})=T/(2m^{2})\text{.}$ In either case, for all $T\geq m^{2}\text{,}$&lt;/p&gt;
&lt;table id="A5.Ex117" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$q\;\geq\;\frac{T}{2m^{2}},\qquad\text{so}\qquad\frac{8q\varepsilon^{2}}{15}\;\geq\;\frac{T}{2m^{2}}\cdot\frac{1}{1080\,m^{2}}\;=\;\frac{T}{2160\,m^{4}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A5.SS2.SSS6.Px2.p9" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;Combining (&lt;a href="#A5.E57" title="Equation 56 ‣ Notation. ‣ E.2.6 Proof of Lemma 31 ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;56&lt;/span&gt;&lt;/a&gt;) and (&lt;a href="#A5.E58" title="Equation 57 ‣ Notation. ‣ E.2.6 Proof of Lemma 31 ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;57&lt;/span&gt;&lt;/a&gt;),&lt;/p&gt;
&lt;table id="A5.Ex118" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[R_{T}]\;\geq\;m^{2}\cdot\frac{3}{16}\log\!\left(1+\frac{8q\varepsilon^{2}}{15}\right)\;\geq\;\frac{3}{16}\,m^{2}\log\!\left(1+\frac{T}{2160\,m^{4}}\right).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The bound holds in expectation over the prior on $\Theta$ and the label randomness; since the adversary is oblivious, Yao’s principle gives $R_{T}^{*}([m]^{2})\geq(3/16)\,m^{2}\log(1+T/(2160\,m^{4}))\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A6" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="algorithm-proofs"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix F &lt;/span&gt;Algorithm Proofs&lt;/h2&gt;
&lt;section id="A6.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="column-independent-upper-bound"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;F.1 &lt;/span&gt;Column-Independent Upper Bound&lt;/h3&gt;
&lt;div id="A6.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This appendix gives the complete proof of &lt;a href="#Thmtheorem35" title="Theorem 35 (Column-Independent Upper Bound). ‣ F.1.4 Proof of Theorem 35 ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;35&lt;/span&gt;&lt;/a&gt; (Column-Independent Upper Bound). The argument has four steps: &lt;span class="ltx_text ltx_font_bold"&gt;(i)&lt;/span&gt; &lt;a href="#Thmtheorem32" title="Lemma 32 (Forward-Backward DP Correctness and Complexity). ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;32&lt;/span&gt;&lt;/a&gt; establishes the forward-backward DP for the per-column Gibbs partition function and cell-wise marginal, and bounds the overall per-round time by $O(mK)\text{;}$ &lt;span class="ltx_text ltx_font_bold"&gt;(ii)&lt;/span&gt; &lt;a href="#Thmtheorem33" title="Lemma 33 (Column-wise Decomposition of Regret). ‣ F.1.2 Comparator Class Enlargement ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;33&lt;/span&gt;&lt;/a&gt; establishes the comparator class enlargement—the global isotonic class $\mathcal{F}_{[m]^{2}}^{\uparrow}$ embeds into the column-independent product class $\prod_{i=1}^{m}\mathcal{F}_{[m]}^{\uparrow}$ via column restriction, and the product structure decomposes the regret on the latter strictly into a sum of $m$ within-column regrets; &lt;span class="ltx_text ltx_font_bold"&gt;(iii)&lt;/span&gt; &lt;a href="#Thmtheorem34" title="Lemma 34 (Chain EW Regret). ‣ F.1.3 Per-Column EW Analysis ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;34&lt;/span&gt;&lt;/a&gt; gives, for each column independently, the chain-$[m]$ EW and discretization analysis (i.e., the specialization of &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; to $\mathcal{P}=[m]$), comprising exp-concavity, the EW potential argument, and the discretization-error bound from the Block Residual on the chain (&lt;a href="#Thmtheorem8" title="Lemma 8 (Block Residual). ‣ Recall. ‣ Appendix B Block Residual Property ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt;); &lt;span class="ltx_text ltx_font_bold"&gt;(iv)&lt;/span&gt; summing $\sum_{i}T_{i}=T$ and merging with the trivial bound $R_{T}\leq T$ completes the proof.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A6.SS1.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Recall.&lt;/h5&gt;
&lt;div id="A6.SS1.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We use the following notation: $\mathcal{F}_{[m]^{2}}^{\uparrow}$ is the class of $[0,1]$-valued isotonic functions on $[m]^{2}\text{;}$ $\mathcal{F}_{[m]}^{\uparrow}$ is the class of $[0,1]$-valued non-decreasing functions on the chain $[m]\text{;}$ $\mathcal{F}_{[m],K}^{\uparrow}:=\{g\in\mathcal{F}_{[m]}^{\uparrow}:g([m])\subseteq\{0,1/K,\ldots,1\}\}$ is the discretized subclass with $|\mathcal{F}_{[m],K}^{\uparrow}|=\binom{m+K}{K}$ (the number of non-decreasing sequences of length $m$ taking $K{+}1$ values). At round $t$ the query point is $x_{t}=(i_{t},j_{t})\in[m]^{2}\text{,}$ and $T_{i}:=|\{t:i_{t}=i\}|$ is the number of rounds falling into column $i\text{,}$ with $\sum_{i=1}^{m}T_{i}=T\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A6.SS1.SSS1" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="forward-backward-dp-and-per-round-time"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;F.1.1 &lt;/span&gt;Forward-Backward DP and Per-Round Time&lt;/h4&gt;
&lt;div id="A6.SS1.SSS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This subsection formalizes the cell-wise marginal computation for each column’s exponential-weight measure in &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; and bounds the overall per-round time by $O(mK)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A6.SS1.SSS1.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Algorithm 1 (formal restatement).&lt;/h5&gt;
&lt;div id="A6.SS1.SSS1.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For each column $i\in[m]\text{,}$ maintain a measure $\mu_{i}^{(t)}$ on $\mathcal{F}_{[m],K}^{\uparrow}\text{,}$ initialized as $\mu_{i}^{(1)}:=\mathrm{Unif}(\mathcal{F}_{[m],K}^{\uparrow})\text{.}$ At round $t\text{,}$ upon receiving $x_{t}=(i_{t},j_{t})\text{,}$ the learner outputs&lt;/p&gt;
&lt;table id="A6.Ex119" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\hat{y}_{t}\;:=\;\mathbb{E}_{g\sim\mu_{i_{t}}^{(t)}}\!\bigl[g(j_{t})\bigr];$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;upon receiving $y_{t}\in[0,1]\text{,}$ the measures are updated via the Exponential Weights rule&lt;/p&gt;
&lt;table id="A6.E59" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mu_{i}^{(t+1)}(g)\;\propto\;\mu_{i}^{(t)}(g)\cdot\exp\!\Bigl(-\tfrac{1}{2}\bigl(g(j_{t})-y_{t}\bigr)^{2}\mathbf{1}\!\left[i=i_{t}\right]\Bigr),\qquad i\in[m].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(58)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;For $i\neq i_{t}$ the indicator is $0\text{,}$ so the exponential factor reduces to $1$ and $\mu_{i}^{(t+1)}=\mu_{i}^{(t)}\text{;}$ only column $i_{t}$ is substantially updated.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A6.SS1.SSS1.Px2" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Per-cell weight factorization.&lt;/h5&gt;
&lt;div id="A6.SS1.SSS1.Px2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For column $i$ and row $j\text{,}$ define the cell-wise factor&lt;/p&gt;
&lt;table id="A6.E60" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\phi_{i,j}^{(t)}(v)\;:=\;\exp\!\biggl(-\frac{1}{2}\!\!\sum_{s&amp;lt;t\,:\,(i_{s},j_{s})=(i,j)}\!\!(v-y_{s})^{2}\biggr),\qquad v\in\{0,1/K,\ldots,1\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(59)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;with the empty sum convention $0$ (so $\phi_{i,j}^{(1)}(v)=1$). Expanding the EW measure and grouping by row gives&lt;/p&gt;
&lt;table id="A6.E61" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mu_{i}^{(t)}(g)\;\propto\;\exp\!\biggl(-\frac{1}{2}\!\!\sum_{s&amp;lt;t\,:\,i_{s}=i}\!\!\bigl(g(j_{s})-y_{s}\bigr)^{2}\biggr)\;=\;\prod_{j=1}^{m}\phi_{i,j}^{(t)}\bigl(g(j)\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(60)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;After normalization,&lt;/p&gt;
&lt;table id="A6.E62" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mu_{i}^{(t)}(g)\;=\;\frac{\prod_{j=1}^{m}\phi_{i,j}^{(t)}(g(j))}{Z_{i}^{(t)}},\qquad Z_{i}^{(t)}\;:=\;\sum_{g\in\mathcal{F}_{[m],K}^{\uparrow}}\prod_{j=1}^{m}\phi_{i,j}^{(t)}\bigl(g(j)\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(61)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Since $\phi_{i,j}^{(t)}(v)&amp;gt;0$ (exponential form), $Z_{i}^{(t)}&amp;gt;0\text{,}$ so $\mu_{i}^{(t)}$ is well-defined at every round.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A6.SS1.SSS1.Px3" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Forward-backward DP.&lt;/h5&gt;
&lt;div id="A6.SS1.SSS1.Px3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Fix column $i=i_{t}$ and round $t\text{,}$ and abbreviate $\phi_{j}(v):=\phi_{i_{t},j}^{(t)}(v)\text{.}$ Define&lt;/p&gt;
&lt;table id="A6.E63" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F_{j}(v)\;:=\;\sum_{\begin{subarray}{c}g_{1},\ldots,g_{j}\in\{0,1/K,\ldots,1\}\\ g_{1}\leq g_{2}\leq\cdots\leq g_{j}=v\end{subarray}}\prod_{j^{\prime}=1}^{j}\phi_{j^{\prime}}(g_{j^{\prime}}),\qquad j\in\{1,\ldots,m\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(62)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;table id="A6.E64" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$B_{j}(v)\;:=\;\sum_{\begin{subarray}{c}g_{j+1},\ldots,g_{m}\in\{0,1/K,\ldots,1\}\\ v\leq g_{j+1}\leq\cdots\leq g_{m}\end{subarray}}\prod_{j^{\prime}=j+1}^{m}\phi_{j^{\prime}}(g_{j^{\prime}}),\qquad j\in\{0,1,\ldots,m-1\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(63)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;with the convention $B_{m}(v):=1$ (empty product). Thus $F_{j}(v)$ accumulates the weight of non-decreasing sequences on rows $1,\ldots,j$ with $g_{j}=v$ (involving all $j$ factors $\phi_{1},\ldots,\phi_{j}$), while $B_{j}(v)$ accumulates the weight of non-decreasing sequences on rows $j+1,\ldots,m$ with $g_{j+1}\geq v$ (involving the $m{-}j$ factors $\phi_{j+1},\ldots,\phi_{m}\text{,}$ but &lt;em class="ltx_emph ltx_font_italic"&gt;not&lt;/em&gt; $\phi_{j}$). Combining $F_{j_{0}}$ and $B_{j_{0}}$ at any $j_{0}\in\{1,\ldots,m\}$ thus covers each $\phi_{j}$-factor exactly once.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS1.Px3.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The base cases $F_{1}(v)=\phi_{1}(v)$ and $B_{m}(v)=1$ follow from the empty-product/empty-sum conventions. The recursions are&lt;/p&gt;
&lt;table id="A6.E65" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F_{j+1}(v^{\prime})\;=\;\phi_{j+1}(v^{\prime})\cdot\sum_{v\leq v^{\prime}}F_{j}(v),\qquad v^{\prime}\in\{0,1/K,\ldots,1\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(64)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;table id="A6.E66" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$B_{j}(v)\;=\;\sum_{v^{\prime}\geq v}\phi_{j+1}(v^{\prime})\cdot B_{j+1}(v^{\prime}),\qquad v\in\{0,1/K,\ldots,1\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(65)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem32" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 32&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Forward-Backward DP Correctness and Complexity).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem32.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;The functions $F,B$ defined by (&lt;a href="#A6.E65" title="Equation 64 ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;64&lt;/span&gt;&lt;/a&gt;) and (&lt;a href="#A6.E66" title="Equation 65 ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;65&lt;/span&gt;&lt;/a&gt;) satisfy (&lt;a href="#A6.E63" title="Equation 62 ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;62&lt;/span&gt;&lt;/a&gt;) and (&lt;a href="#A6.E64" title="Equation 63 ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;63&lt;/span&gt;&lt;/a&gt;), respectively. The partition function is&lt;/span&gt;&lt;/p&gt;
&lt;table id="A6.Ex120" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$Z_{i}^{(t)}\;=\;\sum_{v}F_{m}(v)\;=\;\sum_{v}\phi_{1}(v)\cdot B_{1}(v),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;and for $j_{0}\in\{1,\ldots,m\}$ and $v\in\{0,1/K,\ldots,1\}\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A6.E67" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Pr_{g\sim\mu_{i}^{(t)}}\!\bigl[g(j_{0})=v\bigr]\;=\;\frac{F_{j_{0}}(v)\cdot B_{j_{0}}(v)}{Z_{i}^{(t)}},\qquad\mathbb{E}_{g\sim\mu_{i}^{(t)}}\!\bigl[g(j_{0})\bigr]\;=\;\frac{1}{Z_{i}^{(t)}}\sum_{v}v\cdot F_{j_{0}}(v)\cdot B_{j_{0}}(v).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(66)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;With prefix-sum and suffix-sum optimization, the entire forward-backward DP runs in $O(mK)$ time per round, and hence &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; runs in $O(mK)$ time per round overall.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A6.SS1.SSS1.Px3.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 1 (Forward correctness).&lt;/span&gt; We prove that $F$ satisfies (&lt;a href="#A6.E63" title="Equation 62 ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;62&lt;/span&gt;&lt;/a&gt;) by induction on $j\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS1.Px3.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Base case.&lt;/em&gt; For $j=1\text{,}$ the sum in (&lt;a href="#A6.E63" title="Equation 62 ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;62&lt;/span&gt;&lt;/a&gt;) reduces to the single point $g_{1}=v\text{,}$ giving $F_{1}(v)=\phi_{1}(v)\text{,}$ matching the initial value of (&lt;a href="#A6.E65" title="Equation 64 ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;64&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS1.Px3.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Inductive step.&lt;/em&gt; Suppose $F_{j}$ satisfies (&lt;a href="#A6.E63" title="Equation 62 ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;62&lt;/span&gt;&lt;/a&gt;). Then&lt;/p&gt;
&lt;table id="A6.Ex121" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F_{j+1}(v^{\prime})\;=\;\sum_{\begin{subarray}{c}g_{1},\ldots,g_{j+1}\\ g_{1}\leq\cdots\leq g_{j+1}=v^{\prime}\end{subarray}}\prod_{j^{\prime}=1}^{j+1}\phi_{j^{\prime}}(g_{j^{\prime}})\;=\;\phi_{j+1}(v^{\prime})\cdot\sum_{\begin{subarray}{c}g_{1},\ldots,g_{j}\\ g_{1}\leq\cdots\leq g_{j}\leq v^{\prime}\end{subarray}}\prod_{j^{\prime}=1}^{j}\phi_{j^{\prime}}(g_{j^{\prime}}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Grouping the inner sum by the value $v$ of $g_{j}$ (with $v\leq v^{\prime}$),&lt;/p&gt;
&lt;table id="A6.Ex122" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{\begin{subarray}{c}g_{1},\ldots,g_{j}\\ g_{1}\leq\cdots\leq g_{j}\leq v^{\prime}\end{subarray}}\prod_{j^{\prime}=1}^{j}\phi_{j^{\prime}}(g_{j^{\prime}})\;=\;\sum_{v\leq v^{\prime}}\sum_{\begin{subarray}{c}g_{1},\ldots,g_{j}\\ g_{1}\leq\cdots\leq g_{j}=v\end{subarray}}\prod_{j^{\prime}=1}^{j}\phi_{j^{\prime}}(g_{j^{\prime}})\;=\;\sum_{v\leq v^{\prime}}F_{j}(v),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;which is (&lt;a href="#A6.E65" title="Equation 64 ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;64&lt;/span&gt;&lt;/a&gt;). By induction, $\sum_{v}F_{m}(v)=\sum_{g\in\mathcal{F}_{[m],K}^{\uparrow}}\prod_{j}\phi_{j}(g(j))=Z_{i}^{(t)}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS1.Px3.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 2 (Backward correctness).&lt;/span&gt; We prove that $B$ satisfies (&lt;a href="#A6.E64" title="Equation 63 ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;63&lt;/span&gt;&lt;/a&gt;) by reverse induction on $j\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS1.Px3.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Base case.&lt;/em&gt; For $j=m\text{,}$ $B_{m}(v)=1$ matches the empty-product convention in (&lt;a href="#A6.E64" title="Equation 63 ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;63&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS1.Px3.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Inductive step.&lt;/em&gt; Suppose $B_{j+1}$ satisfies (&lt;a href="#A6.E64" title="Equation 63 ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;63&lt;/span&gt;&lt;/a&gt;). Then&lt;/p&gt;
&lt;table id="A6.Ex123" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$B_{j}(v)\;=\;\sum_{\begin{subarray}{c}g_{j+1},\ldots,g_{m}\\ v\leq g_{j+1}\leq\cdots\leq g_{m}\end{subarray}}\prod_{j^{\prime}=j+1}^{m}\phi_{j^{\prime}}(g_{j^{\prime}}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Grouping by the value $v^{\prime}$ of $g_{j+1}$ (with $v^{\prime}\geq v$),&lt;/p&gt;
&lt;table id="A6.Ex124" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\;=\;\sum_{v^{\prime}\geq v}\phi_{j+1}(v^{\prime})\sum_{\begin{subarray}{c}g_{j+2},\ldots,g_{m}\\ v^{\prime}\leq g_{j+2}\leq\cdots\leq g_{m}\end{subarray}}\prod_{j^{\prime}=j+2}^{m}\phi_{j^{\prime}}(g_{j^{\prime}})\;=\;\sum_{v^{\prime}\geq v}\phi_{j+1}(v^{\prime})\cdot B_{j+1}(v^{\prime}),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;which is (&lt;a href="#A6.E66" title="Equation 65 ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;65&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS1.Px3.p9" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 3 (Marginal formula).&lt;/span&gt; For any $j_{0}\in\{1,\ldots,m\}$ and any $v\text{,}$&lt;/p&gt;
&lt;table id="A6.Ex125" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F_{j_{0}}(v)\cdot B_{j_{0}}(v)\;=\;\sum_{\begin{subarray}{c}g_{1}\leq\cdots\leq g_{j_{0}}=v\end{subarray}}\prod_{j^{\prime}=1}^{j_{0}}\phi_{j^{\prime}}(g_{j^{\prime}})\;\cdot\;\sum_{\begin{subarray}{c}v\leq g_{j_{0}+1}\leq\cdots\leq g_{m}\end{subarray}}\prod_{j^{\prime}=j_{0}+1}^{m}\phi_{j^{\prime}}(g_{j^{\prime}}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The two inner sums are independent for fixed $v\text{:}$ one runs over the first $j_{0}$ rows (with $g_{j_{0}}=v$), the other over the last $m-j_{0}$ rows (with $g_{j_{0}+1}\geq v$). Expanding the product gives the sum over all $g\in\mathcal{F}_{[m],K}^{\uparrow}$ with $g(j_{0})=v\text{:}$&lt;/p&gt;
&lt;table id="A6.Ex126" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F_{j_{0}}(v)\cdot B_{j_{0}}(v)\;=\;\sum_{\begin{subarray}{c}g\in\mathcal{F}_{[m],K}^{\uparrow}\\ g(j_{0})=v\end{subarray}}\prod_{j=1}^{m}\phi_{j}(g(j)).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Summing over $v$ gives $\sum_{v}F_{j_{0}}(v)B_{j_{0}}(v)=Z_{i}^{(t)}$ (independent of $j_{0}$), from which (&lt;a href="#A6.E67" title="Equation 66 ‣ Lemma 32 (Forward-Backward DP Correctness and Complexity). ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;66&lt;/span&gt;&lt;/a&gt;) follows. Setting $j_{0}=1$ and using $F_{1}(v)=\phi_{1}(v)$ gives $Z_{i}^{(t)}=\sum_{v}\phi_{1}(v)B_{1}(v)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS1.Px3.p10" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 4 (Complexity).&lt;/span&gt; In (&lt;a href="#A6.E65" title="Equation 64 ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;64&lt;/span&gt;&lt;/a&gt;), the inner sum $\sum_{v\leq v^{\prime}}F_{j}(v)$ is the prefix sum of $F_{j}$ in $v^{\prime}\text{;}$ scanning $v^{\prime}$ in ascending order while maintaining a running accumulator gives $O(K)$ per row. Multiplying by $\phi_{j+1}(v^{\prime})$ yields $F_{j+1}(v^{\prime})$ in $O(K)$ as well, so $F$ takes $O(mK)$ in total. The backward variable $B$ is symmetric (the suffix sum in (&lt;a href="#A6.E66" title="Equation 65 ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;65&lt;/span&gt;&lt;/a&gt;) is computed by scanning $v$ in descending order), also $O(mK)\text{.}$ In (&lt;a href="#A6.E67" title="Equation 66 ‣ Lemma 32 (Forward-Backward DP Correctness and Complexity). ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;66&lt;/span&gt;&lt;/a&gt;) with $j_{0}=j_{t}\text{,}$ the marginal $\sum_{v}v\cdot F_{j_{0}}(v)B_{j_{0}}(v)$ and $Z=\sum_{v}F_{m}(v)$ are both $O(K)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS1.Px3.p11" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Each round of &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; invokes the forward-backward DP only on the queried column $i_{t}$ (the other columns satisfy $\mu_{i}^{(t)}=\mu_{i}^{(t-1)}$ and their marginals are not needed in that round), giving $O(mK)$ per round overall.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A6.SS1.SSS2" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="comparator-class-enlargement"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;F.1.2 &lt;/span&gt;Comparator Class Enlargement&lt;/h4&gt;
&lt;div id="A6.SS1.SSS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This subsection upper-bounds the regret of &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; by the regret on the column-independent class via comparator class enlargement, then strictly decomposes it into a sum of $m$ within-column regrets via the product structure.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem33" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 33&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Column-wise Decomposition of Regret).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem33.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let&lt;/span&gt;&lt;/p&gt;
&lt;table id="A6.Ex127" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;:=\;\sum_{t=1}^{T}(\hat{y}_{t}-y_{t})^{2}\;-\;\min_{f^{*}\in\mathcal{F}_{[m]^{2}}^{\uparrow}}\sum_{t=1}^{T}\bigl(f^{*}(x_{t})-y_{t}\bigr)^{2}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;denote the regret of &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;. For each $i\in[m]\text{,}$ define the column-wise regret&lt;/span&gt;&lt;/p&gt;
&lt;table id="A6.Ex128" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{i}\;:=\;\!\!\sum_{t\,:\,i_{t}=i}\!\!(\hat{y}_{t}-y_{t})^{2}\;-\;\min_{g_{i}^{*}\in\mathcal{F}_{[m]}^{\uparrow}}\!\!\sum_{t\,:\,i_{t}=i}\!\!\bigl(g_{i}^{*}(j_{t})-y_{t}\bigr)^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Then&lt;/span&gt;&lt;/p&gt;
&lt;table id="A6.E68" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\sum_{i=1}^{m}R_{i}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(67)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A6.SS1.SSS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 1 (Comparator class embedding).&lt;/span&gt; Define&lt;/p&gt;
&lt;table id="A6.Ex129" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\iota\,:\,\mathcal{F}_{[m]^{2}}^{\uparrow}\;\to\;\prod_{i=1}^{m}\mathcal{F}_{[m]}^{\uparrow},\qquad\iota(f)\;:=\;\bigl(f(1,\cdot),\,f(2,\cdot),\,\ldots,\,f(m,\cdot)\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;For $f\in\mathcal{F}_{[m]^{2}}^{\uparrow}$ and indices $j\leq j^{\prime}$ in the same column, the product order $(i,j)\prec(i,j^{\prime})$ gives $f(i,j)\leq f(i,j^{\prime})\text{,}$ so each column restriction $f(i,\cdot)\in\mathcal{F}_{[m]}^{\uparrow}\text{,}$ i.e., $\iota$ is well-defined.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The image $\iota(\mathcal{F}_{[m]^{2}}^{\uparrow})$ is strictly contained in $\prod_{i}\mathcal{F}_{[m]}^{\uparrow}\text{:}$ for instance, taking $g_{1}\equiv 1\text{,}$ $g_{2}\equiv 0$ (and any non-decreasing $g_{i}$ otherwise) gives $(g_{1},\ldots,g_{m})\in\prod_{i}\mathcal{F}_{[m]}^{\uparrow}\text{,}$ but this tuple does not correspond to any $f\in\mathcal{F}_{[m]^{2}}^{\uparrow}$ (since $(1,1)\prec(2,1)$ in $[m]^{2}$ would require $f(1,1)\leq f(2,1)\text{,}$ i.e., $1\leq 0\text{,}$ a contradiction).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS2.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Define the loss functional $L(f):=\sum_{t=1}^{T}(f(x_{t})-y_{t})^{2}\text{.}$ $L$ is invariant under $\iota\text{:}$ for $f\in\mathcal{F}_{[m]^{2}}^{\uparrow}\text{,}$ $L(f)=\sum_{t}(f(i_{t},j_{t})-y_{t})^{2}\text{,}$ and viewing $\iota(f)=(g_{1},\ldots,g_{m})\text{,}$ the corresponding loss $\widetilde{L}(\iota(f)):=\sum_{t}(g_{i_{t}}(j_{t})-y_{t})^{2}=\sum_{t}(f(i_{t},j_{t})-y_{t})^{2}=L(f)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS2.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 2 (Regret monotonicity in the comparator class).&lt;/span&gt; By $\iota(\mathcal{F}_{[m]^{2}}^{\uparrow})\subseteq\prod_{i}\mathcal{F}_{[m]}^{\uparrow}$ and the $\iota$-invariance of $L\text{,}$&lt;/p&gt;
&lt;table id="A6.Ex130" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\min_{f\in\mathcal{F}_{[m]^{2}}^{\uparrow}}L(f)\;=\;\min_{\widetilde{f}\in\iota(\mathcal{F}_{[m]^{2}}^{\uparrow})}\widetilde{L}(\widetilde{f})\;\geq\;\min_{(g_{1},\ldots,g_{m})\in\prod_{i}\mathcal{F}_{[m]}^{\uparrow}}\sum_{t=1}^{T}\bigl(g_{i_{t}}(j_{t})-y_{t}\bigr)^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where the inequality follows from the infimum decreasing under enlargement of the feasible set. Substituting into the definition of regret,&lt;/p&gt;
&lt;table id="A6.E69" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;=\;\sum_{t}(\hat{y}_{t}-y_{t})^{2}-\min_{f\in\mathcal{F}_{[m]^{2}}^{\uparrow}}L(f)\;\leq\;\sum_{t}(\hat{y}_{t}-y_{t})^{2}-\!\!\min_{(g_{1},\ldots,g_{m})}\!\!\sum_{t}\bigl(g_{i_{t}}(j_{t})-y_{t}\bigr)^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(68)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS2.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 3 (Product structure decomposition).&lt;/span&gt; Group the first sum in (&lt;a href="#A6.E69" title="Equation 68 ‣ F.1.2 Comparator Class Enlargement ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;68&lt;/span&gt;&lt;/a&gt;) by column:&lt;/p&gt;
&lt;table id="A6.Ex131" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{t=1}^{T}(\hat{y}_{t}-y_{t})^{2}\;=\;\sum_{i=1}^{m}\!\!\sum_{t\,:\,i_{t}=i}\!\!(\hat{y}_{t}-y_{t})^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;For the infimum, the product structure ($g_{i}$ decoupled across $i$) gives&lt;/p&gt;
&lt;table id="A6.Ex132" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\!\!\min_{(g_{1},\ldots,g_{m})}\!\!\sum_{t=1}^{T}\bigl(g_{i_{t}}(j_{t})-y_{t}\bigr)^{2}\;=\;\!\!\min_{(g_{1},\ldots,g_{m})}\!\!\sum_{i=1}^{m}\!\!\sum_{t\,:\,i_{t}=i}\!\!\bigl(g_{i}(j_{t})-y_{t}\bigr)^{2}\;=\;\sum_{i=1}^{m}\min_{g_{i}\in\mathcal{F}_{[m]}^{\uparrow}}\!\!\sum_{t\,:\,i_{t}=i}\!\!\bigl(g_{i}(j_{t})-y_{t}\bigr)^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where the last equality uses that the $g_{i}$ are decoupled, so each column $g_{i}$ may be minimized independently against its own column loss. Substituting into (&lt;a href="#A6.E69" title="Equation 68 ‣ F.1.2 Comparator Class Enlargement ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;68&lt;/span&gt;&lt;/a&gt;),&lt;/p&gt;
&lt;table id="A6.Ex133" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\sum_{i=1}^{m}\!\Biggl[\!\!\sum_{t\,:\,i_{t}=i}\!\!(\hat{y}_{t}-y_{t})^{2}\,-\,\min_{g_{i}\in\mathcal{F}_{[m]}^{\uparrow}}\!\!\sum_{t\,:\,i_{t}=i}\!\!(g_{i}(j_{t})-y_{t})^{2}\Biggr]\;=\;\sum_{i=1}^{m}R_{i}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A6.SS1.SSS3" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="per-column-ew-analysis"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;F.1.3 &lt;/span&gt;Per-Column EW Analysis&lt;/h4&gt;
&lt;div id="A6.SS1.SSS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This subsection gives the chain-$[m]$ EW and discretization analysis for each column independently—the specialization of &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; to $\mathcal{P}=[m]\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem34" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 34&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Chain EW Regret).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem34.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For each $i\in[m]\text{,}$ the column-wise regret $R_{i}$ defined in &lt;a href="#Thmtheorem33" title="Lemma 33 (Column-wise Decomposition of Regret). ‣ F.1.2 Comparator Class Enlargement ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;33&lt;/span&gt;&lt;/a&gt; satisfies&lt;/span&gt;&lt;/p&gt;
&lt;table id="A6.E70" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{i}\;\leq\;2\,\log\!\binom{m+K}{K}\,+\,\frac{T_{i}}{4K^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(69)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A6.SS1.SSS3.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Fix column $i\text{.}$ By (&lt;a href="#A6.E59" title="Equation 58 ‣ Algorithm 1 (formal restatement). ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;58&lt;/span&gt;&lt;/a&gt;), the EW measure on column $i$ is updated only at rounds $t$ with $i_{t}=i\text{,}$ and (when $i_{t}=i$) $\hat{y}_{t}$ depends only on $\{(j_{s},y_{s}):s&amp;lt;t,\,i_{s}=i\}\text{.}$ Hence the column-$i$ sub-problem is equivalent to an online learning problem on the chain $[m]$ of length $T_{i}$ with sequence $\{(j_{t},y_{t}):i_{t}=i\}\text{,}$ run by the EW algorithm in the proof of &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; specialized to $\mathcal{P}=[m]\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS3.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 1 (Discretization).&lt;/span&gt; By the definition of the order polynomial, $|\mathcal{F}_{[m],K}^{\uparrow}|=\Omega([m],K{+}1)=\binom{m+K}{K}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS3.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 2 (Exp-concavity and EW).&lt;/span&gt; The squared loss $(p-y)^{2}$ is $\tfrac{1}{2}$-exp-concave on $p\in[0,1]$ (i.e., $p\mapsto\exp(-\tfrac{1}{2}(p-y)^{2})$ is concave on $[0,1]$). The update (&lt;a href="#A6.E59" title="Equation 58 ‣ Algorithm 1 (formal restatement). ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;58&lt;/span&gt;&lt;/a&gt;) restricted to column $i$ is exactly Exponential Weights with learning rate $\eta=1/2\text{;}$ the standard exp-concave EW analysis &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[Cesa-Bianchi and Lugosi, &lt;a href="#bib.bib1" title="Prediction, learning, and games" class="ltx_ref"&gt;2006&lt;/a&gt;]&lt;/cite&gt; gives&lt;/p&gt;
&lt;table id="A6.E71" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\!\!\sum_{t\,:\,i_{t}=i}\!\!(\hat{y}_{t}-y_{t})^{2}\,-\,\min_{\hat{h}\in\mathcal{F}_{[m],K}^{\uparrow}}\!\!\sum_{t\,:\,i_{t}=i}\!\!\bigl(\hat{h}(j_{t})-y_{t}\bigr)^{2}\;\leq\;\frac{1}{\eta}\log|\mathcal{F}_{[m],K}^{\uparrow}|\;=\;2\log\!\binom{m+K}{K}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(70)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS3.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 3 (Discretization error via Block Residual on the chain).&lt;/span&gt; Take&lt;/p&gt;
&lt;table id="A6.Ex134" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$g^{*}\;\in\;\operatorname*{arg\,min}_{g\in\mathcal{F}_{[m]}^{\uparrow}}\!\!\sum_{t\,:\,i_{t}=i}\!\!\bigl(g(j_{t})-y_{t}\bigr)^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;the batch-optimal isotonic function on the chain $[m]$ for the column-$i$ subsequence. Let $q:[0,1]\to\{0,1/K,\ldots,1\}\text{,}$ $q(v):=\lfloor Kv+1/2\rfloor/K\text{,}$ denote rounding to the $K$-grid, and set $\hat{g}:=q\circ g^{*}\text{.}$ Since $q$ is non-decreasing, $\hat{g}\in\mathcal{F}_{[m],K}^{\uparrow}\text{.}$ For each value $c$ attained by $g^{*}\text{,}$ let $\delta_{c}:=q(c)-c\text{,}$ so $|\delta_{c}|\leq 1/(2K)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS3.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Define the column-$i$ query counts and blocks&lt;/p&gt;
&lt;table id="A6.Ex135" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$w_{j}^{(i)}\;:=\;\bigl|\{t:i_{t}=i,\,j_{t}=j\}\bigr|,\qquad B_{c}^{(i)}\;:=\;\bigl\{j\in[m]:w_{j}^{(i)}&amp;gt;0,\,g^{*}(j)=c\bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Applying &lt;a href="#Thmtheorem8" title="Lemma 8 (Block Residual). ‣ Recall. ‣ Appendix B Block Residual Property ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt; (Block Residual) on the poset $\mathcal{P}=[m]$ with sequence $\{(j_{t},y_{t}):i_{t}=i\}$ (length $T_{i}$) and minimizer $g^{*}\text{:}$ for each value $c\text{,}$&lt;/p&gt;
&lt;table id="A6.E72" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\!\!\sum_{t\,:\,i_{t}=i,\,j_{t}\in B_{c}^{(i)}}\!\!\bigl(g^{*}(j_{t})-y_{t}\bigr)\;=\;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(71)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS3.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Decomposing the loss difference between $\hat{g}$ and $g^{*}$ by block: for $j\in B_{c}^{(i)}\text{,}$ we have $g^{*}(j)=c$ and $\hat{g}(j)=q(c)=c+\delta_{c}\text{,}$ so for $t:i_{t}=i,\,j_{t}\in B_{c}^{(i)}\text{,}$&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A6.Ex136"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A6.Ex136X"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A6.Ex136Xa"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle\bigl(\hat{g}(j_{t})-y_{t}\bigr)^{2}-\bigl(g^{*}(j_{t})-y_{t}\bigr)^{2} &amp;amp; \displaystyle\;=\;(c+\delta_{c}-y_{t})^{2}-(c-y_{t})^{2} \\
&amp;amp; \displaystyle\;=\;\delta_{c}^{2}+2\,\delta_{c}\,(c-y_{t}).
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;Summing over $\{t:i_{t}=i,\,j_{t}\in B_{c}^{(i)}\}$ (with $w_{B_{c}^{(i)}}^{(i)}:=\sum_{j\in B_{c}^{(i)}}w_{j}^{(i)}$),&lt;/p&gt;
&lt;table id="A6.Ex137" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{t\,:\,i_{t}=i,\,j_{t}\in B_{c}^{(i)}}\bigl[(\hat{g}(j_{t})-y_{t})^{2}-(g^{*}(j_{t})-y_{t})^{2}\bigr]\;=\;w_{B_{c}^{(i)}}^{(i)}\,\delta_{c}^{2}\,+\,2\,\delta_{c}\underbrace{\sum_{t\,:\,i_{t}=i,\,j_{t}\in B_{c}^{(i)}}(c-y_{t})}_{=\,0\text{ by }\text{(71)}},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where $c=g^{*}(j_{t})$ for $j_{t}\in B_{c}^{(i)}\text{.}$ Summing over $c$ (noting $\sum_{c}w_{B_{c}^{(i)}}^{(i)}=T_{i}$),&lt;/p&gt;
&lt;table id="A6.E73" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\!\!\sum_{t\,:\,i_{t}=i}\!\!\bigl[(\hat{g}(j_{t})-y_{t})^{2}-(g^{*}(j_{t})-y_{t})^{2}\bigr]\;=\;\sum_{c}w_{B_{c}^{(i)}}^{(i)}\,\delta_{c}^{2}\;\leq\;\frac{T_{i}}{4K^{2}},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(72)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where the final inequality uses $\delta_{c}^{2}\leq 1/(4K^{2})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS3.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 4 (Combining).&lt;/span&gt; Since $\hat{g}\in\mathcal{F}_{[m],K}^{\uparrow}\text{,}$&lt;/p&gt;
&lt;table id="A6.Ex138" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\min_{\hat{h}\in\mathcal{F}_{[m],K}^{\uparrow}}\!\!\sum_{t\,:\,i_{t}=i}\!\!\bigl(\hat{h}(j_{t})-y_{t}\bigr)^{2}\;\leq\;\!\!\sum_{t\,:\,i_{t}=i}\!\!\bigl(\hat{g}(j_{t})-y_{t}\bigr)^{2}\;\overset{\text{(72)}}{\leq}\;\!\!\sum_{t\,:\,i_{t}=i}\!\!\bigl(g^{*}(j_{t})-y_{t}\bigr)^{2}\,+\,\frac{T_{i}}{4K^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Substituting into (&lt;a href="#A6.E71" title="Equation 70 ‣ F.1.3 Per-Column EW Analysis ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;70&lt;/span&gt;&lt;/a&gt;),&lt;/p&gt;
&lt;table id="A6.Ex139" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{i}\;=\;\!\!\sum_{t\,:\,i_{t}=i}\!\!(\hat{y}_{t}-y_{t})^{2}\,-\,\!\!\sum_{t\,:\,i_{t}=i}\!\!\bigl(g^{*}(j_{t})-y_{t}\bigr)^{2}\;\leq\;2\log\!\binom{m+K}{K}\,+\,\frac{T_{i}}{4K^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A6.SS1.SSS4" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="proof-of-theorem-35"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;F.1.4 &lt;/span&gt;Proof of &lt;a href="#Thmtheorem35" title="Theorem 35 (Column-Independent Upper Bound). ‣ F.1.4 Proof of Theorem 35 ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;35&lt;/span&gt;&lt;/a&gt;
&lt;/h4&gt;
&lt;div id="Thmtheorem35" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 35&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Column-Independent Upper Bound).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem35.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Fix any integers $m\geq 2$ and $K\in\mathbb{N}_{+}\text{.}$ &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; runs in per-round time $O(mK)$ and, for any sequence $(x_{t},y_{t})_{t=1}^{T}\in[m]^{2}\times[0,1]\text{,}$ satisfies $R_{T}\leq 2m\,\log\!\binom{m+K}{K}+T/(4K^{2})\text{.}$ At a level attaining the infimum below, and with $R_{T}\leq T\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A6.E74" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\min\!\bigl\{T,\;\Psi_{\mathrm{col}}(T)\bigr\},\quad\Psi_{\mathrm{col}}(T)\;:=\;\inf_{K\in\mathbb{N}_{+}}\!\biggl\{2m\,\log\!\binom{m+K}{K}\,+\,\frac{T}{4K^{2}}\biggr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(73)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A6.SS1.SSS4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Attainment.&lt;/em&gt; Since $\log\binom{m+K}{K}\geq\log(K{+}1)\text{,}$ the objective defining $\Psi_{\mathrm{col}}$ tends to infinity with $K\text{,}$ and its infimum is attained.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Per-round time.&lt;/span&gt; By &lt;a href="#Thmtheorem32" title="Lemma 32 (Forward-Backward DP Correctness and Complexity). ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;32&lt;/span&gt;&lt;/a&gt;, each round runs in $O(mK)$ time.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Regret bound.&lt;/span&gt; By &lt;a href="#Thmtheorem33" title="Lemma 33 (Column-wise Decomposition of Regret). ‣ F.1.2 Comparator Class Enlargement ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemmas&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;33&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmtheorem34" title="Lemma 34 (Chain EW Regret). ‣ F.1.3 Per-Column EW Analysis ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;34&lt;/span&gt;&lt;/a&gt;,&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A6.Ex140"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A6.Ex140X"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A6.Ex140Xa"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle R_{T} &amp;amp; \displaystyle\;\leq\;\sum_{i=1}^{m}R_{i}\;\leq\;\sum_{i=1}^{m}\!\Biggl[2\log\!\binom{m+K}{K}+\frac{T_{i}}{4K^{2}}\Biggr] \\
&amp;amp; \displaystyle\;=\;2m\log\!\binom{m+K}{K}\,+\,\frac{1}{4K^{2}}\sum_{i=1}^{m}T_{i}\;=\;2m\log\!\binom{m+K}{K}\,+\,\frac{T}{4K^{2}}.
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;This holds for any $K\in\mathbb{N}_{+}\text{,}$ so $R_{T}\leq\Psi_{\mathrm{col}}(T)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.SSS4.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Trivial bound.&lt;/span&gt; Since $\hat{y}_{t},y_{t}\in[0,1]\text{,}$ $(\hat{y}_{t}-y_{t})^{2}\leq 1$ for each round; combined with $\min_{f^{*}\in\mathcal{F}_{[m]^{2}}^{\uparrow}}\sum_{t}(f^{*}(x_{t})-y_{t})^{2}\geq 0\text{,}$&lt;/p&gt;
&lt;table id="A6.Ex141" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\sum_{t=1}^{T}(\hat{y}_{t}-y_{t})^{2}\;\leq\;T.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Taking the minimum yields $R_{T}\leq\min\{T,\Psi_{\mathrm{col}}(T)\}\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A6.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="surrogate-threshold-indexed-upper-bound"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;F.2 &lt;/span&gt;Surrogate Threshold-Indexed Upper Bound&lt;/h3&gt;
&lt;div id="A6.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This appendix gives the complete proofs of &lt;a href="#Thmtheorem37" title="Lemma 37 (Surrogate Dominance and Nested Tightness). ‣ F.2.1 Surrogate Dominance and Nested Tightness ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;37&lt;/span&gt;&lt;/a&gt; (Surrogate Dominance and Nested Tightness), &lt;a href="#Thmtheorem38" title="Lemma 38 (Upset Marginal DP). ‣ F.2.2 Upset Marginal DP ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;38&lt;/span&gt;&lt;/a&gt; (Upset Marginal DP), and &lt;a href="#Thmtheorem5" title="Theorem 5 (Surrogate Upper Bound). ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; (Surrogate Upper Bound). The argument has four steps: &lt;span class="ltx_text ltx_font_bold"&gt;(i)&lt;/span&gt; &lt;a href="#A6.SS2.SSS1" title="F.2.1 Surrogate Dominance and Nested Tightness ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;F.2.1&lt;/span&gt;&lt;/a&gt; first proves the nested tightness inequality $\sum_{r}(2r-1)\,z_{r}\geq k^{2}$ (&lt;a href="#Thmtheorem36" title="Lemma 36 (Nested Tightness Inequality). ‣ F.2.1 Surrogate Dominance and Nested Tightness ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;36&lt;/span&gt;&lt;/a&gt;), then applies it to obtain &lt;a href="#Thmtheorem37" title="Lemma 37 (Surrogate Dominance and Nested Tightness). ‣ F.2.1 Surrogate Dominance and Nested Tightness ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;37&lt;/span&gt;&lt;/a&gt;; &lt;span class="ltx_text ltx_font_bold"&gt;(ii)&lt;/span&gt; &lt;a href="#A6.SS2.SSS2" title="F.2.2 Upset Marginal DP ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;F.2.2&lt;/span&gt;&lt;/a&gt; establishes the $O(m^{2})$ algorithm of &lt;a href="#Thmtheorem38" title="Lemma 38 (Upset Marginal DP). ‣ F.2.2 Upset Marginal DP ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;38&lt;/span&gt;&lt;/a&gt; via cutoff parametrization and forward-backward DP; &lt;span class="ltx_text ltx_font_bold"&gt;(iii)&lt;/span&gt; &lt;a href="#A6.SS2.SSS3" title="F.2.3 Algorithm 2 and Per-Cell EW Equivalence ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;F.2.3&lt;/span&gt;&lt;/a&gt; formalizes &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; and establishes its equivalence with EW on $\mathcal{U}$ (&lt;a href="#Thmtheorem39" title="Lemma 39 (Per-Cell EW Equivalence). ‣ Positivity and time. ‣ F.2.3 Algorithm 2 and Per-Cell EW Equivalence ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;39&lt;/span&gt;&lt;/a&gt;); &lt;span class="ltx_text ltx_font_bold"&gt;(iv)&lt;/span&gt; &lt;a href="#A6.SS2.SSS4" title="F.2.4 Proof of Theorem 5 ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;F.2.4&lt;/span&gt;&lt;/a&gt; combines exp-concavity with Jensen’s inequality, surrogate replacement, layer-wise telescoping, and comparator selection with the Block Residual to establish the regret bound of &lt;a href="#Thmtheorem5" title="Theorem 5 (Surrogate Upper Bound). ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;, then merges it with the trivial bound $R_{T}\leq T$ to complete the proof.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A6.SS2.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Recall.&lt;/h5&gt;
&lt;div id="A6.SS2.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We use the following notation. $\mathcal{F}_{[m]^{2}}^{\uparrow}$ is the class of $[0,1]$-valued isotonic functions on $[m]^{2}\text{;}$ $\mathcal{U}$ is the set of all upsets of $[m]^{2}\text{,}$ each uniquely determined by its frontier (a monotone lattice path inside $[m]^{2}$), with $|\mathcal{U}|=\binom{2m}{m}\text{;}$ $\mathcal{U}^{K}$ is the set of ordered $K$-tuples of upsets (the generalized expert class), with $|\mathcal{U}^{K}|=\binom{2m}{m}^{K}\text{.}$ For $G=(U_{1},\ldots,U_{K})\in\mathcal{U}^{K}$ and $x\in[m]^{2}\text{,}$ the prediction is $g_{G}(x):=\tfrac{1}{K}\sum_{r=1}^{K}\mathbf{1}\!\left[x\in U_{r}\right]\in\{0,1/K,\ldots,1\}\text{.}$ The surrogate loss is&lt;/p&gt;
&lt;table id="A6.E75" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widetilde{\ell}(G;\,x,y)\;:=\;y^{2}\,+\,\sum_{r=1}^{K}\!\left(\frac{2r-1}{K^{2}}-\frac{2y}{K}\right)\mathbf{1}\!\left[x\in U_{r}\right],$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(74)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and $\widetilde{\ell}_{t}(G):=\widetilde{\ell}(G;\,x_{t},y_{t})$ is its specialization at round $t\text{,}$ with per-layer coefficient $c_{r,t}:=(2r-1)/K^{2}-2y_{t}/K\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="A6.F4" class="ltx_figure"&gt;&lt;img id="A6.F4.pic1" src="threshold-layers.svg" width="222.097" height="177.051" alt="Discrete level surface and its threshold layers" loading="lazy"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;Figure 4: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Threshold-layer decomposition&lt;/span&gt; ($m=6\text{,}$ $K=3$).
Cell shade and label give $h(u)\in\{0,1,2,3\}\text{;}$ the thick frontiers are the boundaries of the nested upsets $U_{r}:=\{u:h(u)\geq r\}\text{,}$ labelled with the odd weights $w_{r}=2r-1\text{.}$ For every cell $u\text{,}$ identity (i) reads $h(u)=\sum_{r}\mathbf{1}\!\left[u\in U_{r}\right]$ and identity (ii) reads $h(u)^{2}=\sum_{r}w_{r}\,\mathbf{1}\!\left[u\in U_{r}\right]\text{.}$&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/section&gt;
&lt;section id="A6.SS2.SSS1" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="surrogate-dominance-and-nested-tightness"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;F.2.1 &lt;/span&gt;Surrogate Dominance and Nested Tightness&lt;/h4&gt;
&lt;div id="A6.SS2.SSS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This subsection first proves the nested tightness inequality (&lt;a href="#Thmtheorem36" title="Lemma 36 (Nested Tightness Inequality). ‣ F.2.1 Surrogate Dominance and Nested Tightness ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;36&lt;/span&gt;&lt;/a&gt;), then applies it to prove &lt;a href="#Thmtheorem37" title="Lemma 37 (Surrogate Dominance and Nested Tightness). ‣ F.2.1 Surrogate Dominance and Nested Tightness ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;37&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem36" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 36&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Nested Tightness Inequality).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem36.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For any $K\geq 1$ and any $z=(z_{1},\ldots,z_{K})\in\{0,1\}^{K}\text{,}$ let $k:=\sum_{r=1}^{K}z_{r}\text{.}$ Then&lt;/span&gt;&lt;/p&gt;
&lt;table id="A6.E76" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{r=1}^{K}(2r-1)\,z_{r}\;\geq\;k^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(75)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;with equality if and only if $z$ is the prefix of length $k\text{,}$ i.e., $z_{1}=\cdots=z_{k}=1$ and $z_{k+1}=\cdots=z_{K}=0\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A6.SS2.SSS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;At the prefix configuration, equality holds: if $z_{r}=1$ for $r\leq k$ and $z_{r}=0$ for $r&amp;gt;k\text{,}$ then $\sum_{r}(2r-1)\,z_{r}=\sum_{r=1}^{k}(2r-1)=k^{2}$ (the sum of the first $k$ odd numbers).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For general $z\text{,}$ define $S_{1}:=\{r\leq k:z_{r}=0\}$ and $S_{2}:=\{r&amp;gt;k:z_{r}=1\}$ (the “deficit” and “surplus” positions of $z$ relative to the prefix). From&lt;/p&gt;
&lt;table id="A6.Ex142" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$k\;=\;\sum_{r=1}^{K}z_{r}\;=\;\underbrace{(k-|S_{1}|)}_{\sum_{r\leq k}z_{r}}\;+\;\underbrace{|S_{2}|}_{\sum_{r&amp;gt;k}z_{r}},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;we have $|S_{1}|=|S_{2}|\text{.}$ Splitting $\sum_{r}(2r-1)\,z_{r}$ at $r=k\text{,}$&lt;/p&gt;
&lt;table id="A6.Ex143" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{r=1}^{K}(2r-1)\,z_{r}\;=\;\!\!\!\sum_{\begin{subarray}{c}r\leq k\\ z_{r}=1\end{subarray}}\!\!\!(2r-1)\,+\,\!\!\!\sum_{\begin{subarray}{c}r&amp;gt;k\\ z_{r}=1\end{subarray}}\!\!\!(2r-1)\;=\;\!\Biggl[\sum_{r=1}^{k}(2r-1)-\sum_{r\in S_{1}}(2r-1)\Biggr]\,+\,\sum_{r\in S_{2}}(2r-1),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;hence&lt;/p&gt;
&lt;table id="A6.E77" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{r=1}^{K}(2r-1)\,z_{r}\,-\,k^{2}\;=\;\sum_{r\in S_{2}}(2r-1)\,-\,\sum_{r\in S_{1}}(2r-1).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(76)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Let $|S_{1}|=|S_{2}|=q\text{.}$ For any bijection $\sigma:S_{1}\to S_{2}\text{,}$ the right side of (&lt;a href="#A6.E77" title="Equation 76 ‣ F.2.1 Surrogate Dominance and Nested Tightness ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;76&lt;/span&gt;&lt;/a&gt;) becomes&lt;/p&gt;
&lt;table id="A6.Ex144" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{r\in S_{1}}\bigl[(2\sigma(r)-1)-(2r-1)\bigr]\;=\;2\sum_{r\in S_{1}}(\sigma(r)-r).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;For each $r\in S_{1}\text{,}$ $r\leq k&amp;lt;\sigma(r)\text{,}$ so $\sigma(r)-r\geq 1\text{,}$ and summing,&lt;/p&gt;
&lt;table id="A6.Ex145" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{r=1}^{K}(2r-1)\,z_{r}\,-\,k^{2}\;=\;2\sum_{r\in S_{1}}(\sigma(r)-r)\;\geq\;2q\;\geq\;0,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;with equality if and only if $q=0\text{,}$ i.e., $S_{1}=S_{2}=\emptyset\text{,}$ i.e., $z$ is the prefix of length $k\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem37" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 37&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Surrogate Dominance and Nested Tightness).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem37.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For any $G=(U_{1},\ldots,U_{K})\in\mathcal{U}^{K}$ and any $(x,y)\in[m]^{2}\times[0,1]\text{:}$ &lt;/span&gt;(a) Dominance:&lt;span class="ltx_text ltx_font_italic"&gt; $\widetilde{\ell}(G;\,x,y)\geq(g_{G}(x)-y)^{2}\text{;}$ &lt;/span&gt;(b) Nested tightness:&lt;span class="ltx_text ltx_font_italic"&gt; equality if $U_{1}\supseteq U_{2}\supseteq\cdots\supseteq U_{K}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A6.SS2.SSS1.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Set $z_{r}:=\mathbf{1}\!\left[x\in U_{r}\right]\in\{0,1\}$ and $k:=\sum_{r=1}^{K}z_{r}\text{,}$ so $g_{G}(x)=\tfrac{1}{K}\sum_{r}z_{r}=k/K\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS1.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 1 (Algebraic expansion).&lt;/span&gt; From $g_{G}(x)=k/K$ and $\sum_{r=1}^{K}z_{r}=k\text{,}$&lt;/p&gt;
&lt;table id="A6.Ex146" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(g_{G}(x)-y)^{2}\;=\;\frac{k^{2}}{K^{2}}\,-\,\frac{2ky}{K}\,+\,y^{2}\;=\;\frac{k^{2}}{K^{2}}\,-\,\frac{2y}{K}\sum_{r=1}^{K}z_{r}\,+\,y^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;On the other hand,&lt;/p&gt;
&lt;table id="A6.Ex147" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widetilde{\ell}(G;\,x,y)\;=\;y^{2}\,+\,\sum_{r=1}^{K}\!\left(\frac{2r-1}{K^{2}}-\frac{2y}{K}\right)z_{r}\;=\;y^{2}\,+\,\frac{1}{K^{2}}\sum_{r=1}^{K}(2r-1)\,z_{r}\,-\,\frac{2y}{K}\sum_{r=1}^{K}z_{r}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Subtracting, the $y^{2}$ and $\tfrac{2y}{K}\sum_{r}z_{r}$ terms cancel:&lt;/p&gt;
&lt;table id="A6.E78" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widetilde{\ell}(G;\,x,y)\,-\,(g_{G}(x)-y)^{2}\;=\;\frac{1}{K^{2}}\!\left[\sum_{r=1}^{K}(2r-1)\,z_{r}\,-\,k^{2}\right].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(77)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS1.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 2 (Dominance).&lt;/span&gt; By &lt;a href="#Thmtheorem36" title="Lemma 36 (Nested Tightness Inequality). ‣ F.2.1 Surrogate Dominance and Nested Tightness ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;36&lt;/span&gt;&lt;/a&gt;, the bracket in (&lt;a href="#A6.E78" title="Equation 77 ‣ F.2.1 Surrogate Dominance and Nested Tightness ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;77&lt;/span&gt;&lt;/a&gt;) is non-negative, so $\widetilde{\ell}(G;\,x,y)\geq(g_{G}(x)-y)^{2}\text{,}$ giving (a).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS1.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 3 (Nested tightness).&lt;/span&gt; If $U_{1}\supseteq U_{2}\supseteq\cdots\supseteq U_{K}\text{,}$ then $z_{r}=\mathbf{1}\!\left[x\in U_{r}\right]$ is non-increasing in $r\text{.}$ Together with $z_{r}\in\{0,1\}\text{,}$ there exists $k^{*}\in\{0,1,\ldots,K\}$ such that $z_{r}=1$ for $r\leq k^{*}$ and $z_{r}=0$ for $r&amp;gt;k^{*}\text{;}$ since $\sum_{r}z_{r}=k\text{,}$ we have $k^{*}=k\text{,}$ so $z$ is the prefix of length $k\text{.}$ By the equality case of &lt;a href="#Thmtheorem36" title="Lemma 36 (Nested Tightness Inequality). ‣ F.2.1 Surrogate Dominance and Nested Tightness ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;36&lt;/span&gt;&lt;/a&gt;, $\sum_{r}(2r-1)\,z_{r}=k^{2}\text{,}$ and (&lt;a href="#A6.E78" title="Equation 77 ‣ F.2.1 Surrogate Dominance and Nested Tightness ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;77&lt;/span&gt;&lt;/a&gt;) gives $\widetilde{\ell}(G;\,x,y)=(g_{G}(x)-y)^{2}\text{,}$ which is (b).
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A6.SS2.SSS2" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="upset-marginal-dp"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;F.2.2 &lt;/span&gt;Upset Marginal DP&lt;/h4&gt;
&lt;div id="Thmtheorem38" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 38&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Upset Marginal DP).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem38.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Given positive weights $\{w_{ij}\}_{(i,j)\in[m]^{2}}$ and a query $(i_{0},j_{0})\text{,}$ the marginal $p:=\Pr_{U\sim\mu}[(i_{0},j_{0})\in U]$ with $\mu(U)\propto\prod_{(i,j)\in U}w_{ij}\text{,}$ $U\in\mathcal{U}\text{,}$ is computable in $O(m^{2})$ time.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A6.SS2.SSS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 1 (Cutoff parametrization).&lt;/span&gt; For each row $i\in[m]\text{,}$ define&lt;/p&gt;
&lt;table id="A6.Ex148" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$c_{i}\;:=\;\bigl|\{j\in[m]:(i,j)\notin U\}\bigr|\;\in\;\{0,1,\ldots,m\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Since $U$ is an upset, the set $\{j\in[m]:(i,j)\notin U\}$ is a down-set in $[m]\text{,}$ namely $\{1,2,\ldots,c_{i}\}\text{,}$ so $U\cap(\{i\}\times[m])=\{i\}\times\{c_{i}+1,c_{i}+2,\ldots,m\}\text{,}$ hence&lt;/p&gt;
&lt;table id="A6.E79" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$U\;=\;\bigl\{(i,j)\in[m]^{2}:j&amp;gt;c_{i}\bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(78)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The two-dimensional upset constraint ($(i,j)\in U$ and $(i^{\prime},j^{\prime})\succeq(i,j)$ imply $(i^{\prime},j^{\prime})\in U$), specialized to $i^{\prime}=i+1$ and $j^{\prime}=j\text{,}$ requires that $j&amp;gt;c_{i}\Rightarrow j&amp;gt;c_{i+1}$ for all $j\text{,}$ equivalently $c_{i+1}\leq c_{i}\text{.}$ Hence&lt;/p&gt;
&lt;table id="A6.Ex149" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{U}\;\longleftrightarrow\;\bigl\{(c_{1},\ldots,c_{m})\in\{0,1,\ldots,m\}^{m}:c_{1}\geq c_{2}\geq\cdots\geq c_{m}\bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The right side is the set of non-increasing sequences of length $m$ on $\{0,1,\ldots,m\}\text{;}$ by stars-and-bars, the total count is $\binom{2m}{m}\text{,}$ confirming $|\mathcal{U}|=\binom{2m}{m}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 2 (Weight factorization and column-tail precomputation).&lt;/span&gt; For each row $i\text{,}$ define the column-tail product&lt;/p&gt;
&lt;table id="A6.E80" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$a_{i}(c)\;:=\;\prod_{j=c+1}^{m}w_{ij},\qquad c\in\{0,1,\ldots,m\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(79)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;with the empty product $a_{i}(m)=1\text{.}$ By (&lt;a href="#A6.E79" title="Equation 78 ‣ F.2.2 Upset Marginal DP ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;78&lt;/span&gt;&lt;/a&gt;),&lt;/p&gt;
&lt;table id="A6.Ex150" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\prod_{(i,j)\in U}w_{ij}\;=\;\prod_{i=1}^{m}\prod_{j&amp;gt;c_{i}}w_{ij}\;=\;\prod_{i=1}^{m}a_{i}(c_{i}),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;so $\mu$ factorizes on the cutoff sequence space as&lt;/p&gt;
&lt;table id="A6.E81" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mu(c_{1},\ldots,c_{m})\;\propto\;\prod_{i=1}^{m}a_{i}(c_{i}),\qquad c_{1}\geq c_{2}\geq\cdots\geq c_{m}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(80)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS2.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The recursion $a_{i}(m)=1\text{,}$ $a_{i}(c)=a_{i}(c+1)\cdot w_{i,c+1}$ for $c=m-1,m-2,\ldots,0$ takes $O(m)$ per row and $O(m^{2})$ for the full table $\{a_{i}(c)\}_{i,c}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS2.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 3 (Forward DP).&lt;/span&gt; Define&lt;/p&gt;
&lt;table id="A6.E82" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F_{i}(c)\;:=\;\sum_{\begin{subarray}{c}c_{1}\geq\cdots\geq c_{i}=c\\ c_{i^{\prime}}\in\{0,\ldots,m\}\end{subarray}}\prod_{i^{\prime}=1}^{i}a_{i^{\prime}}(c_{i^{\prime}}),\qquad i\in[m],\,c\in\{0,\ldots,m\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(81)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;i.e., the sum of weights over all non-increasing prefixes $(c_{1},\ldots,c_{i})$ with $c_{i}=c$ (involving all $i$ factors $a_{1},\ldots,a_{i}$).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS2.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Base.&lt;/em&gt; For $i=1\text{,}$ the sum in (&lt;a href="#A6.E82" title="Equation 81 ‣ F.2.2 Upset Marginal DP ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;81&lt;/span&gt;&lt;/a&gt;) reduces to the single point $c_{1}=c\text{,}$ giving $F_{1}(c)=a_{1}(c)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS2.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Recursion.&lt;/em&gt; For $i\geq 2\text{,}$ grouping by the value $c^{\prime}$ of $c_{i-1}$ (with $c^{\prime}\geq c$),&lt;/p&gt;
&lt;table id="A6.E83" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F_{i}(c)\;=\;a_{i}(c)\cdot\sum_{\begin{subarray}{c}c_{1}\geq\cdots\geq c_{i-1}\geq c\\ c_{i^{\prime}}\in\{0,\ldots,m\}\end{subarray}}\prod_{i^{\prime}=1}^{i-1}a_{i^{\prime}}(c_{i^{\prime}})\;=\;a_{i}(c)\sum_{c^{\prime}\geq c}F_{i-1}(c^{\prime}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(82)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The inner sum $\sum_{c^{\prime}\geq c}F_{i-1}(c^{\prime})$ is the suffix sum of $\{F_{i-1}(c^{\prime})\}_{c^{\prime}}\text{;}$ scanning $c$ in descending order while maintaining a running accumulator gives $O(m)$ per row, and multiplying by $a_{i}(c)$ yields $F_{i}(c)$ in $O(m)$ as well, so $F$ takes $O(m^{2})$ in total.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS2.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 4 (Backward DP).&lt;/span&gt; Define&lt;/p&gt;
&lt;table id="A6.E84" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$B_{i}(c)\;:=\;\sum_{\begin{subarray}{c}c\geq c_{i+1}\geq c_{i+2}\geq\cdots\geq c_{m}\\ c_{i^{\prime}}\in\{0,\ldots,m\}\end{subarray}}\prod_{i^{\prime}=i+1}^{m}a_{i^{\prime}}(c_{i^{\prime}}),\qquad i\in\{0,1,\ldots,m\},\,c\in\{0,\ldots,m\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(83)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;i.e., the sum of weights over all non-increasing suffixes $(c_{i+1},\ldots,c_{m})$ with $c_{i+1}\leq c$ (involving the $m{-}i$ factors $a_{i+1},\ldots,a_{m}\text{,}$ but &lt;em class="ltx_emph ltx_font_italic"&gt;not&lt;/em&gt; $a_{i}$).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS2.p9" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Base.&lt;/em&gt; For $i=m\text{,}$ the sum in (&lt;a href="#A6.E84" title="Equation 83 ‣ F.2.2 Upset Marginal DP ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;83&lt;/span&gt;&lt;/a&gt;) reduces to the empty product, giving $B_{m}(c)=1$ for all $c\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS2.p10" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Recursion.&lt;/em&gt; For $i\leq m-1\text{,}$ grouping by the value $c^{\prime}$ of $c_{i+1}$ (with $c^{\prime}\leq c$),&lt;/p&gt;
&lt;table id="A6.E85" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$B_{i}(c)\;=\;\sum_{\begin{subarray}{c}c^{\prime}\leq c\\ c^{\prime}\geq c_{i+2}\geq\cdots\geq c_{m}\end{subarray}}a_{i+1}(c^{\prime})\prod_{i^{\prime}=i+2}^{m}a_{i^{\prime}}(c_{i^{\prime}})\;=\;\sum_{c^{\prime}\leq c}a_{i+1}(c^{\prime})\cdot B_{i+1}(c^{\prime}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(84)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The inner sum $\sum_{c^{\prime}\leq c}a_{i+1}(c^{\prime})\,B_{i+1}(c^{\prime})$ is the prefix sum of $\{a_{i+1}(c^{\prime})\,B_{i+1}(c^{\prime})\}_{c^{\prime}}\text{;}$ scanning $c$ in ascending order with a running accumulator gives $O(m)$ per row, so $B$ takes $O(m^{2})$ in total.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS2.p11" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 5 (Marginal formula).&lt;/span&gt; For any $i_{0}\in[m]$ and $c\in\{0,\ldots,m\}\text{,}$ fix $c_{i_{0}}=c\text{:}$ the first $i_{0}$ cutoffs satisfy $c_{1}\geq\cdots\geq c_{i_{0}}=c$ with weight sum $F_{i_{0}}(c)$ (involving all $i_{0}$ factors $a_{1},\ldots,a_{i_{0}}$); the last $m-i_{0}$ cutoffs satisfy $c_{i_{0}+1}\leq c$ and $c_{i_{0}+1}\geq\cdots\geq c_{m}$ with weight sum $B_{i_{0}}(c)$ (involving the $m-i_{0}$ factors $a_{i_{0}+1},\ldots,a_{m}\text{,}$ but not $a_{i_{0}}$).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS2.p12" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The two segments together cover each of $a_{1},\ldots,a_{m}$ exactly once, so&lt;/p&gt;
&lt;table id="A6.Ex151" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F_{i_{0}}(c)\cdot B_{i_{0}}(c)\;=\;\sum_{\begin{subarray}{c}c_{1}\geq\cdots\geq c_{m}\\ c_{i_{0}}=c\end{subarray}}\prod_{i=1}^{m}a_{i}(c_{i}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Summing over $c$ gives (independent of $i_{0}$)&lt;/p&gt;
&lt;table id="A6.E86" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{c}F_{i_{0}}(c)\cdot B_{i_{0}}(c)\;=\;\!\!\sum_{c_{1}\geq\cdots\geq c_{m}}\!\!\prod_{i=1}^{m}a_{i}(c_{i})\;=\;Z,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(85)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where $Z:=\sum_{c_{1}\geq\cdots\geq c_{m}}\prod_{i}a_{i}(c_{i})$ is the partition function of $\mu\text{.}$ In particular, since $B_{m}\equiv 1\text{,}$ $Z=\sum_{c}F_{m}(c)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS2.p13" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;By (&lt;a href="#A6.E81" title="Equation 80 ‣ F.2.2 Upset Marginal DP ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;80&lt;/span&gt;&lt;/a&gt;) and (&lt;a href="#A6.E86" title="Equation 85 ‣ F.2.2 Upset Marginal DP ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;85&lt;/span&gt;&lt;/a&gt;),&lt;/p&gt;
&lt;table id="A6.Ex152" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Pr_{\mu}\!\bigl[c_{i_{0}}=c\bigr]\;=\;\frac{F_{i_{0}}(c)\cdot B_{i_{0}}(c)}{Z};$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;by (&lt;a href="#A6.E79" title="Equation 78 ‣ F.2.2 Upset Marginal DP ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;78&lt;/span&gt;&lt;/a&gt;), $(i_{0},j_{0})\in U\Leftrightarrow j_{0}&amp;gt;c_{i_{0}}\Leftrightarrow c_{i_{0}}&amp;lt;j_{0}\text{,}$ so&lt;/p&gt;
&lt;table id="A6.E87" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$p\;=\;\Pr_{\mu}\!\bigl[c_{i_{0}}&amp;lt;j_{0}\bigr]\;=\;\frac{1}{Z}\sum_{c&amp;lt;j_{0}}F_{i_{0}}(c)\cdot B_{i_{0}}(c).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(86)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The sums in the numerator and in $Z=\sum_{c}F_{m}(c)$ are each $O(m)\text{;}$ together with the $O(m^{2})$ precomputation in Steps 2–4, the total time is $O(m^{2})\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A6.SS2.SSS3" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="algorithm-2-and-per-cell-ew-equivalence"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;F.2.3 &lt;/span&gt;Algorithm 2 and Per-Cell EW Equivalence&lt;/h4&gt;
&lt;div id="A6.SS2.SSS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This subsection formalizes &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; and shows that, for each layer $r\in[K]\text{,}$ the per-cell weight update coincides with standard EW on $\mathcal{U}$ with surrogate-coefficient losses $c_{r,t}\text{,}$ learning rate $\eta=1/2\text{,}$ and uniform initialization.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A6.SS2.SSS3.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Algorithm 2 (formal restatement).&lt;/h5&gt;
&lt;div id="A6.SS2.SSS3.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For each layer $r\in[K]$ and cell $u\in[m]^{2}\text{,}$ maintain a per-cell weight $w_{u,r}^{(t)}&amp;gt;0\text{,}$ initialized as $w_{u,r}^{(1)}:=1\text{.}$ The induced layer-$r$ distribution is&lt;/p&gt;
&lt;table id="A6.E88" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mu_{t,r}(U)\;\propto\;\prod_{u\in U}w_{u,r}^{(t)},\qquad U\in\mathcal{U},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(87)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and the global distribution is $\pi_{t}:=\bigotimes_{r=1}^{K}\mu_{t,r}$ on $\mathcal{U}^{K}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS3.Px1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;At round $t\text{,}$ upon receiving $x_{t}\in[m]^{2}\text{,}$ invoke &lt;a href="#Thmtheorem38" title="Lemma 38 (Upset Marginal DP). ‣ F.2.2 Upset Marginal DP ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;38&lt;/span&gt;&lt;/a&gt; on each layer $r$ (with weights $w_{ij}:=w_{(i,j),r}^{(t)}$ and query cell $x_{t}$) to compute&lt;/p&gt;
&lt;table id="A6.Ex153" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$p_{t,r}\;:=\;\Pr_{U\sim\mu_{t,r}}\!\bigl[x_{t}\in U\bigr],\qquad r\in[K];$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;predict $\hat{y}_{t}:=\tfrac{1}{K}\sum_{r=1}^{K}p_{t,r}\text{.}$ Upon receiving $y_{t}\in[0,1]\text{,}$ with $c_{r,t}:=(2r-1)/K^{2}-2y_{t}/K\text{,}$ update only the weight at cell $x_{t}\text{:}$&lt;/p&gt;
&lt;table id="A6.E89" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$w_{x_{t},r}^{(t+1)}\;:=\;w_{x_{t},r}^{(t)}\cdot\exp\!\left(-\frac{c_{r,t}}{2}\right),\qquad r\in[K],$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(88)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;leaving every other cell $u\neq x_{t}$ unchanged, i.e., $w_{u,r}^{(t+1)}:=w_{u,r}^{(t)}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A6.SS2.SSS3.Px2" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Positivity and time.&lt;/h5&gt;
&lt;div id="A6.SS2.SSS3.Px2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Since $w_{u,r}^{(1)}=1&amp;gt;0$ and the update factor $\exp(-c_{r,t}/2)&amp;gt;0\text{,}$ induction gives $w_{u,r}^{(t)}&amp;gt;0$ for all $t\geq 1$ and $(u,r)\text{,}$ so (&lt;a href="#A6.E88" title="Equation 87 ‣ Algorithm 2 (formal restatement). ‣ F.2.3 Algorithm 2 and Per-Cell EW Equivalence ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;87&lt;/span&gt;&lt;/a&gt;) is well-defined and the positivity hypothesis of &lt;a href="#Thmtheorem38" title="Lemma 38 (Upset Marginal DP). ‣ F.2.2 Upset Marginal DP ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;38&lt;/span&gt;&lt;/a&gt; is preserved. Each round consists of $K$ invocations of &lt;a href="#Thmtheorem38" title="Lemma 38 (Upset Marginal DP). ‣ F.2.2 Upset Marginal DP ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;38&lt;/span&gt;&lt;/a&gt; ($O(Km^{2})$) and prediction and weight updates ($O(K)$), giving $O(Km^{2})$ total per round.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem39" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 39&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Per-Cell EW Equivalence).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem39.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For each layer $r\in[K]\text{,}$ the distribution $\mu_{t,r}$ defined by (&lt;a href="#A6.E88" title="Equation 87 ‣ Algorithm 2 (formal restatement). ‣ F.2.3 Algorithm 2 and Per-Cell EW Equivalence ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;87&lt;/span&gt;&lt;/a&gt;) and (&lt;a href="#A6.E89" title="Equation 88 ‣ Algorithm 2 (formal restatement). ‣ F.2.3 Algorithm 2 and Per-Cell EW Equivalence ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;88&lt;/span&gt;&lt;/a&gt;) satisfies $\mu_{1,r}=\mathrm{Unif}(\mathcal{U})\text{,}$ and for all $t\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A6.E90" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mu_{t+1,r}(U)\;\propto\;\mu_{t,r}(U)\cdot\exp\!\left(-\frac{c_{r,t}}{2}\,\mathbf{1}\!\left[x_{t}\in U\right]\right),\qquad U\in\mathcal{U}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(89)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;That is, $\mu_{t,r}$ is the Exponential Weights distribution on $\mathcal{U}$ with loss sequence $\{c_{r,s}\,\mathbf{1}\!\left[x_{s}\in\cdot\right]\}_{s&amp;lt;t}\text{,}$ learning rate $\eta=1/2\text{,}$ and uniform initialization.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A6.SS2.SSS3.Px2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Initial distribution.&lt;/span&gt; Since $w_{u,r}^{(1)}=1$ for all $u\text{,}$ $\mu_{1,r}(U)\propto\prod_{u\in U}1=1\text{,}$ and since $|\mathcal{U}|$ is finite, the normalization gives $\mu_{1,r}=\mathrm{Unif}(\mathcal{U})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS3.Px2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Per-round equivalence.&lt;/span&gt; By (&lt;a href="#A6.E89" title="Equation 88 ‣ Algorithm 2 (formal restatement). ‣ F.2.3 Algorithm 2 and Per-Cell EW Equivalence ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;88&lt;/span&gt;&lt;/a&gt;): $w_{u,r}^{(t+1)}=w_{u,r}^{(t)}\cdot\exp(-c_{r,t}/2)$ for $u=x_{t}\text{,}$ and $w_{u,r}^{(t+1)}=w_{u,r}^{(t)}$ for $u\neq x_{t}\text{.}$ Equivalently, $w_{u,r}^{(t+1)}=w_{u,r}^{(t)}\cdot\xi_{u,t}\text{,}$ where&lt;/p&gt;
&lt;table id="A6.Ex154" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\xi_{u,t}\;:=\;\begin{cases}\exp(-c_{r,t}/2),&amp;amp;u=x_{t},\\ 1,&amp;amp;u\neq x_{t}.\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Taking the product over $U\in\mathcal{U}\text{,}$&lt;/p&gt;
&lt;table id="A6.Ex155" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\prod_{u\in U}w_{u,r}^{(t+1)}\;=\;\prod_{u\in U}w_{u,r}^{(t)}\cdot\prod_{u\in U}\xi_{u,t}\;=\;\prod_{u\in U}w_{u,r}^{(t)}\cdot\exp\!\left(-\frac{c_{r,t}}{2}\,\mathbf{1}\!\left[x_{t}\in U\right]\right),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where the last equality uses $\prod_{u\in U}\xi_{u,t}=\xi_{x_{t},t}^{\mathbf{1}\!\left[x_{t}\in U\right]}=\exp(-c_{r,t}\,\mathbf{1}\!\left[x_{t}\in U\right]/2)$ (only $u=x_{t}$ contributes a non-trivial factor, and only when $x_{t}\in U$). Substituting into (&lt;a href="#A6.E88" title="Equation 87 ‣ Algorithm 2 (formal restatement). ‣ F.2.3 Algorithm 2 and Per-Cell EW Equivalence ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;87&lt;/span&gt;&lt;/a&gt;) gives (&lt;a href="#A6.E90" title="Equation 89 ‣ Lemma 39 (Per-Cell EW Equivalence). ‣ Positivity and time. ‣ F.2.3 Algorithm 2 and Per-Cell EW Equivalence ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;89&lt;/span&gt;&lt;/a&gt;).
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A6.SS2.SSS3.Px3" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Closed form.&lt;/h5&gt;
&lt;div id="A6.SS2.SSS3.Px3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Iterating (&lt;a href="#A6.E90" title="Equation 89 ‣ Lemma 39 (Per-Cell EW Equivalence). ‣ Positivity and time. ‣ F.2.3 Algorithm 2 and Per-Cell EW Equivalence ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;89&lt;/span&gt;&lt;/a&gt;) and combining $\sum_{s&amp;lt;t}$ gives the closed form&lt;/p&gt;
&lt;table id="A6.E91" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mu_{t,r}(U)\;\propto\;\exp\!\left(-\frac{1}{2}\sum_{s&amp;lt;t}c_{r,s}\,\mathbf{1}\!\left[x_{s}\in U\right]\right),\qquad U\in\mathcal{U}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(90)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A6.SS2.SSS4" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="proof-of-theorem-5"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;F.2.4 &lt;/span&gt;Proof of &lt;a href="#Thmtheorem5" title="Theorem 5 (Surrogate Upper Bound). ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;
&lt;/h4&gt;
&lt;div id="A6.SS2.SSS4.p1" class="ltx_para"&gt;
&lt;div id="restatement-Thmtheorem5-Thmtheorem5" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 5&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Surrogate Upper Bound).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="restatement-Thmtheorem5-Thmtheorem5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Fix any integers $m\geq 2$ and $K\in\mathbb{N}_{+}\text{.}$ &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; runs in per-round time $O(Km^{2})$ and, for any sequence $(x_{t},y_{t})_{t=1}^{T}\in[m]^{2}\times[0,1]\text{,}$ satisfies $R_{T}\leq 2K\,\log\!\binom{2m}{m}+T/(4K^{2})\text{.}$ At a level attaining the infimum below, and with $R_{T}\leq T\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="restatement-Thmtheorem5-S5.E6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\min\!\bigl\{T,\;\Psi_{\mathrm{surr}}(T)\bigr\},\quad\Psi_{\mathrm{surr}}(T)\;:=\;\inf_{K\in\mathbb{N}_{+}}\!\biggl\{2K\,\log\!\binom{2m}{m}\,+\,\frac{T}{4K^{2}}\biggr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(6)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A6.SS2.SSS4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Attainment.&lt;/em&gt; The objective defining $\Psi_{\mathrm{surr}}$ tends to infinity with $K\text{,}$ and its infimum is attained.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Per-round time.&lt;/span&gt; Established in &lt;a href="#A6.SS2.SSS3" title="F.2.3 Algorithm 2 and Per-Cell EW Equivalence ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;F.2.3&lt;/span&gt;&lt;/a&gt; as $O(Km^{2})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS4.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Regret bound.&lt;/span&gt; Since $\pi_{t}=\bigotimes_{r}\mu_{t,r}$ and $g_{G}(x_{t})=\tfrac{1}{K}\sum_{r}\mathbf{1}\!\left[x_{t}\in U_{r}\right]\text{,}$&lt;/p&gt;
&lt;table id="A6.Ex156" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\hat{y}_{t}\;=\;\tfrac{1}{K}\sum_{r=1}^{K}p_{t,r}\;=\;\tfrac{1}{K}\sum_{r=1}^{K}\mathbb{E}_{U\sim\mu_{t,r}}\!\bigl[\mathbf{1}\!\left[x_{t}\in U\right]\bigr]\;=\;\mathbb{E}_{G\sim\pi_{t}}\!\bigl[g_{G}(x_{t})\bigr].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS4.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 1 (Exp-concavity and Jensen).&lt;/span&gt; The map $p\mapsto\exp(-\tfrac{1}{2}(p-y_{t})^{2})$ is concave on $p\in[0,1]$ (the squared loss is $\tfrac{1}{2}$-exp-concave); by Jensen’s inequality,&lt;/p&gt;
&lt;table id="A6.Ex157" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\exp\!\left(-\tfrac{1}{2}(\hat{y}_{t}-y_{t})^{2}\right)\;=\;\exp\!\left(-\tfrac{1}{2}\!\left(\mathbb{E}_{G\sim\pi_{t}}[g_{G}(x_{t})]-y_{t}\right)^{2}\right)\;\geq\;\mathbb{E}_{G\sim\pi_{t}}\!\left[\exp\!\left(-\tfrac{1}{2}(g_{G}(x_{t})-y_{t})^{2}\right)\right].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Taking $-2\log$ of both sides (which reverses the inequality):&lt;/p&gt;
&lt;table id="A6.E92" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(\hat{y}_{t}-y_{t})^{2}\;\leq\;-2\log\,\mathbb{E}_{G\sim\pi_{t}}\!\left[\exp\!\left(-\tfrac{1}{2}(g_{G}(x_{t})-y_{t})^{2}\right)\right].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(91)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS4.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 2 (Surrogate replacement).&lt;/span&gt; By &lt;a href="#Thmtheorem37" title="Lemma 37 (Surrogate Dominance and Nested Tightness). ‣ F.2.1 Surrogate Dominance and Nested Tightness ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;37&lt;/span&gt;&lt;/a&gt;(a), $\widetilde{\ell}_{t}(G)\geq(g_{G}(x_{t})-y_{t})^{2}\text{,}$ so $\exp(-\widetilde{\ell}_{t}(G)/2)\leq\exp(-(g_{G}(x_{t})-y_{t})^{2}/2)\text{;}$ taking the $\pi_{t}$-expectation preserves the inequality, and applying $-2\log$ reverses it:&lt;/p&gt;
&lt;table id="A6.E93" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(\hat{y}_{t}-y_{t})^{2}\;\leq\;-2\log\,\mathbb{E}_{G\sim\pi_{t}}\!\left[\exp\!\left(-\tfrac{1}{2}\widetilde{\ell}_{t}(G)\right)\right].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(92)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS4.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 3 (Layer-wise telescoping).&lt;/span&gt; By the layer-wise additivity $\widetilde{\ell}_{s}(G)=y_{s}^{2}+\sum_{r}c_{r,s}\,\mathbf{1}\!\left[x_{s}\in U_{r}\right]$ and &lt;a href="#Thmtheorem39" title="Lemma 39 (Per-Cell EW Equivalence). ‣ Positivity and time. ‣ F.2.3 Algorithm 2 and Per-Cell EW Equivalence ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;39&lt;/span&gt;&lt;/a&gt; (specifically (&lt;a href="#A6.E91" title="Equation 90 ‣ Closed form. ‣ F.2.3 Algorithm 2 and Per-Cell EW Equivalence ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;90&lt;/span&gt;&lt;/a&gt;)),&lt;/p&gt;
&lt;table id="A6.E94" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\begin{split}\pi_{t}(G)&amp;amp;\;=\;\prod_{r=1}^{K}\mu_{t,r}(U_{r})\;\propto_{G}\;\prod_{r=1}^{K}\exp\!\left(-\tfrac{1}{2}\sum_{s&amp;lt;t}c_{r,s}\,\mathbf{1}\!\left[x_{s}\in U_{r}\right]\right)\\ &amp;amp;\;=\;\exp\!\left(-\tfrac{1}{2}\sum_{s&amp;lt;t}\sum_{r=1}^{K}c_{r,s}\,\mathbf{1}\!\left[x_{s}\in U_{r}\right]\right).\end{split}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(93)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS4.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Define the cumulative weight and partition function (with base distribution $\pi_{1}=\bigotimes_{r}\mathrm{Unif}(\mathcal{U})=\mathrm{Unif}(\mathcal{U}^{K})$):&lt;/p&gt;
&lt;table id="A6.Ex158" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$W_{t}(G)\;:=\;\exp\!\left(-\tfrac{1}{2}\sum_{s&amp;lt;t}\widetilde{\ell}_{s}(G)\right),\qquad Z_{t}\;:=\;\mathbb{E}_{G\sim\pi_{1}}\!\bigl[W_{t}(G)\bigr],$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;with the empty-sum convention, so $W_{1}\equiv 1$ and $Z_{1}=1\text{.}$ Since $\sum_{s&amp;lt;t}y_{s}^{2}$ is independent of $G\text{,}$&lt;/p&gt;
&lt;table id="A6.Ex159" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$W_{t}(G)\;=\;\exp\!\left(-\tfrac{1}{2}\sum_{s&amp;lt;t}y_{s}^{2}\right)\cdot\exp\!\left(-\tfrac{1}{2}\sum_{s&amp;lt;t}\sum_{r}c_{r,s}\,\mathbf{1}\!\left[x_{s}\in U_{r}\right]\right)\;\propto_{G}\;\pi_{t}(G),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where the last step uses (&lt;a href="#A6.E94" title="Equation 93 ‣ F.2.4 Proof of Theorem 5 ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;93&lt;/span&gt;&lt;/a&gt;). After normalization, $\pi_{t}(G)=\pi_{1}(G)\,W_{t}(G)/Z_{t}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS4.p9" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;By the standard EW potential argument,&lt;/p&gt;
&lt;table id="A6.Ex160" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}_{G\sim\pi_{t}}\!\left[\exp\!\left(-\tfrac{1}{2}\widetilde{\ell}_{t}(G)\right)\right]\;=\;\frac{1}{Z_{t}}\mathbb{E}_{G\sim\pi_{1}}\!\left[W_{t}(G)\exp\!\left(-\tfrac{1}{2}\widetilde{\ell}_{t}(G)\right)\right]\;=\;\frac{\mathbb{E}_{\pi_{1}}[W_{t+1}(G)]}{Z_{t}}\;=\;\frac{Z_{t+1}}{Z_{t}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Substituting into (&lt;a href="#A6.E93" title="Equation 92 ‣ F.2.4 Proof of Theorem 5 ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;92&lt;/span&gt;&lt;/a&gt;) and summing over $t=1,\ldots,T$ (telescoping),&lt;/p&gt;
&lt;table id="A6.Ex161" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{t=1}^{T}(\hat{y}_{t}-y_{t})^{2}\;\leq\;-2\sum_{t=1}^{T}\log\frac{Z_{t+1}}{Z_{t}}\;=\;-2\log\frac{Z_{T+1}}{Z_{1}}\;=\;-2\log Z_{T+1},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where the last equality uses $Z_{1}=1\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS4.p10" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;To lower-bound $Z_{T+1}\text{:}$ for any $G^{*}\in\mathcal{U}^{K}\text{,}$ since $\pi_{1}(G^{*})=\binom{2m}{m}^{-K}\text{,}$&lt;/p&gt;
&lt;table id="A6.Ex162" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$Z_{T+1}\;=\;\mathbb{E}_{G\sim\pi_{1}}[W_{T+1}(G)]\;\geq\;\pi_{1}(G^{*})\cdot W_{T+1}(G^{*})\;=\;\binom{2m}{m}^{-K}\exp\!\left(-\tfrac{1}{2}\sum_{t=1}^{T}\widetilde{\ell}_{t}(G^{*})\right).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Applying $-2\log$ (which reverses the direction):&lt;/p&gt;
&lt;table id="A6.E95" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{t=1}^{T}(\hat{y}_{t}-y_{t})^{2}\;\leq\;-2\log Z_{T+1}\;\leq\;\sum_{t=1}^{T}\widetilde{\ell}_{t}(G^{*})\,+\,2K\log\!\binom{2m}{m}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(94)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS4.p11" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 4 (Comparator selection and Block Residual).&lt;/span&gt; Take&lt;/p&gt;
&lt;table id="A6.Ex163" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$f^{*}\;\in\;\operatorname*{arg\,min}_{f\in\mathcal{F}_{[m]^{2}}^{\uparrow}}\sum_{t=1}^{T}\bigl(f(x_{t})-y_{t}\bigr)^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and let $q:[0,1]\to\{0,1/K,\ldots,1\}\text{,}$ $q(v):=\lfloor Kv+1/2\rfloor/K\text{,}$ denote rounding to the $K$-grid; set $\hat{f}:=q\circ f^{*}\text{.}$ Since $q$ is non-decreasing and $f^{*}$ is isotonic, $\hat{f}$ is isotonic and takes values in $\{0,1/K,\ldots,1\}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS4.p12" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Define the nested upset sequence&lt;/p&gt;
&lt;table id="A6.Ex164" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$U_{r}^{*}\;:=\;\bigl\{u\in[m]^{2}:\hat{f}(u)\geq r/K\bigr\},\qquad r\in[K].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Since $\hat{f}$ is isotonic, each $U_{r}^{*}$ is an upset of $[m]^{2}\text{;}$ since $r/K$ is strictly increasing in $r\text{,}$ $U_{1}^{*}\supseteq U_{2}^{*}\supseteq\cdots\supseteq U_{K}^{*}\text{.}$ Set $G^{*}:=(U_{1}^{*},\ldots,U_{K}^{*})\in\mathcal{U}^{K}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS4.p13" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Identifying $g_{G^{*}}$ with $\hat{f}\text{.}$&lt;/em&gt; For any $u\in[m]^{2}\text{,}$ since $\hat{f}(u)\in\{0,1/K,\ldots,1\}\text{,}$ there is a unique $k\in\{0,1,\ldots,K\}$ with $\hat{f}(u)=k/K\text{.}$ Then&lt;/p&gt;
&lt;table id="A6.Ex165" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbf{1}\!\left[u\in U_{r}^{*}\right]\;=\;\mathbf{1}\!\left[\hat{f}(u)\geq r/K\right]\;=\;\mathbf{1}\!\left[k\geq r\right],$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;so&lt;/p&gt;
&lt;table id="A6.Ex166" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$g_{G^{*}}(u)\;=\;\tfrac{1}{K}\sum_{r=1}^{K}\mathbf{1}\!\left[u\in U_{r}^{*}\right]\;=\;\tfrac{1}{K}\cdot\bigl|\{r\in[K]:r\leq k\}\bigr|\;=\;\tfrac{k}{K}\;=\;\hat{f}(u).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS4.p14" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Applying &lt;a href="#Thmtheorem37" title="Lemma 37 (Surrogate Dominance and Nested Tightness). ‣ F.2.1 Surrogate Dominance and Nested Tightness ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;37&lt;/span&gt;&lt;/a&gt;(b).&lt;/em&gt; Since $G^{*}$ is nested, &lt;a href="#Thmtheorem37" title="Lemma 37 (Surrogate Dominance and Nested Tightness). ‣ F.2.1 Surrogate Dominance and Nested Tightness ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;37&lt;/span&gt;&lt;/a&gt;(b) gives $\widetilde{\ell}_{t}(G^{*})=(g_{G^{*}}(x_{t})-y_{t})^{2}=(\hat{f}(x_{t})-y_{t})^{2}\text{;}$ substituting into (&lt;a href="#A6.E95" title="Equation 94 ‣ F.2.4 Proof of Theorem 5 ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;94&lt;/span&gt;&lt;/a&gt;),&lt;/p&gt;
&lt;table id="A6.E96" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{t=1}^{T}(\hat{y}_{t}-y_{t})^{2}\;\leq\;\sum_{t=1}^{T}\bigl(\hat{f}(x_{t})-y_{t}\bigr)^{2}\,+\,2K\log\!\binom{2m}{m}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(95)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS4.p15" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Discretization error.&lt;/em&gt; For each value $c$ attained by $f^{*}\text{,}$ let $\delta_{c}:=q(c)-c\text{;}$ since $q$ rounds to the nearest grid point, $|\delta_{c}|\leq 1/(2K)\text{,}$ so $\hat{f}(u)=q(f^{*}(u))=f^{*}(u)+\delta_{f^{*}(u)}\text{.}$ Define the query counts and blocks&lt;/p&gt;
&lt;table id="A6.Ex167" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$w_{u}\;:=\;\bigl|\{t\in[T]:x_{t}=u\}\bigr|,\qquad B_{c}\;:=\;\bigl\{u\in[m]^{2}:w_{u}&amp;gt;0,\,f^{*}(u)=c\bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Applying &lt;a href="#Thmtheorem8" title="Lemma 8 (Block Residual). ‣ Recall. ‣ Appendix B Block Residual Property ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt; (Block Residual) on the poset $\mathcal{P}=[m]^{2}$ with sequence $(x_{t},y_{t})_{t=1}^{T}$ and minimizer $f^{*}\text{:}$ for each value $c\text{,}$&lt;/p&gt;
&lt;table id="A6.E97" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\!\!\sum_{t\,:\,x_{t}\in B_{c}}\!\!\bigl(f^{*}(x_{t})-y_{t}\bigr)\;=\;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(96)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS4.p16" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Decomposing the loss difference between $\hat{f}$ and $f^{*}$ by block: for $u\in B_{c}\text{,}$ $f^{*}(u)=c$ and $\hat{f}(u)=c+\delta_{c}\text{,}$ so for $t:x_{t}\in B_{c}\text{,}$&lt;/p&gt;
&lt;table id="A6.Ex168" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\bigl(\hat{f}(x_{t})-y_{t}\bigr)^{2}-\bigl(f^{*}(x_{t})-y_{t}\bigr)^{2}\;=\;(c+\delta_{c}-y_{t})^{2}-(c-y_{t})^{2}\;=\;\delta_{c}^{2}+2\,\delta_{c}\,(c-y_{t}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Summing over $\{t:x_{t}\in B_{c}\}$ (with $w_{B_{c}}:=\sum_{u\in B_{c}}w_{u}$),&lt;/p&gt;
&lt;table id="A6.Ex169" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\!\!\sum_{t\,:\,x_{t}\in B_{c}}\!\!\bigl[(\hat{f}(x_{t})-y_{t})^{2}-(f^{*}(x_{t})-y_{t})^{2}\bigr]\;=\;w_{B_{c}}\,\delta_{c}^{2}\,+\,2\,\delta_{c}\underbrace{\sum_{t\,:\,x_{t}\in B_{c}}(c-y_{t})}_{=\,0\text{ by }\text{(96)}},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where $c=f^{*}(x_{t})$ for $x_{t}\in B_{c}\text{.}$ Summing over $c$ (with $\sum_{c}w_{B_{c}}=\sum_{u}w_{u}=T$),&lt;/p&gt;
&lt;table id="A6.E98" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{t=1}^{T}\!\bigl[(\hat{f}(x_{t})-y_{t})^{2}-(f^{*}(x_{t})-y_{t})^{2}\bigr]\;=\;\sum_{c}w_{B_{c}}\,\delta_{c}^{2}\;\leq\;\frac{T}{4K^{2}},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(97)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where the final inequality uses $\delta_{c}^{2}\leq 1/(4K^{2})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS4.p17" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Combining.&lt;/em&gt; By (&lt;a href="#A6.E96" title="Equation 95 ‣ F.2.4 Proof of Theorem 5 ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;95&lt;/span&gt;&lt;/a&gt;) and (&lt;a href="#A6.E98" title="Equation 97 ‣ F.2.4 Proof of Theorem 5 ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;97&lt;/span&gt;&lt;/a&gt;),&lt;/p&gt;
&lt;table id="A6.Ex170" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;=\;\sum_{t=1}^{T}(\hat{y}_{t}-y_{t})^{2}\,-\,\sum_{t=1}^{T}\bigl(f^{*}(x_{t})-y_{t}\bigr)^{2}\;\leq\;2K\log\!\binom{2m}{m}\,+\,\frac{T}{4K^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;This holds for any $K\in\mathbb{N}_{+}\text{,}$ so $R_{T}\leq\Psi_{\mathrm{surr}}(T)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.SSS4.p18" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Trivial bound.&lt;/span&gt; Since $\hat{y}_{t},y_{t}\in[0,1]\text{,}$ $(\hat{y}_{t}-y_{t})^{2}\leq 1$ per round; combined with $\min_{f^{*}\in\mathcal{F}_{[m]^{2}}^{\uparrow}}\sum_{t}(f^{*}(x_{t})-y_{t})^{2}\geq 0\text{,}$ $R_{T}\leq T\text{.}$ Taking the minimum yields $R_{T}\leq\min\{T,\Psi_{\mathrm{surr}}(T)\}\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A6.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="combined-upper-bound-and-horizon-free-wrapper"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;F.3 &lt;/span&gt;Combined Upper Bound and Horizon-Free Wrapper&lt;/h3&gt;
&lt;div id="A6.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This appendix gives the complete proofs of &lt;a href="#Thmtheorem40" title="Theorem 40 (Combined Upper Bound). ‣ F.3.1 Combined Upper Bound ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;40&lt;/span&gt;&lt;/a&gt; (Combined Upper Bound) and &lt;a href="#Thmtheorem6" title="Theorem 6 (Horizon-Free Polynomial-Time Rate-Optimal Algorithm). ‣ Rate-doubling wrapper. ‣ 5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt; (Horizon-Free Polynomial-Time Rate-Optimal Algorithm). The argument has three steps: &lt;span class="ltx_text ltx_font_bold"&gt;(i)&lt;/span&gt; &lt;a href="#A6.SS3.SSS1" title="F.3.1 Combined Upper Bound ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;F.3.1&lt;/span&gt;&lt;/a&gt; obtains &lt;a href="#Thmtheorem40" title="Theorem 40 (Combined Upper Bound). ‣ F.3.1 Combined Upper Bound ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;40&lt;/span&gt;&lt;/a&gt; as the minimum of &lt;a href="#Thmtheorem35" title="Theorem 35 (Column-Independent Upper Bound). ‣ F.1.4 Proof of Theorem 35 ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;35&lt;/span&gt;&lt;/a&gt;, &lt;a href="#Thmtheorem5" title="Theorem 5 (Surrogate Upper Bound). ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;, and the trivial $T$ bound, and establishes that $\Phi(T):=\min\{T,\Psi_{\mathrm{col}}(T),\Psi_{\mathrm{surr}}(T)\}$ satisfies the five properties required by the generic wrapper framework (&lt;a href="#Thmtheorem41" title="Lemma 41 (Properties of Φ). ‣ F.3.1 Combined Upper Bound ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;41&lt;/span&gt;&lt;/a&gt;); &lt;span class="ltx_text ltx_font_bold"&gt;(ii)&lt;/span&gt; &lt;a href="#A6.SS3.SSS2" title="F.3.2 Generic Φ-Wrapper Framework ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;F.3.2&lt;/span&gt;&lt;/a&gt; abstracts the generic $\Phi$-wrapper framework (&lt;a href="#Thmtheorem42" title="Lemma 42 (Generic Φ-Wrapper Regret). ‣ Setup. ‣ F.3.2 Generic Φ-Wrapper Framework ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;42&lt;/span&gt;&lt;/a&gt;), proving that for any $\Phi$ satisfying these five properties and any base algorithm class satisfying the base regret hypothesis, the epoch-restart wrapper gives $R_{T}\leq 4\Phi(T)+2\text{;}$ &lt;span class="ltx_text ltx_font_bold"&gt;(iii)&lt;/span&gt; &lt;a href="#A6.SS3.SSS3" title="F.3.3 Proof of Theorem 6 ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;F.3.3&lt;/span&gt;&lt;/a&gt; formalizes &lt;a href="#alg3" title="In Algorithm 3 (formal restatement). ‣ F.3.3 Proof of Theorem 6 ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; and applies &lt;a href="#Thmtheorem42" title="Lemma 42 (Generic Φ-Wrapper Regret). ‣ Setup. ‣ F.3.2 Generic Φ-Wrapper Framework ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;42&lt;/span&gt;&lt;/a&gt; to the specific $\Phi$ and base algorithms (&lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;, &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;) of &lt;a href="#S5.SS3" title="5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.3&lt;/span&gt;&lt;/a&gt; to obtain &lt;a href="#Thmtheorem6" title="Theorem 6 (Horizon-Free Polynomial-Time Rate-Optimal Algorithm). ‣ Rate-doubling wrapper. ‣ 5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;; the per-round time $\mathrm{poly}(m,t)$ is established directly via the polynomial growth of base per-round time in the horizon $L$ and the polynomial $(m,t)$-bound on $L_{k}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A6.SS3.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Recall.&lt;/h5&gt;
&lt;div id="A6.SS3.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We use the following notation. $\mathcal{F}_{[m]^{2}}^{\uparrow}$ denotes the class of $[0,1]$-valued isotonic functions on $[m]^{2}\text{;}$ $\Phi(T):=\min\{T,\Psi_{\mathrm{col}}(T),\Psi_{\mathrm{surr}}(T)\}$ is the lower-envelope regret bound, with $\Psi_{\mathrm{col}}(T)=\inf_{K\in\mathbb{N}_{+}}\{2m\log\binom{m+K}{K}+T/(4K^{2})\}$ and $\Psi_{\mathrm{surr}}(T)=\inf_{K\in\mathbb{N}_{+}}\{2K\log\binom{2m}{m}+T/(4K^{2})\}$ given by &lt;a href="#Thmtheorem35" title="Theorem 35 (Column-Independent Upper Bound). ‣ F.1.4 Proof of Theorem 35 ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorems&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;35&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmtheorem5" title="Theorem 5 (Surrogate Upper Bound). ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; as inf-of-affine forms; $L_{k}:=\max\{L\in\mathbb{N}_{+}:\Phi(L)\leq 2^{k-1}\}$ is the last-below epoch length (&lt;a href="#S5.E8" title="Equation 8 ‣ Rate-doubling wrapper. ‣ 5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt;); $T_{j}:=\sum_{k\leq j}L_{k}$ ($T_{0}:=0$) is the cumulative epoch length; and $W^{\Phi}$ denotes the epoch-restart wrapper described in &lt;a href="#alg3" title="In Algorithm 3 (formal restatement). ‣ F.3.3 Proof of Theorem 6 ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;. Within epoch $k$ (i.e., $T_{k-1}&amp;lt;t\leq T_{k}$), the wrapper selects the base algorithm $A_{k}$ to be &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; with $K^{*}=K^{*}_{\mathrm{col}}(L_{k})$ if $\Psi_{\mathrm{col}}(L_{k})\leq\Psi_{\mathrm{surr}}(L_{k})\text{,}$ and &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; with $K^{*}=K^{*}_{\mathrm{surr}}(L_{k})$ otherwise; $A_{k}$ is freshly initialized at the start of each epoch and shares no state across epochs.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A6.SS3.SSS1" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="combined-upper-bound"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;F.3.1 &lt;/span&gt;Combined Upper Bound&lt;/h4&gt;
&lt;div id="A6.SS3.SSS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This subsection proves &lt;a href="#Thmtheorem40" title="Theorem 40 (Combined Upper Bound). ‣ F.3.1 Combined Upper Bound ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;40&lt;/span&gt;&lt;/a&gt; and establishes the five properties of $\Phi$ (&lt;a href="#Thmtheorem41" title="Lemma 41 (Properties of Φ). ‣ F.3.1 Combined Upper Bound ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;41&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem40" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 40&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Combined Upper Bound).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem40.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For any $m\geq 2\text{,}$ $T\geq 1\text{,}$ and any sequence $(x_{t},y_{t})_{t=1}^{T}\in[m]^{2}\times[0,1]\text{,}$ the combined strategy runs in $\mathrm{poly}(m,T)$ per-round time and satisfies $R_{T}\leq\Phi(T)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A6.SS3.SSS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;a href="#Thmtheorem35" title="Theorem 35 (Column-Independent Upper Bound). ‣ F.1.4 Proof of Theorem 35 ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;35&lt;/span&gt;&lt;/a&gt; (specialized to $K^{*}=K^{*}_{\mathrm{col}}(T)$) gives $R_{T}\leq\Psi_{\mathrm{col}}(T)\text{,}$ and &lt;a href="#Thmtheorem5" title="Theorem 5 (Surrogate Upper Bound). ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; (specialized to $K^{*}=K^{*}_{\mathrm{surr}}(T)$) gives $R_{T}\leq\Psi_{\mathrm{surr}}(T)\text{.}$ The combined strategy chooses the smaller of the two depending on whether $\Psi_{\mathrm{col}}(T)\leq\Psi_{\mathrm{surr}}(T)$ and runs the chosen algorithm over the entire sequence, so the resulting regret satisfies $R_{T}\leq\min\{\Psi_{\mathrm{col}}(T),\Psi_{\mathrm{surr}}(T)\}\text{.}$ Together with the trivial bound $R_{T}\leq T$ (since $\hat{y}_{t},y_{t}\in[0,1]$ implies a per-round squared loss at most $1$ and the isotonic comparator loss is non-negative), taking the minimum of the three gives $R_{T}\leq\Phi(T)\text{.}$ The per-round time is polynomial in $(m,T)\text{:}$ &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; runs in $O(mK^{*}_{\mathrm{col}}(T))$ per round (&lt;a href="#Thmtheorem32" title="Lemma 32 (Forward-Backward DP Correctness and Complexity). ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;32&lt;/span&gt;&lt;/a&gt;); &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; runs in $O(K^{*}_{\mathrm{surr}}(T)\,m^{2})$ per round (&lt;a href="#A6.SS2.SSS3" title="F.2.3 Algorithm 2 and Per-Cell EW Equivalence ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;F.2.3&lt;/span&gt;&lt;/a&gt;); and both $K^{*}_{\mathrm{col}}(T)$ and $K^{*}_{\mathrm{surr}}(T)$ are polynomial in $(m,T)$ (concretely, $K^{*}_{\mathrm{col}}(T)\leq O(\sqrt{T}/m+(T/m)^{1/3}+1)$ and $K^{*}_{\mathrm{surr}}(T)\leq O((T/m)^{1/3}+1)\text{;}$ see &lt;a href="#S5.SS1" title="5.1 Column-Independent Chain Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Sections&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.1&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S5.SS2" title="5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.2&lt;/span&gt;&lt;/a&gt;).
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem41" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 41&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Properties of $\Phi$).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem41.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;$\Phi(T)=\min\{T,\Psi_{\mathrm{col}}(T),\Psi_{\mathrm{surr}}(T)\}$&lt;span class="ltx_text ltx_font_italic"&gt; satisfies, on $\mathbb{R}_{+}\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;ol id="A6.I1" class="ltx_enumerate"&gt;
&lt;li id="A6.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(P1)&lt;/span&gt;
&lt;div id="A6.I1.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;$\Phi(0)=0$&lt;span class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A6.I1.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(P2)&lt;/span&gt;
&lt;div id="A6.I1.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;$\Phi$&lt;span class="ltx_text ltx_font_italic"&gt; is non-decreasing;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A6.I1.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(P3)&lt;/span&gt;
&lt;div id="A6.I1.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;$\Phi$&lt;span class="ltx_text ltx_font_italic"&gt; is concave;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A6.I1.i4" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(P4)&lt;/span&gt;
&lt;div id="A6.I1.i4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;$\Phi$&lt;span class="ltx_text ltx_font_italic"&gt; is unbounded:
&lt;/span&gt;$\lim_{T\to\infty}\Phi(T)=\infty$&lt;span class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A6.I1.i5" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(P5)&lt;/span&gt;
&lt;div id="A6.I1.i5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;$\Phi(L+1)-\Phi(L)\leq 1$&lt;span class="ltx_text ltx_font_italic"&gt; for all &lt;/span&gt;$L\in\mathbb{N}$&lt;span class="ltx_text ltx_font_italic"&gt;
(i.e., &lt;/span&gt;$1$&lt;span class="ltx_text ltx_font_italic"&gt;-Lipschitz on &lt;/span&gt;$\mathbb{N}$&lt;span class="ltx_text ltx_font_italic"&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A6.SS3.SSS1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We address each property in turn.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS3.SSS1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(P1).&lt;/span&gt; At $T=0\text{:}$ $\Psi_{\mathrm{col}}(0)=\inf_{K\in\mathbb{N}_{+}}\{2m\log\binom{m+K}{K}\}=2m\log(m+1)&amp;gt;0$ (the minimum is attained at $K=1$); and $\Psi_{\mathrm{surr}}(0)=\inf_{K\in\mathbb{N}_{+}}\{2K\log\binom{2m}{m}\}=2\log\binom{2m}{m}&amp;gt;0$ (also at $K=1$). Hence $\Phi(0)=\min\{0,\Psi_{\mathrm{col}}(0),\Psi_{\mathrm{surr}}(0)\}=0\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS3.SSS1.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(P2).&lt;/span&gt; Each of the three terms is non-decreasing in $T\text{:}$ $T\mapsto T$ is trivial; $\Psi_{\mathrm{col}}(T)=\inf_{K}[a_{K}+T/(4K^{2})]$ (with $a_{K}:=2m\log\binom{m+K}{K}$), each $K$-th term is affine in $T$ with slope $1/(4K^{2})&amp;gt;0\text{,}$ and the infimum preserves non-decreasingness (for $T_{1}\leq T_{2}\text{,}$ $\inf_{K}f_{K}(T_{1})\leq f_{K}(T_{1})\leq f_{K}(T_{2})$ for each $K\text{,}$ so $\inf_{K}f_{K}(T_{1})\leq\inf_{K}f_{K}(T_{2})$); $\Psi_{\mathrm{surr}}$ is analogous. The minimum of non-decreasing functions is non-decreasing (for $T_{1}\leq T_{2}$ and WLOG $f(T_{1})\leq g(T_{1})\text{,}$ $\min(f,g)(T_{1})=f(T_{1})\leq f(T_{2})$ and $f(T_{1})\leq g(T_{1})\leq g(T_{2})\text{,}$ so $f(T_{1})\leq\min(f,g)(T_{2})$).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS3.SSS1.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(P3).&lt;/span&gt; Each of the three terms is concave: $T\mapsto T$ is linear, hence concave; $\Psi_{\mathrm{col}}$ and $\Psi_{\mathrm{surr}}$ are infima of affine families in $T$ (write as $\inf_{K}[a_{K}+b_{K}T]\text{,}$ with the appropriate $a_{K},b_{K}$), and the standard inf-of-affine computation gives concavity: for $\alpha\in[0,1]$ and $T_{1},T_{2}\in\mathbb{R}_{+}\text{,}$&lt;/p&gt;
&lt;table id="A6.Ex171" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi(\alpha T_{1}+(1-\alpha)T_{2})\;=\;\inf_{K}\bigl[\alpha(a_{K}+b_{K}T_{1})+(1-\alpha)(a_{K}+b_{K}T_{2})\bigr]\;\geq\;\alpha\,\Psi(T_{1})+(1-\alpha)\,\Psi(T_{2}),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where the inequality uses $\inf_{K}[\alpha A_{K}+(1-\alpha)B_{K}]\geq\alpha\inf_{K}A_{K}+(1-\alpha)\inf_{K}B_{K}\text{.}$ The minimum preserves concavity: if $f,g$ are concave, then by the concavity of $f$ and $\min(f,g)\leq f\text{,}$&lt;/p&gt;
&lt;table id="A6.Ex172" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$f(\alpha T_{1}+(1-\alpha)T_{2})\;\geq\;\alpha\,f(T_{1})+(1-\alpha)\,f(T_{2})\;\geq\;\alpha\,\min(f,g)(T_{1})+(1-\alpha)\,\min(f,g)(T_{2}),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and analogously for $g\text{.}$ Taking the smaller of the two yields $\min(f,g)(\alpha T_{1}+(1-\alpha)T_{2})\geq\alpha\,\min(f,g)(T_{1})+(1-\alpha)\,\min(f,g)(T_{2})\text{,}$ i.e., $\min(f,g)$ is concave. Combining the three concave terms with the concavity-preserving minimum, $\Phi$ is concave.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS3.SSS1.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(P4).&lt;/span&gt; Each of the three terms is unbounded: the identity $T\mapsto T$ is unbounded; by the phase-wise rates of &lt;a href="#S5.SS1" title="5.1 Column-Independent Chain Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Sections&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.1&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S5.SS2" title="5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.2&lt;/span&gt;&lt;/a&gt;, $\Psi_{\mathrm{col}}(T)=\Theta\bigl(m^{2}\log(T/m^{4})\bigr)$ in Phase 2, hence $\to\infty\text{;}$ and $\Psi_{\mathrm{surr}}(T)=\Theta(m^{2/3}T^{1/3})$ in Phases 1 and 2, $\to\infty\text{.}$ The minimum of three diverging functions diverges, so $\Phi(T)\to\infty\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS3.SSS1.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;(P5).&lt;/span&gt; By (P3) (concavity), the difference $\Delta_{L}:=\Phi(L+1)-\Phi(L)$ is non-increasing in $L\in\mathbb{N}\text{:}$ for $L_{1}\leq L_{2}\text{,}$ concavity implies that the average slope of $\Phi$ on $[L_{1},L_{1}+1]$ is at least that on $[L_{2},L_{2}+1]\text{,}$ so $\Delta_{L_{1}}\geq\Delta_{L_{2}}\text{.}$ In particular, $\Delta_{L}\leq\Delta_{0}=\Phi(1)-\Phi(0)=\Phi(1)$ (using (P1) $\Phi(0)=0$). Moreover, $\Phi(1)=\min\{1,\Psi_{\mathrm{col}}(1),\Psi_{\mathrm{surr}}(1)\}\leq 1$ (using the $T=1$ term), so $\Delta_{L}\leq 1$ for all $L\in\mathbb{N}\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A6.SS3.SSS2" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="generic-phi-wrapper-framework"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;F.3.2 &lt;/span&gt;Generic $\Phi$-Wrapper Framework&lt;/h4&gt;
&lt;div id="A6.SS3.SSS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This subsection abstracts the wrapper framework into a form independent of the specific $\Phi$ and base algorithms: given a $\Phi$ satisfying (P1)–(P5) and a class of base algorithms $\{A^{L}\}$ satisfying the base regret hypothesis, the wrapper with last-below epoch partitioning and base restart yields a horizon-free regret bound $4\Phi(T)+2\text{.}$ &lt;a href="#A6.SS3.SSS3" title="F.3.3 Proof of Theorem 6 ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;F.3.3&lt;/span&gt;&lt;/a&gt; applies this framework to the specific $\Phi$ and &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;, &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; of &lt;a href="#S5.SS3" title="5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.3&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A6.SS3.SSS2.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Setup.&lt;/h5&gt;
&lt;div id="A6.SS3.SSS2.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Suppose $\Phi:\mathbb{R}_{+}\to\mathbb{R}_{+}$ satisfies properties (P1)–(P5) of &lt;a href="#Thmtheorem41" title="Lemma 41 (Properties of Φ). ‣ F.3.1 Combined Upper Bound ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;41&lt;/span&gt;&lt;/a&gt;. Given a base algorithm class $\{A^{L}\}_{L\in\mathbb{N}_{+}}\text{,}$ where $A^{L}$ is an online algorithm taking horizon $L$ as input, satisfying the &lt;em class="ltx_emph ltx_font_italic"&gt;base regret hypothesis&lt;/em&gt;: for any sequence $(x_{s},y_{s})_{s=1}^{L}\in[m]^{2}\times[0,1]$ and any $\tau\in[1,L]\text{,}$&lt;/p&gt;
&lt;table id="A6.E99" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{\tau}(A^{L})\;:=\;\sum_{s=1}^{\tau}(\hat{y}_{s}-y_{s})^{2}\,-\,\min_{f\in\mathcal{F}_{[m]^{2}}^{\uparrow}}\sum_{s=1}^{\tau}\bigl(f(x_{s})-y_{s}\bigr)^{2}\;\leq\;\Phi(L),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(98)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where $\hat{y}_{s}$ is the prediction of $A^{L}$ at round $s\text{.}$ The $\Phi$-wrapper $W^{\Phi}$ proceeds via last-below epoch partitioning and base restart: define epoch $k\in\mathbb{N}_{+}$ length&lt;/p&gt;
&lt;table id="A6.Ex173" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$L_{k}\;:=\;\max\bigl\{L\in\mathbb{N}_{+}:\Phi(L)\leq 2^{k-1}\bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and cumulative length $T_{j}:=\sum_{k\leq j}L_{k}$ ($T_{0}:=0$); within epoch $k$ (i.e., $T_{k-1}&amp;lt;t\leq T_{k}$), run a fresh instance of $A^{L_{k}}\text{,}$ with no state shared across epochs.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem42" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 42&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Generic $\Phi$-Wrapper Regret).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem42.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Suppose $\Phi$ satisfies (P1)–(P5) and the base algorithm class $\{A^{L}\}$ satisfies (&lt;a href="#A6.E99" title="Equation 98 ‣ Setup. ‣ F.3.2 Generic Φ-Wrapper Framework ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;98&lt;/span&gt;&lt;/a&gt;). Then the wrapper $W^{\Phi}\text{,}$ for any $T\geq 1$ and any sequence $(x_{t},y_{t})_{t=1}^{T}\in[m]^{2}\times[0,1]\text{,}$ satisfies&lt;/span&gt;&lt;/p&gt;
&lt;table id="A6.E100" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}(W^{\Phi})\;\leq\;4\Phi(T)+2.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(99)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A6.SS3.SSS2.Px1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The argument has two steps: first, $L_{k}$ is well-defined and $L_{k}\geq 1\text{;}$ then we accumulate the regret across epochs.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS3.SSS2.Px1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 1 ($L_{k}$ well-defined; $L_{k}\geq 1$).&lt;/span&gt; Let $S_{k}:=\{L\in\mathbb{N}_{+}:\Phi(L)\leq 2^{k-1}\}\text{.}$ By (P5) and (P1), $\Phi(1)-\Phi(0)\leq 1$ and $\Phi(0)=0$ give $\Phi(1)\leq 1\leq 2^{k-1}$ for all $k\geq 1\text{,}$ so $1\in S_{k}$ and $S_{k}$ is non-empty. By (P4), there exists $L^{*}\in\mathbb{N}_{+}$ with $\Phi(L^{*})&amp;gt;2^{k-1}\text{;}$ combined with (P2), $\Phi$ is non-decreasing, so $S_{k}\subseteq\{1,2,\ldots,L^{*}-1\}\text{,}$ and $S_{k}$ is finite. Hence $L_{k}=\max S_{k}$ is well-defined and $L_{k}\geq 1\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS3.SSS2.Px1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 2 (Regret accumulation).&lt;/span&gt; Suppose $T\in(T_{K-1},T_{K}]$ (i.e., $T$ falls within epoch $K$). The wrapper runs a fresh instance $A^{L_{k}}_{k}$ within epoch $k\text{,}$ producing predictions on the sub-sequence $(x_{s},y_{s})$ for $T_{k-1}&amp;lt;s\leq\min(T_{k},T)\text{.}$ By the sub-additivity of the isotonic-class minimum loss across epoch partitioning—i.e., for any partitioning of $1,\ldots,T$ into epochs,&lt;/p&gt;
&lt;table id="A6.Ex174" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\min_{f\in\mathcal{F}_{[m]^{2}}^{\uparrow}}\sum_{s=1}^{T}\bigl(f(x_{s})-y_{s}\bigr)^{2}\;\geq\;\sum_{k=1}^{K}\min_{f_{k}\in\mathcal{F}_{[m]^{2}}^{\uparrow}}\!\!\sum_{s\in\text{epoch }k}\!\!\bigl(f_{k}(x_{s})-y_{s}\bigr)^{2}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;(per-epoch comparators are more flexible than a single global comparator)—the wrapper’s regret is bounded above by the sum of per-epoch regrets:&lt;/p&gt;
&lt;table id="A6.Ex175" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}(W^{\Phi})\;\leq\;\sum_{k=1}^{K-1}R_{L_{k}}\bigl(A^{L_{k}}_{k}\bigr)+R_{T-T_{K-1}}\bigl(A^{L_{K}}_{K}\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;By (&lt;a href="#A6.E99" title="Equation 98 ‣ Setup. ‣ F.3.2 Generic Φ-Wrapper Framework ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;98&lt;/span&gt;&lt;/a&gt;) (with epoch length $L_{k}$ and final segment length $T-T_{K-1}\leq L_{K}$), each term is at most $\Phi(L_{k})\text{;}$ by $L_{k}\in S_{k}\text{,}$ $\Phi(L_{k})\leq 2^{k-1}\text{.}$ Summing,&lt;/p&gt;
&lt;table id="A6.E101" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\sum_{k=1}^{K}\Phi(L_{k})\;\leq\;\sum_{k=1}^{K}2^{k-1}\;=\;2^{K}-1.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(100)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A6.SS3.SSS2.Px1.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We control $2^{K}-1$ in terms of $\Phi(T)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS3.SSS2.Px1.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Case 1&lt;/span&gt; ($K=1$). Then $T\in(0,L_{1}]\text{,}$ so by (&lt;a href="#A6.E101" title="Equation 100 ‣ Setup. ‣ F.3.2 Generic Φ-Wrapper Framework ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;100&lt;/span&gt;&lt;/a&gt;) $R_{T}\leq 2^{1}-1=1\text{.}$ By (P1) and (P2), $\Phi(T)\geq\Phi(0)=0\text{,}$ so $4\Phi(T)+2\geq 2&amp;gt;1\geq R_{T}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS3.SSS2.Px1.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Case 2&lt;/span&gt; ($K\geq 2$). Then $T\geq T_{K-1}+1\geq L_{K-1}+1$ (using $T_{K-1}=\sum_{k\leq K-1}L_{k}\geq L_{K-1}$). By the maximality of $L_{K-1}\text{,}$ $L_{K-1}+1\notin S_{K-1}\text{,}$ i.e., $\Phi(L_{K-1}+1)&amp;gt;2^{K-2}\text{.}$ Combined with (P2) and $T\geq L_{K-1}+1\text{,}$&lt;/p&gt;
&lt;table id="A6.Ex176" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Phi(T)\;\geq\;\Phi(L_{K-1}+1)\;&amp;gt;\;2^{K-2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;i.e., $4\Phi(T)&amp;gt;2^{K}\text{.}$ Hence by (&lt;a href="#A6.E101" title="Equation 100 ‣ Setup. ‣ F.3.2 Generic Φ-Wrapper Framework ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;100&lt;/span&gt;&lt;/a&gt;) $R_{T}\leq 2^{K}-1&amp;lt;4\Phi(T)-1\leq 4\Phi(T)+2\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS3.SSS2.Px1.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Combining the two cases, $R_{T}(W^{\Phi})\leq 4\Phi(T)+2\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A6.SS3.SSS3" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="proof-of-theorem-6"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;F.3.3 &lt;/span&gt;Proof of &lt;a href="#Thmtheorem6" title="Theorem 6 (Horizon-Free Polynomial-Time Rate-Optimal Algorithm). ‣ Rate-doubling wrapper. ‣ 5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;
&lt;/h4&gt;
&lt;div id="A6.SS3.SSS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This subsection applies &lt;a href="#Thmtheorem42" title="Lemma 42 (Generic Φ-Wrapper Regret). ‣ Setup. ‣ F.3.2 Generic Φ-Wrapper Framework ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;42&lt;/span&gt;&lt;/a&gt; to the specific $\Phi$ and base algorithms (&lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;, &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;) of &lt;a href="#S5.SS3" title="5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.3&lt;/span&gt;&lt;/a&gt; to obtain &lt;a href="#Thmtheorem6" title="Theorem 6 (Horizon-Free Polynomial-Time Rate-Optimal Algorithm). ‣ Rate-doubling wrapper. ‣ 5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;. &lt;a href="#alg3" title="In Algorithm 3 (formal restatement). ‣ F.3.3 Proof of Theorem 6 ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; is the specialization of $W^{\Phi}$ to $\Phi(T)=\min\{T,\Psi_{\mathrm{col}}(T),\Psi_{\mathrm{surr}}(T)\}$ described in &lt;a href="#S5.SS3" title="5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.3&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A6.SS3.SSS3.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Algorithm 3 (formal restatement).&lt;/h5&gt;
&lt;div id="A6.SS3.SSS3.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Given edge length $m\text{,}$ the wrapper maintains the current epoch index $k\text{,}$ intra-epoch round $\tau\text{,}$ and global round $t\text{,}$ initialized as $k:=1\text{,}$ $\tau:=0\text{,}$ $t:=0\text{,}$ and $L_{1}:=\max\{L\in\mathbb{N}_{+}:\Phi(L)\leq 1\}=1$ (in Phase 0 where $\Phi(L)=L$ for $L\leq m\text{;}$ well-definedness follows from &lt;a href="#Thmtheorem42" title="Lemma 42 (Generic Φ-Wrapper Regret). ‣ Setup. ‣ F.3.2 Generic Φ-Wrapper Framework ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;42&lt;/span&gt;&lt;/a&gt;, Step 1). The wrapper selects $A_{1}$ to be &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; with $K^{*}=K^{*}_{\mathrm{col}}(L_{1})$ if $\Psi_{\mathrm{col}}(L_{1})\leq\Psi_{\mathrm{surr}}(L_{1})\text{,}$ and &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; with $K^{*}=K^{*}_{\mathrm{surr}}(L_{1})$ otherwise, freshly initialized. Before each round, the wrapper checks for an epoch transition: if $\tau=L_{k}\text{,}$ it sets $k\leftarrow k+1\text{,}$ $\tau\leftarrow 0\text{,}$ $L_{k}\leftarrow\max\{L\in\mathbb{N}_{+}:\Phi(L)\leq 2^{k-1}\}\text{,}$ re-selects $A_{k}$ according to the same rule, and freshly initializes it. Then $\tau\leftarrow\tau+1$ and $t\leftarrow t+1\text{;}$ $A_{k}$ outputs $\hat{y}_{t}$ on its $\tau$-th round upon receiving $x_{t}\text{,}$ then updates its internal state (via the rule (&lt;a href="#A6.E59" title="Equation 58 ‣ Algorithm 1 (formal restatement). ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;58&lt;/span&gt;&lt;/a&gt;) for &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; or the layer-wise EW update of &lt;a href="#S5.SS2" title="5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.2&lt;/span&gt;&lt;/a&gt; for &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;) upon receiving $y_{t}\in[0,1]\text{.}$ The wrapper does not access any external horizon information; its decision at each round depends only on $(k,\tau,L_{k})$ and the state of $A_{k}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="alg3" class="ltx_float ltx_float_algorithm ltx_framed ltx_framed_top"&gt;
&lt;figcaption class="ltx_caption"&gt;&lt;span class="ltx_tag ltx_tag_float"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Algorithm 3&lt;/span&gt; &lt;/span&gt; Horizon-Free Rate-Doubling Wrapper&lt;/figcaption&gt;
&lt;div class="ltx_listing ltx_listing"&gt;
&lt;div id="alg3.l1" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot;&amp;gt;Input:&amp;lt;/span&amp;gt; edge length $m\text{.}$
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id="alg3.l2" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot;&amp;gt;Initialize:&amp;lt;/span&amp;gt; global round counter $t\leftarrow 0\text{.}$
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id="alg3.l3" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot;&amp;gt;for&amp;lt;/span&amp;gt; $k=1,2,\ldots$ &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot;&amp;gt;do&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id="alg3.l4" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;2:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt;      $L_{k}\leftarrow\max\{L\in\mathbb{N}_{+}:\Phi(L)\leq 2^{k-1}\}\text{.}$
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span class="ltx_text" style="float:right;"&gt;$\triangleright$ epoch $k$ length, adaptive
&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="alg3.l5" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;3:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt;      &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot;&amp;gt;if&amp;lt;/span&amp;gt; $\Psi_{\mathrm{col}}(L_{k})\leq\Psi_{\mathrm{surr}}(L_{k})$ &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot;&amp;gt;then&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id="alg3.l6" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;4:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt;          $A_{k}\leftarrow$ &amp;lt;a href=&amp;quot;#alg1&amp;quot; title=&amp;quot;In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders&amp;quot; class=&amp;quot;ltx_ref&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;ltx_text ltx_ref_tag&amp;quot;&amp;gt;Algorithm&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;ltx_text ltx_ref_tag&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt; with
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;$K^{*}=K^{*}_{\mathrm{col}}(L_{k})$ and horizon $L_{k}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="alg3.l7" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;5:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt;      &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot;&amp;gt;else&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id="alg3.l8" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;6:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt;          $A_{k}\leftarrow$ &amp;lt;a href=&amp;quot;#alg2&amp;quot; title=&amp;quot;In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders&amp;quot; class=&amp;quot;ltx_ref&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;ltx_text ltx_ref_tag&amp;quot;&amp;gt;Algorithm&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;ltx_text ltx_ref_tag&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt; with
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;$K^{*}=K^{*}_{\mathrm{surr}}(L_{k})$ and horizon $L_{k}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="alg3.l9" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;7:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt;      &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot;&amp;gt;end&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot;&amp;gt;if&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id="alg3.l10" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;8:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt;      &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot;&amp;gt;for&amp;lt;/span&amp;gt; $\tau=1,\ldots,L_{k}$ &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot;&amp;gt;do&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id="alg3.l11" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;9:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt;          $t\leftarrow t+1\text{.}$
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id="alg3.l12" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;10:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt;          Observe $x_{t}\text{;}$ predict $\hat{y}_{t}$ via $A_{k}\text{;}$
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;observe $y_{t}\text{;}$ update $A_{k}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="alg3.l13" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;11:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt;      &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot;&amp;gt;end&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot;&amp;gt;for&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id="alg3.l14" class="ltx_listingline"&gt;
&lt;span class="ltx_tag ltx_tag_listingline"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;12:&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot;&amp;gt;end&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;ltx_text ltx_font_bold&amp;quot;&amp;gt;for&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/figure&gt;
&lt;div id="A6.SS3.SSS3.Px1.p2" class="ltx_para"&gt;
&lt;div id="restatement-Thmtheorem6-Thmtheorem6" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 6&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Horizon-Free Polynomial-Time Rate-Optimal Algorithm).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="restatement-Thmtheorem6-Thmtheorem6.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;a href="#alg3" title="In Algorithm 3 (formal restatement). ‣ F.3.3 Proof of Theorem 6 ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref ltx_font_italic"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;&lt;span class="ltx_text ltx_font_italic"&gt; runs in $\mathrm{poly}(m,t)$ per-round time at every round $t\geq 1$ and, for any $T\geq 1$ and any sequence $(x_{t},y_{t})_{t=1}^{T}\in[m]^{2}\times[0,1]\text{,}$ satisfies $R_{T}\leq 4\,\Phi(T)+2\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A6.SS3.SSS3.Px1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We prove the per-round time and regret bounds separately.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS3.SSS3.Px1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Per-round time.&lt;/span&gt; Within epoch $k\text{,}$ the wrapper runs the base algorithm $A_{k}$ (&lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; or &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;) with horizon $L_{k}\text{,}$ at per-round time polynomial in $(m,L_{k})$ (&lt;a href="#Thmtheorem40" title="Theorem 40 (Combined Upper Bound). ‣ F.3.1 Combined Upper Bound ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;40&lt;/span&gt;&lt;/a&gt;). We show $L_{k}$ is polynomially bounded in $(m,t)\text{,}$ so the per-round time is polynomial in $(m,t)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS3.SSS3.Px1.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $k=1\text{,}$ $L_{1}=1$ (as in the formal restatement), so the per-round time is $\mathrm{poly}(m,1)=\mathrm{poly}(m)\text{,}$ which is therefore polynomial in $(m,t)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS3.SSS3.Px1.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $k\geq 2\text{,}$ in epoch $k$ we have $t\geq T_{k-1}+1\geq L_{k-1}+1\text{.}$ By the maximality of $L_{k-1}\text{,}$ $\Phi(L_{k-1}+1)&amp;gt;2^{k-2}\text{;}$ combined with (P2) $\Phi$ non-decreasing and $t\geq L_{k-1}+1\text{,}$ we obtain $\Phi(t)&amp;gt;2^{k-2}\text{.}$ Together with $L_{k}\in S_{k}\text{,}$ i.e., $\Phi(L_{k})\leq 2^{k-1}\text{,}$&lt;/p&gt;
&lt;table id="A6.E102" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Phi(L_{k})\;\leq\;2\Phi(t).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(101)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Substituting the explicit phase-wise form of $\Phi$ from &lt;a href="#S5.SS3" title="5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.3&lt;/span&gt;&lt;/a&gt; (Phase 0/1/2 give $\Phi(T)=\Theta(T)$ for $T\leq m\text{,}$ $\Theta(m^{2/3}T^{1/3})$ for $m&amp;lt;T&amp;lt;m^{4}\text{,}$ and $\Theta(m^{2}\log(T/m^{4}))$ for $T\geq m^{4}$), we analyze two cases.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS3.SSS3.Px1.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $t\leq m^{4}\text{,}$ by (P2) and $\Phi(m^{4})\asymp m^{2/3}(m^{4})^{1/3}=m^{2}$ (the Phase 1 boundary phase-wise rate), $\Phi(t)\leq O(m^{2})\text{;}$ substituting into (&lt;a href="#A6.E102" title="Equation 101 ‣ Algorithm 3 (formal restatement). ‣ F.3.3 Proof of Theorem 6 ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;101&lt;/span&gt;&lt;/a&gt;) gives $\Phi(L_{k})\leq O(m^{2})\text{.}$ Inverting $\Phi$ on $L\in(m,m^{4})$ ($\asymp m^{2/3}L^{1/3}\text{,}$ Phase 1) gives $L_{k}\leq O(m^{4})\text{,}$ and on $L\geq m^{4}$ ($\asymp m^{2}\log(L/m^{4})\text{,}$ Phase 2) gives $L_{k}\leq m^{4}e^{O(1)}=O(m^{4})\text{.}$ Both inversions yield $L_{k}\leq O(m^{4})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS3.SSS3.Px1.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $t&amp;gt;m^{4}\text{,}$ $\Phi(t)\asymp m^{2}\bigl[1+\log(t/m^{4})\bigr]\text{,}$ the Phase 2 form of &lt;a href="#Thmtheorem63" title="Lemma 63 (Envelope Evaluation). ‣ K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;63&lt;/span&gt;&lt;/a&gt; at $d=2\text{,}$ which holds uniformly for $L\geq m^{4}\text{;}$ by (&lt;a href="#A6.E102" title="Equation 101 ‣ Algorithm 3 (formal restatement). ‣ F.3.3 Proof of Theorem 6 ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;101&lt;/span&gt;&lt;/a&gt;) and its two implied constants there is a $C$ (absorbing their ratio and the factor $2$) with $1+\log(L_{k}/m^{4})\leq C\bigl[1+\log(t/m^{4})\bigr]\text{,}$ hence $L_{k}\leq e^{C}m^{4}(t/m^{4})^{C}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS3.SSS3.Px1.p9" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Combining the two cases, $L_{k}\leq O\bigl(m^{4}+m^{4}(t/m^{4})^{C}\bigr)\text{,}$ which is polynomial in $(m,t)\text{.}$ Hence the base per-round time $\mathrm{poly}(m,L_{k})=\mathrm{poly}(m,t)\text{.}$ Each epoch transition computes $L_{k}$ and selects the engine; the bounds above delimit both searches: $\Phi$ is non-decreasing, so $L_{k}$ is found by binary search below the polynomial bound just established, and each of $\Psi_{\mathrm{col}},\Psi_{\mathrm{surr}}$ attains its infimum at some $K\leq\lceil\sqrt{L_{k}}\rceil+1\text{:}$ once $K^{2}\geq L_{k}\text{,}$ a unit step in $K$ lowers the rounding term by less than $1/(2K)$ and raises the aggregation term by more—by at least $2m^{2}/(K{+}m{+}1)$ for $\Psi_{\mathrm{col}}$ and by $2\log\binom{2m}{m}$ for $\Psi_{\mathrm{surr}}$—so both objectives increase from there on. Every evaluation is a sum of logarithms of binomial coefficients, so the transition also costs $\mathrm{poly}(m,t)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS3.SSS3.Px1.p10" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Regret bound.&lt;/span&gt; Apply &lt;a href="#Thmtheorem42" title="Lemma 42 (Generic Φ-Wrapper Regret). ‣ Setup. ‣ F.3.2 Generic Φ-Wrapper Framework ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;42&lt;/span&gt;&lt;/a&gt; with $\Phi(T)=\min\{T,\Psi_{\mathrm{col}}(T),\Psi_{\mathrm{surr}}(T)\}$ (which satisfies (P1)–(P5) by &lt;a href="#Thmtheorem41" title="Lemma 41 (Properties of Φ). ‣ F.3.1 Combined Upper Bound ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;41&lt;/span&gt;&lt;/a&gt;) and base algorithm class $\{A^{L}\}_{L\in\mathbb{N}_{+}}\text{,}$ where $A^{L}$ is the combined strategy of &lt;a href="#S5.SS3" title="5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.3&lt;/span&gt;&lt;/a&gt; specialized to horizon $L$ (i.e., &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; with $K^{*}=K^{*}_{\mathrm{col}}(L)$ if $\Psi_{\mathrm{col}}(L)\leq\Psi_{\mathrm{surr}}(L)\text{,}$ and &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; with $K^{*}=K^{*}_{\mathrm{surr}}(L)$ otherwise). We show that $\{A^{L}\}$ satisfies the base regret hypothesis (&lt;a href="#A6.E99" title="Equation 98 ‣ Setup. ‣ F.3.2 Generic Φ-Wrapper Framework ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;98&lt;/span&gt;&lt;/a&gt;). By &lt;a href="#Thmtheorem35" title="Theorem 35 (Column-Independent Upper Bound). ‣ F.1.4 Proof of Theorem 35 ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorems&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;35&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmtheorem5" title="Theorem 5 (Surrogate Upper Bound). ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;, $A^{L}$ satisfies, for any $\tau\in[1,L]\text{,}$ the affine bound&lt;/p&gt;
&lt;table id="A6.Ex177" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{\tau}(A^{L})\;\leq\;2m\log\!\binom{m+K^{*}}{K^{*}}+\frac{\tau}{4(K^{*})^{2}}\quad\text{or}\quad 2K^{*}\log\!\binom{2m}{m}+\frac{\tau}{4(K^{*})^{2}}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;(corresponding to &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; and &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;, respectively; see &lt;a href="#S5.SS1" title="5.1 Column-Independent Chain Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Sections&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.1&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S5.SS2" title="5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.2&lt;/span&gt;&lt;/a&gt; and &lt;a href="#A6.SS1" title="F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Sections&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;F.1&lt;/span&gt;&lt;/a&gt; and &lt;a href="#A6.SS2" title="F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;F.2&lt;/span&gt;&lt;/a&gt;). The affine bound has slope $1/(4(K^{*})^{2})&amp;gt;0$ in $\tau\text{,}$ so it is non-decreasing, and combined with $\tau\leq L$ gives $R_{\tau}(A^{L})\leq$ the bound evaluated at $\tau=L\text{.}$ At the inf-optimal $K^{*}=K^{*}_{\mathrm{col}}(L)$ or $K^{*}_{\mathrm{surr}}(L)\text{,}$ this evaluation equals $\Psi_{\mathrm{col}}(L)$ or $\Psi_{\mathrm{surr}}(L)$ (the value attained by the inf-of-affine $\Psi$-definition at $K^{*}$). The combined strategy takes the smaller of the two, so $R_{\tau}(A^{L})\leq\min\{\Psi_{\mathrm{col}}(L),\Psi_{\mathrm{surr}}(L)\}\text{;}$ combined with the trivial $R_{\tau}(A^{L})\leq\tau\leq L\text{,}$ we obtain $R_{\tau}(A^{L})\leq\min\{L,\Psi_{\mathrm{col}}(L),\Psi_{\mathrm{surr}}(L)\}=\Phi(L)\text{,}$ i.e., (&lt;a href="#A6.E99" title="Equation 98 ‣ Setup. ‣ F.3.2 Generic Φ-Wrapper Framework ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;98&lt;/span&gt;&lt;/a&gt;) holds. &lt;a href="#Thmtheorem42" title="Lemma 42 (Generic Φ-Wrapper Regret). ‣ Setup. ‣ F.3.2 Generic Φ-Wrapper Framework ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;42&lt;/span&gt;&lt;/a&gt; then gives $R_{T}(W^{\Phi})\leq 4\Phi(T)+2\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A6.SS3.SSS3.Px2" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Why the regret budget, and not the horizon, is doubled.&lt;/h5&gt;
&lt;div id="A6.SS3.SSS3.Px2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Doubling time instead of regret would forfeit Phase 2: geometric time epochs have slowly growing regrets $\Theta(m^{2}j)\text{,}$ summing to $\Theta(m^{2}r^{2})$ against the target $\Theta(m^{2}r)\text{,}$ while doubling the regret budget makes the per-epoch regrets themselves geometric, the sum dominated by its last term, at the price of doubly exponential epoch lengths.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A6.SS3.SSS3.Px3" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Phase-wise rate.&lt;/h5&gt;
&lt;div id="A6.SS3.SSS3.Px3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Substituting the phase-wise form of $\Phi$ from &lt;a href="#S5.SS3" title="5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.3&lt;/span&gt;&lt;/a&gt; gives the concrete regret rate of &lt;a href="#alg3" title="In Algorithm 3 (formal restatement). ‣ F.3.3 Proof of Theorem 6 ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; in each regime. In Phase 0 ($T\lesssim m$), $4\Phi(T)+2=\Theta(T)\text{,}$ matching the lower bound $\Omega(T)$ from &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;. In Phase 1 ($m\lesssim T\lesssim m^{4}$), $4\Phi(T)+2=\Theta(m^{2/3}T^{1/3})$ (with $\Psi_{\mathrm{surr}}$ attaining the minimum), matching $\Omega(m^{2/3}T^{1/3})\text{.}$ In Phase 2 ($T\gg m^{4}$), $4\Phi(T)+2=\Theta\bigl(m^{2}\log(T/m^{4})\bigr)$ (with $\Psi_{\mathrm{col}}$ attaining the minimum), matching $\Omega\bigl(m^{2}\log(T/m^{4})\bigr)\text{.}$ &lt;a href="#alg3" title="In Algorithm 3 (formal restatement). ‣ F.3.3 Proof of Theorem 6 ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; therefore matches the minimax rate $R_{T}^{*}([m]^{2})$ of &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; at the $\Theta$-level in all three regimes, without requiring advance knowledge of the horizon $T\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A7" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="strip-independent-transfer-matrix-lower-bound"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix G &lt;/span&gt;Strip-Independent Transfer-Matrix Lower Bound&lt;/h2&gt;
&lt;div id="A7.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This appendix proves &lt;a href="#Thmtheorem44" title="Theorem 44 (Strip-Independent Transfer-Matrix Lower Bound). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;44&lt;/span&gt;&lt;/a&gt;: under the standard exp-concave EW upper bound analysis, every polynomial-time strip-EW algorithm has a regret upper bound formula of at least $\Psi_{\mathrm{col}}(T)-O(m\log(mT))$ in Phase 1, so the $(\log m)^{2/3}$ factor of &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; cannot be eliminated by widening the strip $w$ under polynomial-time constraints. The appendix proceeds in three sections: &lt;a href="#A7.SS1" title="G.1 Strip-EW Algorithm Class ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;G.1&lt;/span&gt;&lt;/a&gt; formalizes the strip-EW class and its two key parameters; &lt;a href="#A7.SS2" title="G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;G.2&lt;/span&gt;&lt;/a&gt; uses the MacMahon box formula to give an exact characterization of the expert class size and thereby derive the main theorem; &lt;a href="#A7.SS3" title="G.3 Discussion ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;G.3&lt;/span&gt;&lt;/a&gt; discusses the result structurally, placing the lower bound within the broader expressivity-tractability landscape of the strip-EW class.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A7.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="strip-ew-algorithm-class"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;G.1 &lt;/span&gt;Strip-EW Algorithm Class&lt;/h3&gt;
&lt;section id="A7.SS1.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Vertical strip slicing and interface state.&lt;/h5&gt;
&lt;div id="A7.SS1.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Given $w\in[1,m]$ and $K\in\mathbb{N}_{+}\text{,}$ a strip-EW algorithm partitions $[m]^{2}$ along the column direction into $\lceil m/w\rceil$ vertical strips $S_{1},\ldots,S_{\lceil m/w\rceil}$ of width at most $w$ (each strip has the form $\{(i,j):j\in[m],\,i\in I_{b}\}$ with $I_{b}$ a contiguous column-index segment of length at most $w$). On each strip $S_{b}\text{,}$ an &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;-style exp-concave Exponential Weights algorithm is run independently with expert class&lt;/p&gt;
&lt;table id="A7.E103" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{F}_{w,m,K}\;:=\;\bigl\{h:[w]\times[m]\to\{0,1/K,\ldots,K/K\}\;\bigm|\;h\text{ is non-decreasing in the product order}\bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(102)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;To efficiently compute the EW partition function and marginal predictor inside a strip, the algorithm performs a transfer-matrix DP along the column direction: each column’s non-decreasing value profile inside the strip serves as an interface state, and adjacent columns are propagated via the action of a zeta matrix. An interface state is a non-decreasing sequence on $[w]$ taking values in $\{0,\ldots,K\}\text{,}$ so the per-column interface dimension is $\binom{w+K}{K}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A7.SS1.SSS0.Px2" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Two key combinatorial parameters.&lt;/h5&gt;
&lt;div id="A7.SS1.SSS0.Px2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Two superficially similar combinatorial quantities play distinct roles:&lt;/p&gt;
&lt;ul id="A7.I1" class="ltx_itemize"&gt;
&lt;li id="A7.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A7.I1.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Interface state count&lt;/em&gt; $\binom{w+K}{K}\text{:}$ the
dimension of the transfer-matrix state space inside a strip;
&lt;em class="ltx_emph ltx_font_italic"&gt;this controls runtime&lt;/em&gt;. The DP carries one weight per
interface state and sweeps the strip’s $m$ interfaces, so a
round that updates the strip holding $x_{t}$ reads and writes
between $m\binom{w+K}{K}$ and $O\bigl(m\binom{w+K}{K}^{2}\bigr)$
numbers, the upper end being dense propagation. At $w=1$ the
count is $K+1$ and the lower end is attained:
&lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; runs in $O(mK)$ per round
(&lt;a href="#Thmtheorem32" title="Lemma 32 (Forward-Backward DP Correctness and Complexity). ‣ Forward-backward DP. ‣ F.1.1 Forward-Backward DP and Per-Round Time ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;32&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A7.I1.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A7.I1.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Expert class size&lt;/em&gt;
$|\mathcal{F}_{w,m,K}|=\Omega([w]\times[m],K{+}1)\text{:}$ the
number of experts in the strip’s EW algorithm; &lt;em class="ltx_emph ltx_font_italic"&gt;this
controls the regret bound&lt;/em&gt;. Here $\Omega(\mathcal{P},n)$ denotes the
number of non-decreasing maps from the poset $\mathcal{P}$ to
$\{0,1,\ldots,n-1\}\text{,}$ i.e., the order polynomial of $\mathcal{P}$
evaluated at $n\text{.}$ For $\mathcal{P}=[w]\times[m]$ with values in
$\{0,\ldots,K\}$ ($n=K+1$), the MacMahon box formula gives&lt;/p&gt;
&lt;table id="A7.E104" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Omega([w]\times[m],K{+}1)\;=\;\prod_{i=1}^{w}\frac{\binom{m+K+i-1}{K}}{\binom{K+i-1}{K}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(103)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="ltx_p"&gt;The ratio $\binom{w+K}{K}^{-1}\cdot\Omega([w]\times[m],K{+}1)$ captures the strip’s “combinatorial amplification” along its long side ($m$-axis) and is the algebraic core of Step 1 below.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A7.SS1.SSS0.Px3" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Formalization of the Strip-EW class.&lt;/h5&gt;
&lt;div id="Thmtheorem43" class="ltx_theorem ltx_theorem_definition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Definition 43&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Strip-EW class).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem43.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For a constant $d\geq 1\text{,}$ the Strip-EW class $\mathcal{C}_{d}^{\mathrm{SEW}}$ consists of all algorithms $A_{w,K}$ satisfying:&lt;/p&gt;
&lt;ol id="A7.I2" class="ltx_enumerate"&gt;
&lt;li id="A7.I2.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(i)&lt;/span&gt;
&lt;div id="A7.I2.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;a strip width $w\in[1,m]$ and a discretization level
$K\in\mathbb{N}_{+}$ are fixed;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A7.I2.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(ii)&lt;/span&gt;
&lt;div id="A7.I2.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;on each of the $\lceil m/w\rceil$ vertical strips described
above, an exp-concave EW algorithm with expert class
$\mathcal{F}_{w,m,K}$ is run independently (with learning rate
$\eta=1/2\text{,}$ matching &lt;a href="#Thmtheorem35" title="Theorem 35 (Column-Independent Upper Bound). ‣ F.1.4 Proof of Theorem 35 ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;35&lt;/span&gt;&lt;/a&gt;);&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A7.I2.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(iii)&lt;/span&gt;
&lt;div id="A7.I2.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;the total per-round running time is at most $(mT)^{d}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p class="ltx_p"&gt;&lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; corresponds to the case $w=1\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A7.SS1.SSS0.Px3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The per-round cost recorded above turns condition (iii) into $m\binom{w+K}{K}\leq(mT)^{d}\text{,}$ or in the looser logarithmic form&lt;/p&gt;
&lt;table id="A7.E105" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log\binom{w+K}{K}\;\leq\;d\log(mT)\,-\,\log m\;\leq\;d\log(mT),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(104)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;of which the proof uses only the weaker right-hand bound.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A7.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="main-theorem-and-proof"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;G.2 &lt;/span&gt;Main Theorem and Proof&lt;/h3&gt;
&lt;div id="Thmtheorem44" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 44&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Strip-Independent Transfer-Matrix Lower Bound).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem44.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Fix constants $d\geq 1$ and $\varepsilon\in(0,1)\text{,}$ and suppose $T$ satisfies $m\log m\ll T\leq m^{4-\varepsilon}\text{.}$ Then for any $A_{w,K}\in\mathcal{C}_{d}^{\mathrm{SEW}}\text{,}$ the regret upper bound formula given by the standard exp-concave EW analysis on $A_{w,K}\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A7.E106" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$B(w,K;T)\;:=\;2\lceil m/w\rceil\,H_{[w]\times[m]}(K)\,+\,\frac{T}{4K^{2}},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(105)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;satisfies&lt;/span&gt;&lt;/p&gt;
&lt;table id="A7.E107" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\inf_{A_{w,K}\in\mathcal{C}_{d}^{\mathrm{SEW}}}B(w,K;T)\;\geq\;\Psi_{\mathrm{col}}(T)\,-\,2d\,m\log(mT),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(106)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;where $\Psi_{\mathrm{col}}$ is defined in &lt;a href="#S5.SS1" title="5.1 Column-Independent Chain Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.1&lt;/span&gt;&lt;/a&gt;. Combined with the trivial upper bound $\inf B\leq\Psi_{\mathrm{col}}(T)$ (taking &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;, i.e., $w=1\text{,}$ with $K$ inf-optimal in the definition of $\Psi_{\mathrm{col}}$), $\inf B$ differs from $\Psi_{\mathrm{col}}$ by at most $2d\,m\log(mT)\text{.}$ Within the regime $m\log m\ll T\leq m^{4-\varepsilon}\text{,}$ this error is asymptotically subordinate to $\Psi_{\mathrm{col}}(T)=\Theta\bigl(m^{2/3}T^{1/3}(\log m)^{2/3}\bigr)$ (established at the end of &lt;a href="#A7.SS3" title="G.3 Discussion ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;G.3&lt;/span&gt;&lt;/a&gt;), so $\inf B(w,K;T)=\Theta_{d,\varepsilon}\bigl(m^{2/3}T^{1/3}(\log m)^{2/3}\bigr)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A7.SS2.p1" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Remark.&lt;/span&gt;
(&lt;a href="#A7.E107" title="Equation 106 ‣ Theorem 44 (Strip-Independent Transfer-Matrix Lower Bound). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;106&lt;/span&gt;&lt;/a&gt;) bounds the &lt;em class="ltx_emph ltx_font_italic"&gt;certificate&lt;/em&gt;: $B(w,K;T)$ is the regret bound the standard analysis produces for $A_{w,K}\text{,}$ and no choice of $(w,K)$ within the class brings it below $\Psi_{\mathrm{col}}(T)-O(m\log(mT))\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A7.SS2.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Origin of $B(w,K;T)\text{.}$&lt;/h5&gt;
&lt;div id="A7.SS2.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Each strip $S_{b}$ runs its EW on the $T_{b}:=|\{t:x_{t}\in S_{b}\}|$ rounds that land in it. The standard exp-concave analysis at $\eta=1/2$ prices aggregation at $2\log|\mathcal{F}_{w,m,K}|=2H_{[w]\times[m]}(K)$ (&lt;a href="#Thmtheorem34" title="Lemma 34 (Chain EW Regret). ‣ F.1.3 Per-Column EW Analysis ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;34&lt;/span&gt;&lt;/a&gt;, Step 2) and rounding at $T_{b}/(4K^{2})$ (&lt;a href="#Thmtheorem8" title="Lemma 8 (Block Residual). ‣ Recall. ‣ Appendix B Block Residual Property ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt;), so the within-strip regret is at most $2H_{[w]\times[m]}(K)+T_{b}/(4K^{2})\text{.}$ Every isotonic $f$ on $[m]^{2}$ restricts to an isotonic function on each strip, so enlarging the comparator to $\prod_{b}\mathcal{F}_{S_{b}}^{\uparrow}$ splits the global regret into the sum of the strip regrets (&lt;a href="#Thmtheorem33" title="Lemma 33 (Column-wise Decomposition of Regret). ‣ F.1.2 Comparator Class Enlargement ‣ F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;33&lt;/span&gt;&lt;/a&gt;); substituting $\sum_{b}T_{b}=T$ and the strip count $\lceil m/w\rceil$ gives (&lt;a href="#A7.E106" title="Equation 105 ‣ Theorem 44 (Strip-Independent Transfer-Matrix Lower Bound). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;105&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A7.SS2.SSS0.Px1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The proof has two steps: Step 1 derives a precise lower bound on the logarithmic expert class size from the MacMahon formula (&lt;a href="#A7.E104" title="Equation 103 ‣ 2nd item ‣ Two key combinatorial parameters. ‣ G.1 Strip-EW Algorithm Class ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;103&lt;/span&gt;&lt;/a&gt;), and Step 2 completes the algebra under the polynomial-time constraint (&lt;a href="#A7.E105" title="Equation 104 ‣ Formalization of the Strip-EW class. ‣ G.1 Strip-EW Algorithm Class ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;104&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A7.SS2.SSS0.Px1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 1 (Expert class lower bound).&lt;/span&gt; By (&lt;a href="#A7.E104" title="Equation 103 ‣ 2nd item ‣ Two key combinatorial parameters. ‣ G.1 Strip-EW Algorithm Class ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;103&lt;/span&gt;&lt;/a&gt;) and a factor rearrangement,&lt;/p&gt;
&lt;table id="A7.Ex178" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H_{[w]\times[m]}(K)\;=\;\sum_{i=1}^{w}\!\Biggl[\log\binom{m+K+i-1}{K}-\log\binom{K+i-1}{K}\Biggr].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;For each $i\in[1,w]\text{,}$ by the monotonicity of the binomial coefficient in its upper index, $\binom{m+K+i-1}{K}\geq\binom{m+K}{K}$ (for $i\geq 1\text{,}$ $m+K+i-1\geq m+K$) and $\binom{K+i-1}{K}\leq\binom{K+w-1}{K}\leq\binom{w+K}{K}$ (for $i\leq w\text{,}$ by monotonicity); hence, term by term,&lt;/p&gt;
&lt;table id="A7.Ex179" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log\binom{m+K+i-1}{K}-\log\binom{K+i-1}{K}\;\geq\;\log\binom{m+K}{K}-\log\binom{w+K}{K}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Summing over $i=1,\ldots,w\text{,}$&lt;/p&gt;
&lt;table id="A7.E108" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H_{[w]\times[m]}(K)\;\geq\;w\,\!\Biggl[\log\binom{m+K}{K}-\log\binom{w+K}{K}\Biggr].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(107)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A7.SS2.SSS0.Px1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 2 (Polynomial-time constraint and $\Psi_{\mathrm{col}}$ infimum).&lt;/span&gt; Substituting (&lt;a href="#A7.E108" title="Equation 107 ‣ Origin of 𝐵⁢(𝑤,𝐾;𝑇). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;107&lt;/span&gt;&lt;/a&gt;) into (&lt;a href="#A7.E106" title="Equation 105 ‣ Theorem 44 (Strip-Independent Transfer-Matrix Lower Bound). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;105&lt;/span&gt;&lt;/a&gt;),&lt;/p&gt;
&lt;table id="A7.Ex180" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$B(w,K;T)\;\geq\;2\lceil m/w\rceil\cdot w\,\!\Biggl[\log\binom{m+K}{K}-\log\binom{w+K}{K}\Biggr]\,+\,\frac{T}{4K^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Since $\lceil m/w\rceil\geq m/w\text{,}$ i.e., $\lceil m/w\rceil\cdot w\geq m\text{,}$&lt;/p&gt;
&lt;table id="A7.E109" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\begin{split}B(w,K;T)&amp;amp;\;\geq\;2m\,\!\Biggl[\log\binom{m+K}{K}-\log\binom{w+K}{K}\Biggr]\,+\,\frac{T}{4K^{2}}\\ &amp;amp;\;=\;\!\Biggl[2m\log\binom{m+K}{K}+\frac{T}{4K^{2}}\Biggr]\,-\,2m\log\binom{w+K}{K}.\end{split}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(108)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The bracket in (&lt;a href="#A7.E109" title="Equation 108 ‣ Origin of 𝐵⁢(𝑤,𝐾;𝑇). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;108&lt;/span&gt;&lt;/a&gt;) is the quantity over which $\Psi_{\mathrm{col}}$ takes its infimum, evaluated at the algorithm’s specific $K\text{;}$ hence by the definition $\Psi_{\mathrm{col}}(T):=\inf_{K\in\mathbb{N}_{+}}\bigl[2m\log\binom{m+K}{K}+T/(4K^{2})\bigr]$ (&lt;a href="#S5.SS1" title="5.1 Column-Independent Chain Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.1&lt;/span&gt;&lt;/a&gt;),&lt;/p&gt;
&lt;table id="A7.Ex181" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$2m\log\!\binom{m+K}{K}\,+\,\frac{T}{4K^{2}}\;\geq\;\Psi_{\mathrm{col}}(T).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The subtracted term in (&lt;a href="#A7.E109" title="Equation 108 ‣ Origin of 𝐵⁢(𝑤,𝐾;𝑇). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;108&lt;/span&gt;&lt;/a&gt;) is bounded above by the polynomial-time constraint (&lt;a href="#A7.E105" title="Equation 104 ‣ Formalization of the Strip-EW class. ‣ G.1 Strip-EW Algorithm Class ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;104&lt;/span&gt;&lt;/a&gt;), $\log\binom{w+K}{K}\leq d\log(mT)\text{:}$&lt;/p&gt;
&lt;table id="A7.Ex182" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$2m\log\!\binom{w+K}{K}\;\leq\;2d\,m\log(mT).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Combining and substituting back into (&lt;a href="#A7.E109" title="Equation 108 ‣ Origin of 𝐵⁢(𝑤,𝐾;𝑇). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;108&lt;/span&gt;&lt;/a&gt;),&lt;/p&gt;
&lt;table id="A7.Ex183" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$B(w,K;T)\;\geq\;\Psi_{\mathrm{col}}(T)\,-\,2d\,m\log(mT).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;This holds uniformly over all $(w,K)\text{,}$ i.e., over all $A_{w,K}\in\mathcal{C}_{d}^{\mathrm{SEW}}\text{;}$ taking the infimum yields (&lt;a href="#A7.E107" title="Equation 106 ‣ Theorem 44 (Strip-Independent Transfer-Matrix Lower Bound). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;106&lt;/span&gt;&lt;/a&gt;).
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A7.SS2.SSS0.Px2" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Phase 2 (brief).&lt;/h5&gt;
&lt;div id="A7.SS2.SSS0.Px2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;In Phase 2 ($T\gg m^{4}$), $\Psi_{\mathrm{col}}(T)=\Theta\bigl(m^{2}\log(T/m^{4})\bigr)$ already matches the minimax rate (&lt;a href="#Thmtheorem3" title="Corollary 3 (Three-Phase Scaling Law). ‣ 3.3 The Three Phases and the Phase Criterion ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;, Phase 2) at the $\Theta$-level, with the chain EW ($w=1$) attaining $\Psi_{\mathrm{col}}\text{.}$ The algebraic argument of Step 1 and Step 2 (formulas (&lt;a href="#A7.E108" title="Equation 107 ‣ Origin of 𝐵⁢(𝑤,𝐾;𝑇). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;107&lt;/span&gt;&lt;/a&gt;) and (&lt;a href="#A7.E109" title="Equation 108 ‣ Origin of 𝐵⁢(𝑤,𝐾;𝑇). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;108&lt;/span&gt;&lt;/a&gt;)) does not rely on the Phase 1 hypothesis on $T$ and yields, in Phase 2 as well, $\inf B(w,K;T)\geq\Psi_{\mathrm{col}}(T)-2d\,m\log(mT)\text{.}$ Combined with the trivial upper bound $\inf B\leq\Psi_{\mathrm{col}}(T)$ from &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; ($w=1$), this gives $\inf B=\Theta\bigl(m^{2}\log(T/m^{4})\bigr)$ for $m&amp;gt;4d\text{,}$ of the same order as chain EW, and widening the strip does not improve the rate. Phase 2 exhibits no new structural phenomena (chain EW is already minimax).&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A7.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="discussion-1"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;G.3 &lt;/span&gt;Discussion&lt;/h3&gt;
&lt;section id="A7.SS3.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Entropy view of strip widening.&lt;/h5&gt;
&lt;div id="A7.SS3.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The core mechanism of &lt;a href="#Thmtheorem44" title="Theorem 44 (Strip-Independent Transfer-Matrix Lower Bound). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;44&lt;/span&gt;&lt;/a&gt; can be understood from the perspective of expert class entropy. Taking the strip width to $w=m$ does reduce the total entropy of the expert class: the first term of (&lt;a href="#A7.E106" title="Equation 105 ‣ Theorem 44 (Strip-Independent Transfer-Matrix Lower Bound). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;105&lt;/span&gt;&lt;/a&gt;), $2\lceil m/w\rceil\,H_{[w]\times[m]}(K)\text{,}$ degenerates to $2H_{[m]^{2}}(K)$ (a single strip equal to all of $[m]^{2}$), and combined with the second term $T/(4K^{2})$ this gives $2H_{[m]^{2}}(K)+T/(4K^{2})=\Theta(mK+T/K^{2})$ for $K\ll m$ (&lt;a href="#Thmtheorem62" title="Lemma 62 (Grid Entropy). ‣ K.2 Grid Entropy ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;62&lt;/span&gt;&lt;/a&gt;); optimizing over $K$ attains the information-theoretically optimal rate $\Theta(m^{2/3}T^{1/3})$ (matching the Phase 1 minimax rate of &lt;a href="#Thmtheorem3" title="Corollary 3 (Three-Phase Scaling Law). ‣ 3.3 The Three Phases and the Phase Criterion ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;). The polynomial-time constraint (&lt;a href="#A7.E105" title="Equation 104 ‣ Formalization of the Strip-EW class. ‣ G.1 Strip-EW Algorithm Class ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;104&lt;/span&gt;&lt;/a&gt;), however, restricts $\log\binom{w+K}{K}=O(\log(mT))$ and thereby rules out the “wide-strip” path with $w$ approaching $m\text{:}$ $w=m$ requires $\binom{m+K}{K}\leq(mT)^{O(1)}\text{,}$ i.e., $K=O(\log(mT)/\log m)\text{,}$ far smaller than the Phase 1 optimal $K^{*}=\Theta\bigl((T/(m\log m))^{1/3}\bigr)\text{.}$ Combinatorially: the long-side expert count $\Omega([w]\times[m],K{+}1)$ and the short-side interface count $\binom{w+K}{K}$ are coupled by the $w$-fold amplification in (&lt;a href="#A7.E108" title="Equation 107 ‣ Origin of 𝐵⁢(𝑤,𝐾;𝑇). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;107&lt;/span&gt;&lt;/a&gt;); the polynomial-time constraint acts on the latter and propagates to the former through this coupling, yielding the essential restriction (&lt;a href="#A7.E109" title="Equation 108 ‣ Origin of 𝐵⁢(𝑤,𝐾;𝑇). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;108&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A7.SS3.SSS0.Px2" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Fixed-$K$ versus growing-$K$ regimes.&lt;/h5&gt;
&lt;div id="A7.SS3.SSS0.Px2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The “intractability” in &lt;a href="#Thmtheorem44" title="Theorem 44 (Strip-Independent Transfer-Matrix Lower Bound). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;44&lt;/span&gt;&lt;/a&gt; is strictly confined to the asymptotic regime where $K$ grows with $T$ (in Phase 1, $K^{*}=\Theta\bigl((T/(m\log m))^{1/3}\bigr)\to\infty$). For each &lt;em class="ltx_emph ltx_font_italic"&gt;fixed&lt;/em&gt; $K$ (including a large constant $K$), the strip-EW algorithm with $w=m$ provides an $O(m^{2K+1})$-time exact isotonic regression algorithm (the strip degenerates to a transfer-matrix DP on all of $[m]^{2}\text{,}$ with interface state count $\binom{m+K}{K}=O(m^{K})$ controlling the runtime); its expert class is $\mathcal{F}_{m,m,K}\text{,}$ of logarithmic size $H_{[m]^{2}}(K)=\Theta(mK)$ (&lt;a href="#Thmtheorem62" title="Lemma 62 (Grid Entropy). ‣ K.2 Grid Entropy ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;62&lt;/span&gt;&lt;/a&gt;), and the EW upper bound formula is $2H_{[m]^{2}}(K)+T/(4K^{2})=\Theta_{K}(m+T/K^{2})\text{.}$ With $K$ fixed the formula grows linearly, at rate $\Theta(T/K^{2})\text{,}$ while the Phase 1 minimax rate grows as $T^{1/3}\text{:}$ the two curves part at $T\asymp K^{3}m\text{,}$ beyond which the fixed-$K$ algorithm falls behind and growing $K$ becomes inevitable. &lt;a href="#Thmtheorem44" title="Theorem 44 (Strip-Independent Transfer-Matrix Lower Bound). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;44&lt;/span&gt;&lt;/a&gt; reveals precisely the expressivity-tractability tension of the strip-EW class in the growing-$K$ regime: $K$ must grow with $T$ to match the Phase 1 minimax rate, while polynomial-time constraints simultaneously prevent $w$ from widening, ultimately forcing the $(\log m)^{2/3}$ factor.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A7.SS3.SSS0.Px3" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Connection to surrogate TI-EW.&lt;/h5&gt;
&lt;div id="A7.SS3.SSS0.Px3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;a href="#Thmtheorem44" title="Theorem 44 (Strip-Independent Transfer-Matrix Lower Bound). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;44&lt;/span&gt;&lt;/a&gt; locates the $(\log m)^{2/3}$ gap in the class: the standard certificate of every strip-EW algorithm sits at $\Psi_{\mathrm{col}}$ up to $O(m\log(mT))\text{,}$ so a better one has to be built &lt;em class="ltx_emph ltx_font_italic"&gt;outside the strip-EW class&lt;/em&gt;. The surrogate TI-EW algorithm of &lt;a href="#S5.SS2" title="5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.2&lt;/span&gt;&lt;/a&gt; does precisely this, via three departures: (i) decomposition along threshold layers rather than columns (bypassing the vertical-strip expert class), (ii) a surrogate loss in place of the squared loss (bypassing the multiplicative blow-up of total expert class entropy by the column count), and (iii) aggregation of an enlarged latent representation under a dominating surrogate, in place of direct EW on the discretized grid $\{0/K,\ldots,K/K\}\text{.}$ The aggregation term becomes $2K\log\binom{2m}{m}=\Theta(mK)$ (against $\Theta(mK\log(m/K))$ for &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; at $w=1\text{;}$ &lt;a href="#S5.SS1" title="5.1 Column-Independent Chain Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.1&lt;/span&gt;&lt;/a&gt;, end of section); optimizing $2K\log\binom{2m}{m}+T/(4K^{2})$ over $K$ then attains the Phase 1 rate $\Theta(m^{2/3}T^{1/3})\text{,}$ exactly closing the $(\log m)^{2/3}$ gap of (&lt;a href="#A7.E107" title="Equation 106 ‣ Theorem 44 (Strip-Independent Transfer-Matrix Lower Bound). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;106&lt;/span&gt;&lt;/a&gt;). &lt;a href="#Thmtheorem44" title="Theorem 44 (Strip-Independent Transfer-Matrix Lower Bound). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;44&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S5.SS2" title="5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.2&lt;/span&gt;&lt;/a&gt; are the two halves of the Phase 1 algorithmic story: the strip-EW class is where the standard analysis stalls at $\Psi_{\mathrm{col}}\text{,}$ and the threshold layers are the way past it.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A7.SS3.SSS0.Px4" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Asymptotic subordination of the error term.&lt;/h5&gt;
&lt;div id="A7.SS3.SSS0.Px4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Against the Phase 1 leading term $\Psi_{\mathrm{col}}(T)=\Theta\bigl(m^{2/3}T^{1/3}(\log m)^{2/3}\bigr)\text{,}$ the error term of (&lt;a href="#A7.E107" title="Equation 106 ‣ Theorem 44 (Strip-Independent Transfer-Matrix Lower Bound). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;106&lt;/span&gt;&lt;/a&gt;) stands in the ratio&lt;/p&gt;
&lt;table id="A7.Ex184" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{m\log(mT)}{m^{2/3}T^{1/3}(\log m)^{2/3}}\;=\;\frac{m^{1/3}\log(mT)}{T^{1/3}(\log m)^{2/3}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;From $T\leq m^{4-\varepsilon}\text{,}$ $\log(mT)\leq(5-\varepsilon)\log m\text{,}$ so the ratio is at most $(5-\varepsilon)\,(m/T)^{1/3}(\log m)^{1/3}\text{,}$ which is $o(1)$ exactly when $m\log m\ll T\text{:}$ there (&lt;a href="#A7.E107" title="Equation 106 ‣ Theorem 44 (Strip-Independent Transfer-Matrix Lower Bound). ‣ G.2 Main Theorem and Proof ‣ Appendix G Strip-Independent Transfer-Matrix Lower Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;106&lt;/span&gt;&lt;/a&gt;) is a true $\Theta_{d,\varepsilon}(\Psi_{\mathrm{col}}(T))$ lower bound with no rate loss, and at $T=\Theta(m\log m)$ the ratio is $\Theta(1)\text{,}$ making the hypothesis the weakest possible.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A8" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="follow-the-leader-on-general-posets"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix H &lt;/span&gt;Follow-The-Leader on General Posets&lt;/h2&gt;
&lt;div id="A8.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This appendix establishes the regret upper bound for Follow-The-Leader (FTL) on a general finite poset.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A8.SS0.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Setup.&lt;/h5&gt;
&lt;div id="A8.SS0.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Let $\mathcal{P}$ be a finite poset with $n:=|\mathcal{P}|\text{.}$ In the online isotonic regression protocol with squared loss, &lt;em class="ltx_emph ltx_font_italic"&gt;Follow-The-Leader&lt;/em&gt; (FTL) at each round $t$ selects&lt;/p&gt;
&lt;table id="A8.Ex185" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\hat{f}_{t}\;\in\;\operatorname*{arg\,min}_{f\in\mathcal{F}_{\mathcal{P}}^{\uparrow}}\sum_{s&amp;lt;t}(f(x_{s})-y_{s})^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and outputs $\hat{y}_{t}:=\hat{f}_{t}(x_{t})\text{.}$ By definition of $\mathcal{F}_{\mathcal{P}}^{\uparrow}\text{,}$ $\hat{f}_{t}$ is $[0,1]$-valued. When $N_{t-1}(x_{t})=0$ (i.e., $x_{t}$ has not been queried in prior rounds), $\hat{f}_{t}(x_{t})$ may take any value in some interval $[a_{t}^{-},a_{t}^{+}]\subseteq[0,1]\text{;}$ the proof below holds for any tie-breaking rule.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem45" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 45&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (FTL Upper Bound on General Posets).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem45.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For any finite poset $\mathcal{P}$ with $n=|\mathcal{P}|\text{,}$ any $T\geq 1\text{,}$ and any sequence $(x_{t},y_{t})_{t=1}^{T}\in\mathcal{P}\times[0,1]\text{,}$ FTL satisfies&lt;/span&gt;&lt;/p&gt;
&lt;table id="A8.Ex186" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{\mathrm{FTL}}\;\leq\;2\sum_{x\in\mathcal{P}}H(N_{T}(x))\;\leq\;6\,n^{2/3}T^{1/3},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;where $H(k):=\sum_{i=1}^{k}1/i$ is the $k$-th harmonic number (with $H(0):=0$).&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A8.SS0.SSS0.Px1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For $\mathcal{P}=[m]^{2}$ (so $n=m^{2}$), the theorem yields $R_{T}^{\mathrm{FTL}}=O(m^{4/3}T^{1/3})\text{,}$ weaker by a factor of $m^{2/3}$ than the rate-optimal $O(m^{2/3}T^{1/3})$ of Surrogate TI-EW (&lt;a href="#Thmtheorem5" title="Theorem 5 (Surrogate Upper Bound). ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;). FTL nonetheless runs in polynomial time, providing an efficient baseline for general finite posets.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A8.SS0.SSS0.Px1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The proof proceeds in four steps: an FTL–BTL decomposition (Step 1); a one-dimensional slice exhibiting strong convexity (Step 2); a stability bound via subgradient strong monotonicity (Step 3); and summation by harmonic numbers and Hölder’s inequality (Step 4).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A8.SS0.SSS0.Px1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 1 (FTL–BTL decomposition).&lt;/span&gt; Let $a_{t}:=\hat{f}_{t}(x_{t})$ and $b_{t}:=\hat{f}_{t+1}(x_{t})\text{.}$ By the standard Be-The-Leader lemma &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[Cesa-Bianchi and Lugosi, &lt;a href="#bib.bib1" title="Prediction, learning, and games" class="ltx_ref"&gt;2006&lt;/a&gt;]&lt;/cite&gt;, the FTL regret satisfies&lt;/p&gt;
&lt;table id="A8.Ex187" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\sum_{t=1}^{T}\bigl[(a_{t}-y_{t})^{2}-(b_{t}-y_{t})^{2}\bigr].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Here $a_{t},b_{t},y_{t}\in[0,1]$ forces $|a_{t}+b_{t}-2y_{t}|\leq 2\text{,}$ so&lt;/p&gt;
&lt;table id="A8.Ex188" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(a_{t}-y_{t})^{2}-(b_{t}-y_{t})^{2}\;=\;(a_{t}-b_{t})(a_{t}+b_{t}-2y_{t})\;\leq\;2|a_{t}-b_{t}|,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;yielding&lt;/p&gt;
&lt;table id="A8.E110" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;2\sum_{t=1}^{T}|a_{t}-b_{t}|.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(109)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A8.SS0.SSS0.Px1.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 2 (One-dimensional slice exhibiting strong convexity).&lt;/span&gt; Define the value function&lt;/p&gt;
&lt;table id="A8.Ex189" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$g_{t}(a)\;:=\;\min\!\left\{\sum_{s&amp;lt;t}(f(x_{s})-y_{s})^{2}\;:\;f\in\mathcal{F}_{\mathcal{P}}^{\uparrow},\;f(x_{t})=a\right\},\qquad a\in\mathbb{R},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;with the convention $\min\varnothing:=+\infty\text{:}$ as the value function of a parametric convex program &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[Boyd and Vandenberghe, &lt;a href="#bib.bib13" title="Convex optimization" class="ltx_ref"&gt;2004&lt;/a&gt;, §3.2.5]&lt;/cite&gt;, $g_{t}$ is proper convex with domain $[0,1]\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A8.SS0.SSS0.Px1.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Separate $\sum_{s&amp;lt;t}$ by whether $x_{s}=x_{t}\text{:}$ setting $q:=N_{t-1}(x_{t})$ and $\bar{z}:=q^{-1}\sum_{s&amp;lt;t,\,x_{s}=x_{t}}y_{s}$ (the term $q(a-\bar{z})^{2}$ vanishes when $q=0\text{,}$ with $\bar{z}$ then immaterial),&lt;/p&gt;
&lt;table id="A8.Ex190" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$g_{t}(a)\;=\;q(a-\bar{z})^{2}\,+\,C_{t}\,+\,h_{t}(a),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where $C_{t}:=\sum_{s&amp;lt;t,\,x_{s}=x_{t}}(y_{s}-\bar{z})^{2}$ is independent of $a$ and&lt;/p&gt;
&lt;table id="A8.Ex191" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$h_{t}(a)\;:=\;\min\!\left\{\sum_{\begin{subarray}{c}s&amp;lt;t\\ x_{s}\neq x_{t}\end{subarray}}(f(x_{s})-y_{s})^{2}\;:\;f\in\mathcal{F}_{\mathcal{P}}^{\uparrow},\;f(x_{t})=a\right\}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;is convex under the same convention. Hence $g_{t}$ is $2q$-strongly convex (contributed by the $q(a-\bar{z})^{2}$ term), and $G_{t}(a):=g_{t}(a)+(a-y_{t})^{2}$ is $2(q+1)$-strongly convex, with a unique minimizer. That minimizer is $b_{t}\text{:}$ since $\min_{a}G_{t}(a)=\min_{f\in\mathcal{F}_{\mathcal{P}}^{\uparrow}}\sum_{s\leq t}(f(x_{s})-y_{s})^{2}$ and $\hat{f}_{t+1}$ is feasible for the constraint $f(x_{t})=b_{t}\text{,}$ the value $b_{t}$ attains it.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A8.SS0.SSS0.Px1.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 3 (Stability bound via subgradient strong monotonicity).&lt;/span&gt; The fit $\hat{f}_{t}$ is feasible for the constraint $f(x_{t})=a_{t}\text{,}$ so $g_{t}(a_{t})=\min_{f\in\mathcal{F}_{\mathcal{P}}^{\uparrow}}\sum_{s&amp;lt;t}(f(x_{s})-y_{s})^{2}=\min_{a\in\mathbb{R}}g_{t}(a)\text{:}$ the FTL value $a_{t}$ minimizes $g_{t}$ over the whole line, whatever the tie-breaking. Fermat’s rule for proper convex functions gives&lt;/p&gt;
&lt;table id="A8.Ex192" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$0\in\partial g_{t}(a_{t}),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;endpoint minimizers included. Likewise $b_{t}$ minimizes $G_{t}$ over $\mathbb{R}\text{;}$ the second summand of $G_{t}=g_{t}+(\cdot-y_{t})^{2}$ is finite and differentiable on all of $\mathbb{R}\text{,}$ so the subgradient sum rule applies and&lt;/p&gt;
&lt;table id="A8.Ex193" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$0\in\partial G_{t}(b_{t})=\partial g_{t}(b_{t})+2(b_{t}-y_{t}),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;whence $-2(b_{t}-y_{t})\in\partial g_{t}(b_{t})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A8.SS0.SSS0.Px1.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Since $g_{t}$ is $2q$-strongly convex, its subdifferential is $2q$-strongly monotone: for any $x,y\in\mathbb{R}$ and any $s_{x}\in\partial g_{t}(x)\text{,}$ $s_{y}\in\partial g_{t}(y)\text{,}$&lt;/p&gt;
&lt;table id="A8.Ex194" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(s_{x}-s_{y})(x-y)\;\geq\;2q(x-y)^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Setting $x=b_{t}\text{,}$ $s_{x}=-2(b_{t}-y_{t})\text{,}$ $y=a_{t}\text{,}$ $s_{y}=0\text{,}$&lt;/p&gt;
&lt;table id="A8.E111" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$-2(b_{t}-y_{t})(b_{t}-a_{t})\;\geq\;2q(b_{t}-a_{t})^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(110)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A8.SS0.SSS0.Px1.p9" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Suppose $b_{t}\neq a_{t}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A8.SS0.SSS0.Px1.p10" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Case I ($b_{t}&amp;gt;a_{t}$).&lt;/em&gt; Dividing both sides of (&lt;a href="#A8.E111" title="Equation 110 ‣ Setup. ‣ Appendix H Follow-The-Leader on General Posets ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;110&lt;/span&gt;&lt;/a&gt;) by $2(b_{t}-a_{t})&amp;gt;0$ yields&lt;/p&gt;
&lt;table id="A8.Ex195" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$y_{t}-b_{t}\;\geq\;q(b_{t}-a_{t}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Adding $(b_{t}-a_{t})$ gives&lt;/p&gt;
&lt;table id="A8.Ex196" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(q+1)(b_{t}-a_{t})\;\leq\;y_{t}-a_{t}\;\leq\;1,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where the final step uses $y_{t}\leq 1$ and $a_{t}\geq 0\text{.}$ Thus $b_{t}-a_{t}\leq 1/(q+1)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A8.SS0.SSS0.Px1.p11" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Case II ($b_{t}&amp;lt;a_{t}$).&lt;/em&gt; Substituting $b_{t}-a_{t}=-(a_{t}-b_{t})$ in (&lt;a href="#A8.E111" title="Equation 110 ‣ Setup. ‣ Appendix H Follow-The-Leader on General Posets ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;110&lt;/span&gt;&lt;/a&gt;) gives $2(b_{t}-y_{t})(a_{t}-b_{t})\geq 2q(a_{t}-b_{t})^{2}\text{.}$ Dividing by $2(a_{t}-b_{t})&amp;gt;0\text{,}$&lt;/p&gt;
&lt;table id="A8.Ex197" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$b_{t}-y_{t}\;\geq\;q(a_{t}-b_{t}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Adding $(a_{t}-b_{t})\text{,}$&lt;/p&gt;
&lt;table id="A8.Ex198" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(q+1)(a_{t}-b_{t})\;\leq\;a_{t}-y_{t}\;\leq\;1.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Thus $a_{t}-b_{t}\leq 1/(q+1)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A8.SS0.SSS0.Px1.p12" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Combining the two cases,&lt;/p&gt;
&lt;table id="A8.Ex199" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$|a_{t}-b_{t}|\;\leq\;\frac{1}{q+1}\;=\;\frac{1}{N_{t-1}(x_{t})+1}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A8.SS0.SSS0.Px1.p13" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Tie-breaking.&lt;/em&gt; When $q=0$ (i.e., $x_{t}$ has not been queried before), (&lt;a href="#A8.E111" title="Equation 110 ‣ Setup. ‣ Appendix H Follow-The-Leader on General Posets ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;110&lt;/span&gt;&lt;/a&gt;) degenerates to $-2(b_{t}-y_{t})(b_{t}-a_{t})\geq 0$ (mere convexity), and the two-case argument still yields $|a_{t}-b_{t}|\leq 1\text{.}$ The derivation uses only $0\in\partial g_{t}(a_{t})$ and $a_{t}\in[0,1]\text{,}$ both of which hold for &lt;em class="ltx_emph ltx_font_italic"&gt;any&lt;/em&gt; $a_{t}\in\operatorname*{arg\,min}g_{t}$—the tie-breaking rule does not affect the bound.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A8.SS0.SSS0.Px1.p14" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 4 (Regret summation).&lt;/span&gt; Combining (&lt;a href="#A8.E110" title="Equation 109 ‣ Setup. ‣ Appendix H Follow-The-Leader on General Posets ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;109&lt;/span&gt;&lt;/a&gt;) with the stability bound from Step 3,&lt;/p&gt;
&lt;table id="A8.Ex200" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;2\sum_{t=1}^{T}\frac{1}{N_{t-1}(x_{t})+1}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Regrouping by $x\in\mathcal{P}\text{:}$ each point $x$ contributes $1/k$ at its $k$-th appearance ($k=1,\ldots,N_{T}(x)$), so&lt;/p&gt;
&lt;table id="A8.Ex201" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{t=1}^{T}\frac{1}{N_{t-1}(x_{t})+1}\;=\;\sum_{x\in\mathcal{P}}\sum_{k=1}^{N_{T}(x)}\frac{1}{k}\;=\;\sum_{x\in\mathcal{P}}H(N_{T}(x)),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;giving the first inequality of the theorem.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A8.SS0.SSS0.Px1.p15" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For the second inequality, we first establish that $H(k)\leq 3k^{1/3}$ for all $k\geq 1\text{.}$ The integral comparison gives $H(k)\leq 1+\ln k\text{.}$ Let $\phi(k):=3k^{1/3}-1-\ln k\text{;}$ then $\phi(1)=2&amp;gt;0$ and&lt;/p&gt;
&lt;table id="A8.Ex202" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\phi^{\prime}(k)\;=\;k^{-2/3}-k^{-1}\;=\;k^{-1}(k^{1/3}-1)\;\geq\;0\quad\text{for }k\geq 1,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;so $\phi$ is non-decreasing on $[1,\infty)$ with $\phi(k)\geq 2&amp;gt;0\text{.}$ Hence $H(k)\leq 1+\ln k\leq 3k^{1/3}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A8.SS0.SSS0.Px1.p16" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;By Hölder’s inequality with exponents $3$ and $3/2\text{,}$&lt;/p&gt;
&lt;table id="A8.Ex203" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{x\in\mathcal{P}}N_{T}(x)^{1/3}\;=\;\sum_{x\in\mathcal{P}}N_{T}(x)^{1/3}\cdot 1\;\leq\;\left(\sum_{x}N_{T}(x)\right)^{1/3}\!\left(\sum_{x}1\right)^{2/3}\;=\;T^{1/3}n^{2/3}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Combining,&lt;/p&gt;
&lt;table id="A8.Ex204" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;2\sum_{x\in\mathcal{P}}H(N_{T}(x))\;\leq\;6\sum_{x\in\mathcal{P}}N_{T}(x)^{1/3}\;\leq\;6\,n^{2/3}T^{1/3}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A9" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="chain-complete-minimax"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix I &lt;/span&gt;Chain Complete Minimax&lt;/h2&gt;
&lt;div id="A9.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This appendix establishes the complete $\Theta$-level minimax characterization of online isotonic regression on the chain $[n]\text{.}$ The upper bound specializes the general framework (&lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; and the Block Residual identity, &lt;a href="#Thmtheorem8" title="Lemma 8 (Block Residual). ‣ Recall. ‣ Appendix B Block Residual Property ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt;) to chain $[n]$ and is realized rate-optimally in polynomial time by the chain specialization of &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;; the Phase 0 and Phase 1 lower bounds use a noisy-bisection construction, while the Phase 2 lower bound specializes the interior-cube construction of &lt;a href="#A5.SS2" title="E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;E.2&lt;/span&gt;&lt;/a&gt; to one dimension. The three lower bounds match the upper bound phase-by-phase, yielding a three-phase scaling law.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A9.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="setup-and-main-theorem"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;I.1 &lt;/span&gt;Setup and Main Theorem&lt;/h3&gt;
&lt;div id="A9.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Fix $n\geq 2\text{.}$ Let $\mathcal{F}_{[n]}^{\uparrow}$ denote the class of non-decreasing functions $[n]\to[0,1]\text{,}$ and let $R_{T}^{*}([n])$ denote the minimax regret in the online isotonic regression protocol with squared loss.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A9.SS1.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Order polynomial of the chain.&lt;/h5&gt;
&lt;div id="A9.SS1.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Non-decreasing maps $[n]\to\{0,1,\ldots,K\}$ are in bijection with non-decreasing multisets of size $n$ drawn from $\{0,\ldots,K\}\text{,}$ so&lt;/p&gt;
&lt;table id="A9.Ex205" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Omega([n],K{+}1)\;=\;\binom{n+K}{K}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The universal upper-bound quantity $\Psi_{[n]}(T)$ therefore reads&lt;/p&gt;
&lt;table id="A9.Ex206" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi_{[n]}(T)\;=\;\inf_{K\in\mathbb{N}_{+}}\!\left[\,2\log\binom{n+K}{K}\,+\,\frac{T}{4K^{2}}\,\right].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem46" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 46&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Chain Complete Minimax).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem46.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For all $n\geq 2$ and $T\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A9.Ex207" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}([n])\;=\;\Theta\!\left(\min\bigl\{T,\;\Psi_{[n]}(T)\bigr\}\right).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Equivalently, there exist absolute constants $c_{0},c_{1}&amp;gt;0$ such that&lt;/span&gt;&lt;/p&gt;
&lt;table id="A9.Ex208" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}([n])\;=\;\begin{cases}\Theta(T),&amp;amp;T\leq c_{0}\log n\quad\textit{(Phase 0)},\\ \Theta\!\left(T^{1/3}\,L_{T}^{2/3}\right),&amp;amp;c_{0}\log n\leq T\leq c_{1}n^{3}\quad\textit{(Phase 1)},\\ \Theta\!\left(n\log(T/n^{3})\right),&amp;amp;T\geq c_{1}n^{3}\quad\textit{(Phase 2)},\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;where $L_{T}:=1+\log_{+}(n^{3}/T)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A9.SS1.SSS0.Px1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The proof comprises four parts: &lt;a href="#A9.SS2" title="I.2 Upper Bound ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;I.2&lt;/span&gt;&lt;/a&gt; establishes the upper bound and discusses the polynomial-time algorithmic realization; &lt;a href="#A9.SS3" title="I.3 Phase 0 and Phase 1 Lower Bound: Noisy Bisection ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Sections&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;I.3&lt;/span&gt;&lt;/a&gt; and &lt;a href="#A9.SS4" title="I.4 Phase 2 Lower Bound: One-Dimensional van Trees ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;I.4&lt;/span&gt;&lt;/a&gt; establish the Phase 0 &amp;amp; Phase 1 and Phase 2 lower bounds, respectively; &lt;a href="#A9.SS5" title="I.5 Putting the Three Phases Together ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;I.5&lt;/span&gt;&lt;/a&gt; combines them.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A9.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="upper-bound"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;I.2 &lt;/span&gt;Upper Bound&lt;/h3&gt;
&lt;section id="A9.SS2.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Claim.&lt;/h5&gt;
&lt;div id="A9.SS2.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For all $n\geq 2$ and $T\geq 1\text{,}$&lt;/p&gt;
&lt;table id="A9.Ex209" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}([n])\;\leq\;\min\bigl\{T,\;\Psi_{[n]}(T)\bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Moreover, the chain specialization of &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; (column-independent chain EW) attains this bound rate-optimally in polynomial time, in an anytime horizon-free fashion.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A9.SS2.SSS0.Px1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The trivial bound $R_{T}^{*}\leq T$ follows from $\hat{y}_{t},y_{t}\in[0,1]$ (each round contributes squared loss at most $1$). The bound $R_{T}^{*}\leq\Psi_{[n]}(T)$ is obtained by specializing &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; to $\mathcal{P}=[n]$ and substituting $\Omega([n],K{+}1)=\binom{n+K}{K}\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A9.SS2.SSS0.Px2" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Polynomial-time realization.&lt;/h5&gt;
&lt;div id="A9.SS2.SSS0.Px2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The chain $[n]$ is the single-column case of the column-independent setup: &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; treats each column as an independent chain, and on one chain of length $n$ that per-column routine is the standard chain isotonic exponential-weights algorithm. It runs EW over the expert class $\mathcal{F}_{[n],K}^{\uparrow}$ (the $\binom{n+K}{K}$ non-decreasing functions $[n]\to\{0,1/K,\ldots,1\}$) in per-round time $O(nK)$ by the same forward-backward recursion, and absorbs the discretization error into $T/(4K^{2})$ via &lt;a href="#Thmtheorem8" title="Lemma 8 (Block Residual). ‣ Recall. ‣ Appendix B Block Residual Property ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt;; at the level attaining $\Psi_{[n]}(T)$ this is $\mathrm{poly}(n,T)$ per round. The horizon-free choice of $K$ comes from the rate-doubling wrapper of &lt;a href="#alg3" title="In Algorithm 3 (formal restatement). ‣ F.3.3 Proof of Theorem 6 ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;. Its analysis (&lt;a href="#Thmtheorem42" title="Lemma 42 (Generic Φ-Wrapper Regret). ‣ Setup. ‣ F.3.2 Generic Φ-Wrapper Framework ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;42&lt;/span&gt;&lt;/a&gt;) reaches the poset only through the base regret hypothesis (&lt;a href="#A6.E99" title="Equation 98 ‣ Setup. ‣ F.3.2 Generic Φ-Wrapper Framework ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;98&lt;/span&gt;&lt;/a&gt;), so it applies verbatim with $[n]$ in place of $[m]^{2}\text{:}$ the envelope $\Phi_{[n]}(T):=\min\{T,\Psi_{[n]}(T)\}$ inherits (P1)–(P5) by the arguments of &lt;a href="#Thmtheorem41" title="Lemma 41 (Properties of Φ). ‣ F.3.1 Combined Upper Bound ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;41&lt;/span&gt;&lt;/a&gt;, and the chain engine tuned to horizon $L\text{,}$ run at the level attaining $\Psi_{[n]}(L)\text{,}$ satisfies the hypothesis with this envelope. Restarting it on the last-below schedule (&lt;a href="#S5.E8" title="Equation 8 ‣ Rate-doubling wrapper. ‣ 5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt;) formed from $\Phi_{[n]}$ therefore gives $R_{T}\leq 4\,\Phi_{[n]}(T)+2$ with no advance knowledge of $T\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A9.SS2.SSS0.Px3" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Three-phase asymptotics.&lt;/h5&gt;
&lt;div id="A9.SS2.SSS0.Px3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The standard estimate&lt;/p&gt;
&lt;table id="A9.Ex210" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log\binom{n+K}{K}\;=\;\begin{cases}\Theta(K\log(en/K)),&amp;amp;1\leq K\leq n,\\ \Theta(n\log(eK/n)),&amp;amp;K\geq n,\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;yields the three-phase asymptotic behaviour of $\Psi_{[n]}(T)\text{:}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A9.SS2.SSS0.Px3.p2" class="ltx_para"&gt;
&lt;ul id="A9.I1" class="ltx_itemize"&gt;
&lt;li id="A9.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I1.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Phase 0&lt;/span&gt; ($T\lesssim\log n$): $\binom{n+K}{K}$ is non-decreasing in $K\text{,}$ so every $K$ pays at least $2\log(n{+}1)\text{,}$ while $K=1$ pays $2\log(n{+}1)+T/4\text{;}$ hence $\Psi_{[n]}(T)=\Theta(\log n)\geq T$ and the trivial bound binds.&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A9.I1.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I1.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Phase 1&lt;/span&gt; ($\log n\lesssim T\lesssim n^{3}$): in the regime $K\leq n\text{,}$ balancing $K\log(en/K)$ against $T/K^{2}$ gives the optimum $K_{*}\asymp(T/L_{T})^{1/3}$ with $L_{T}\asymp 1+\log(n^{3}/T)\text{,}$ whence $\Psi_{[n]}(T)\asymp K_{*}L_{T}\asymp T^{1/3}L_{T}^{2/3}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A9.I1.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I1.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Phase 2&lt;/span&gt; ($T\gtrsim n^{3}$): in the regime $K\geq n\text{,}$ balancing $n\log(eK/n)$ against $T/K^{2}$ gives $K_{*}\asymp\sqrt{T/n}\text{,}$ whence $\Psi_{[n]}(T)\asymp n\log(T/n^{3})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A9.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="phase-0-and-phase-1-lower-bound-noisy-bisection"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;I.3 &lt;/span&gt;Phase 0 and Phase 1 Lower Bound: Noisy Bisection&lt;/h3&gt;
&lt;section id="A9.SS3.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Claim.&lt;/h5&gt;
&lt;div id="A9.SS3.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;There exists an absolute constant $c&amp;gt;0$ such that for all $n\geq 8$ and $T\geq 1\text{,}$&lt;/p&gt;
&lt;table id="A9.Ex211" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}([n])\;\geq\;c\,\sup_{K\in[1,\,\lfloor n/8\rfloor]}\min\bigl\{K\lfloor\log_{2}(n/K)\rfloor,\;\lfloor T/K^{2}\rfloor\bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Taking $K=1$ already gives $R_{T}^{*}([n])\geq c\min(\lfloor\log_{2}n\rfloor,T)\text{,}$ which covers Phase 0; an appropriate choice of $K$ recovers the Phase 1 bound $\Theta(T^{1/3}L_{T}^{2/3})$ (see &lt;a href="#A9.SS5" title="I.5 Putting the Three Phases Together ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;I.5&lt;/span&gt;&lt;/a&gt;). For $n&amp;lt;8$ the chain has constant size and the bound of &lt;a href="#Thmtheorem46" title="Theorem 46 (Chain Complete Minimax). ‣ Order polynomial of the chain. ‣ I.1 Setup and Main Theorem ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;46&lt;/span&gt;&lt;/a&gt; holds trivially with absorbed constant; this subsection therefore focuses on the range $n\geq 8\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A9.SS3.SSS1" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="construction-2"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;I.3.1 &lt;/span&gt;Construction&lt;/h4&gt;
&lt;div id="A9.SS3.SSS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Fix $K\in[1,\lfloor n/8\rfloor]\text{,}$ and set $d:=\lfloor\log_{2}(n/K)\rfloor\geq 3$ and $\ell:=2^{d}\text{.}$ Partition the first $K\ell$ elements of $[n]$ into $K$ consecutive blocks $B_{1},\ldots,B_{K}$ of equal length $\ell\text{.}$ The remaining $n-K\ell$ elements are never queried; the adversary extends $f^{*}$ to them monotonically (this does not affect the lower bound).&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A9.SS3.SSS1.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Hidden parameters.&lt;/h5&gt;
&lt;div id="A9.SS3.SSS1.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For each block $b\in[K]\text{,}$ sample a jump position $J_{b}\sim\mathrm{Unif}\{1,\ldots,\ell\}$ independently (i.e., the relative position of the jump within $B_{b}$). The construction below induces a family of revealed bits $\{\beta_{b,i}\}_{b\in[K],i\in[d]}\text{,}$ which we will show in &lt;a href="#A9.SS3.SSS2" title="I.3.2 Adversary’s Query Schedule ‣ I.3 Phase 0 and Phase 1 Lower Bound: Noisy Bisection ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;I.3.2&lt;/span&gt;&lt;/a&gt; are i.i.d. $\mathrm{Ber}(1/2)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A9.SS3.SSS1.Px2" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Block values.&lt;/h5&gt;
&lt;div id="A9.SS3.SSS1.Px2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For each $b\in[K]\text{,}$ set&lt;/p&gt;
&lt;table id="A9.Ex212" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$c_{b}^{-}\;:=\;\frac{1}{4}+\frac{b-1}{2K}+\frac{1}{8K},\qquad c_{b}^{+}\;:=\;c_{b}^{-}+\frac{1}{4K}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Direct verification yields:&lt;/p&gt;
&lt;ul id="A9.I2" class="ltx_itemize"&gt;
&lt;li id="A9.I2.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I2.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Intra-block gap:&lt;/em&gt; $\delta:=c_{b}^{+}-c_{b}^{-}=1/(4K)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A9.I2.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I2.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Inter-block separation:&lt;/em&gt; $c_{b+1}^{-}-c_{b}^{+}=1/(2K)-1/(4K)=1/(4K)&amp;gt;0\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A9.I2.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I2.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Range:&lt;/em&gt; $c_{b}^{\pm}\in(1/4,3/4)$ (specifically, $c_{b}^{-}\geq 1/4+1/(8K)$ and $c_{b}^{+}\leq 3/4-1/(8K)$), so $c_{b}^{\pm}(1-c_{b}^{\pm})\geq(1/4)(3/4)=3/16\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A9.SS3.SSS1.Px3" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Comparator $f^{*}$ (low-to-high jump within each block).&lt;/h5&gt;
&lt;div id="A9.SS3.SSS1.Px3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Identifying the $\ell$ elements of $B_{b}$ with $[\ell]$ via the natural order, define&lt;/p&gt;
&lt;table id="A9.Ex213" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$f^{*}(x)\;:=\;\begin{cases}c_{b}^{-},&amp;amp;x\in B_{b}\text{ with relative position}&amp;lt;J_{b},\\ c_{b}^{+},&amp;amp;x\in B_{b}\text{ with relative position}\geq J_{b}.\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Global monotonicity of $f^{*}$ follows from the intra-block low-to-high jump ($c_{b}^{-}&amp;lt;c_{b}^{+}$) together with the inter-block separation ($c_{b}^{+}&amp;lt;c_{b+1}^{-}$); hence $f^{*}\in\mathcal{F}_{[n]}^{\uparrow}\text{.}$ Labels are sampled independently as $y_{t}\mid x_{t}\sim\mathrm{Ber}(f^{*}(x_{t}))\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A9.SS3.SSS2" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="adversarys-query-schedule"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;I.3.2 &lt;/span&gt;Adversary’s Query Schedule&lt;/h4&gt;
&lt;div id="A9.SS3.SSS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Let $\mathcal{S}:=\{(b,i):b\in[K],i\in[d]\}$ ($Kd$ stages in total), processed in lexicographic order:&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A9.SS3.SSS2.p2" class="ltx_para"&gt;
&lt;ul id="A9.I3" class="ltx_itemize"&gt;
&lt;li id="A9.I3.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I3.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Upon entering stage $(b,i)\text{,}$ $J_{b}$ has been localized to a sub-interval $I_{b,i-1}\subseteq B_{b}$ (with $I_{b,0}:=B_{b}\text{,}$ and $I_{b,i}$ determined by the bit $\beta_{b,i}$ at the end of the stage; see below).&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A9.I3.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I3.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The query position $x^{(b,i)}$ is the midpoint of $I_{b,i-1}$ (i.e., the rightmost element of the left half of $I_{b,i-1}$); the stage queries $x^{(b,i)}$ for $K^{2}$ consecutive rounds.&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A9.I3.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I3.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;At the end of the stage, set $\beta_{b,i}:=\mathbf{1}\!\left[J_{b}\leq x^{(b,i)}\right]$ (i.e., whether $J_{b}$ lies in the left half of $I_{b,i-1}$); update $I_{b,i}$ to be the left half of $I_{b,i-1}$ if $\beta_{b,i}=1\text{,}$ and the right half otherwise.&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="ltx_p"&gt;The schedule above uses $K^{3}d$ rounds. If $T&amp;lt;K^{3}d\text{,}$ only the first $\lfloor T/K^{2}\rfloor$ stages are executed in full; the remaining $\leq K^{2}$ rounds query an arbitrary fixed point and do not contribute to the lower bound. If $T&amp;gt;K^{3}d\text{,}$ the remaining $T-K^{3}d$ rounds likewise query an arbitrary fixed point.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem47" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 47&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Comparator value at the queried midpoint).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem47.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For every stage $(b,i)\text{,}$ $f^{*}(x^{(b,i)})=c_{b}^{\beta_{b,i}}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A9.SS3.SSS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;If $\beta_{b,i}=1\text{,}$ then $J_{b}\leq x^{(b,i)}\text{,}$ so $x^{(b,i)}\geq J_{b}\text{,}$ and the rule “$x\geq J_{b}$ takes the high value” gives $f^{*}(x^{(b,i)})=c_{b}^{+}=c_{b}^{1}\text{.}$ Conversely, if $\beta_{b,i}=0\text{,}$ then $J_{b}&amp;gt;x^{(b,i)}\text{,}$ so $x^{(b,i)}&amp;lt;J_{b}$ and $f^{*}(x^{(b,i)})=c_{b}^{-}=c_{b}^{0}\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;section id="A9.SS3.SSS2.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Marginal distribution of the bits.&lt;/h5&gt;
&lt;div id="A9.SS3.SSS2.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;A direct induction shows that, conditional on $\sigma(\beta_{b,1:i-1})\text{,}$ $J_{b}$ remains uniformly distributed on $I_{b,i-1}\text{;}$ since $x^{(b,i)}$ bisects $I_{b,i-1}$ into two halves of equal cardinality, $\beta_{b,i}\mid\sigma(\beta_{b,1:i-1})\sim\mathrm{Ber}(1/2)\text{.}$ Combined with the cross-block independence inherited from the independent $\{J_{b}\}\text{,}$ the family $\{\beta_{b,i}\}_{b\in[K],i\in[d]}$ is i.i.d. $\mathrm{Ber}(1/2)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A9.SS3.SSS3" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="bit-independence"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;I.3.3 &lt;/span&gt;Bit Independence&lt;/h4&gt;
&lt;div id="Thmtheorem48" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 48&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Bit independence).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem48.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let&lt;/span&gt;&lt;/p&gt;
&lt;table id="A9.Ex214" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{F}_{(b,i)}\;:=\;\sigma\bigl(x^{(b,i)}\bigr)\vee\sigma\bigl(x^{(b^{\prime},i^{\prime})},\;Y^{(b^{\prime},i^{\prime})}_{1:K^{2}}\,:\,(b^{\prime},i^{\prime})\prec_{\mathrm{lex}}(b,i)\bigr)$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;denote all information available to the learner before any label is revealed in stage $(b,i)\text{,}$ the current query included. Then $\beta_{b,i}\perp\mathcal{F}_{(b,i)}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A9.SS3.SSS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;By the schedule rule, $x^{(b^{\prime},i^{\prime})}$ is a deterministic function of $\beta_{b^{\prime},1:i^{\prime}-1}\text{;}$ by &lt;a href="#Thmtheorem47" title="Lemma 47 (Comparator value at the queried midpoint). ‣ I.3.2 Adversary’s Query Schedule ‣ I.3 Phase 0 and Phase 1 Lower Bound: Noisy Bisection ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;47&lt;/span&gt;&lt;/a&gt; and the independent Bernoulli noise, the conditional distribution of $Y^{(b^{\prime},i^{\prime})}_{r}$ depends only on $\beta_{b^{\prime},i^{\prime}}\text{.}$ Hence&lt;/p&gt;
&lt;table id="A9.Ex215" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{F}_{(b,i)}\;\subseteq\;\sigma\bigl(\beta_{b^{\prime},i^{\prime}}:(b^{\prime},i^{\prime})\prec_{\mathrm{lex}}(b,i)\bigr)\;\vee\;\sigma(\text{label noise}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;By the i.i.d. property of the bits, $\beta_{b,i}$ is independent of $\{\beta_{b^{\prime},i^{\prime}}:(b^{\prime},i^{\prime})\neq(b,i)\}\text{;}$ it is also independent of the label noise (an independent randomness source). Therefore $\beta_{b,i}\perp\mathcal{F}_{(b,i)}\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A9.SS3.SSS4" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="single-stage-bayes-regret"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;I.3.4 &lt;/span&gt;Single-Stage Bayes Regret&lt;/h4&gt;
&lt;div id="A9.SS3.SSS4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Fix a stage $(b,i)$ and write $\beta:=\beta_{b,i}\text{.}$ By &lt;a href="#Thmtheorem48" title="Lemma 48 (Bit independence). ‣ I.3.3 Bit Independence ‣ I.3 Phase 0 and Phase 1 Lower Bound: Noisy Bisection ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;48&lt;/span&gt;&lt;/a&gt;, $\beta\mid\mathcal{F}_{(b,i)}\sim\mathrm{Ber}(1/2)\text{;}$ conditionally on this, the labels $Y^{(b,i)}_{r}\mid\beta\sim\mathrm{Ber}(c_{b}^{\beta})$ are i.i.d. for $r\in[K^{2}]\text{.}$ Define&lt;/p&gt;
&lt;table id="A9.Ex216" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{G}_{r}\;:=\;\mathcal{F}_{(b,i)}\vee\sigma\bigl(Y^{(b,i)}_{1:r}\bigr),\qquad p_{r}\;:=\;\mathbb{P}(\beta=1\mid\mathcal{G}_{r}),\qquad V_{r}\;:=\;p_{r}(1-p_{r}),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;with the conventions $p_{0}=1/2$ and $\mathcal{G}_{0}=\mathcal{F}_{(b,i)}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem49" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 49&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Single-stage Bayes regret lower bound).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem49.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For any sequence of $\mathcal{G}_{r-1}$-measurable predictions $\hat{y}_{r}\in\mathbb{R}\text{,}$ $r\in[K^{2}]\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A9.Ex217" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{r=1}^{K^{2}}\mathbb{E}\!\bigl[(\hat{y}_{r}-c_{b}^{\beta})^{2}\bigr]\;\geq\;c_{*},\qquad c_{*}:=1/128.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;The constant $c_{*}$ depends on neither $K\text{,}$ $b\text{,}$ nor $i\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A9.SS3.SSS4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The proof proceeds in four steps.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A9.SS3.SSS4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 1 (per-round variance lower bound).&lt;/span&gt; By the variance decomposition,&lt;/p&gt;
&lt;table id="A9.Ex218" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\!\bigl[(\hat{y}_{r}-c_{b}^{\beta})^{2}\mid\mathcal{G}_{r-1}\bigr]\;\geq\;\mathrm{Var}(c_{b}^{\beta}\mid\mathcal{G}_{r-1})\;=\;\delta^{2}V_{r-1},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;the last step using $c_{b}^{\beta}=c_{b}^{-}+\beta\delta$ and $\mathrm{Var}(\beta\mid\mathcal{G}_{r-1})=V_{r-1}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A9.SS3.SSS4.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 2 ($V_{r}$ is a supermartingale).&lt;/span&gt; The tower property gives $\mathbb{E}[p_{r}\mid\mathcal{G}_{r-1}]=p_{r-1}\text{,}$ and Jensen’s inequality gives $\mathbb{E}[p_{r}^{2}\mid\mathcal{G}_{r-1}]\geq p_{r-1}^{2}\text{.}$ Hence&lt;/p&gt;
&lt;table id="A9.Ex219" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[V_{r}\mid\mathcal{G}_{r-1}]\;=\;p_{r-1}-\mathbb{E}[p_{r}^{2}\mid\mathcal{G}_{r-1}]\;\leq\;V_{r-1};$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;in particular, $r\mapsto\mathbb{E}[V_{r}]$ is non-increasing.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A9.SS3.SSS4.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 3 (lower bound on the terminal posterior variance).&lt;/span&gt; Let $P_{0},P_{1}$ denote the law of $(Y^{(b,i)}_{1},\ldots,Y^{(b,i)}_{K^{2}})$ conditional on $\beta=0$ and $\beta=1\text{,}$ respectively. The pointwise inequality $p(1-p)\geq\tfrac{1}{2}\min(p,1-p)$ together with the classical Bayes-test identity $\mathbb{E}[\min(p_{K^{2}},1{-}p_{K^{2}})]=(1-\|P_{0}-P_{1}\|_{\mathrm{TV}})/2$ (the MAP error rate under the uniform prior) gives&lt;/p&gt;
&lt;table id="A9.Ex220" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[V_{K^{2}}]\;\geq\;\tfrac{1}{2}\,\mathbb{E}\!\left[\min(p_{K^{2}},\,1{-}p_{K^{2}})\right]\;=\;\frac{1-\|P_{0}-P_{1}\|_{\mathrm{TV}}}{4}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;It remains to bound $\|P_{0}-P_{1}\|_{\mathrm{TV}}\text{.}$ Since $P_{0}$ and $P_{1}$ are products of $K^{2}$ i.i.d. Bernoulli factors, the chain rule for KL divergence together with the inequality $\mathrm{KL}(\mathrm{Ber}(p)\|\mathrm{Ber}(q))\leq(p-q)^{2}/[q(1-q)]$ (i.e., $\mathrm{KL}\leq\chi^{2}$) yields&lt;/p&gt;
&lt;table id="A9.Ex221" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathrm{KL}(P_{0}\|P_{1})\;=\;K^{2}\cdot\mathrm{KL}(\mathrm{Ber}(c_{b}^{-})\|\mathrm{Ber}(c_{b}^{+}))\;\leq\;K^{2}\cdot\frac{16\delta^{2}}{3}\;=\;\frac{1}{3},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;the final equality using $c_{b}^{+}(1-c_{b}^{+})\geq 3/16$ and $\delta^{2}=1/(16K^{2})\text{.}$ Pinsker’s inequality then gives $\|P_{0}-P_{1}\|_{\mathrm{TV}}\leq\sqrt{(1/2)\cdot 1/3}=1/\sqrt{6}\text{,}$ so&lt;/p&gt;
&lt;table id="A9.Ex222" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[V_{K^{2}}]\;\geq\;\frac{1-1/\sqrt{6}}{4}\;&amp;gt;\;\frac{1}{8}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;(numerically: $1/\sqrt{6}\approx 0.408\text{,}$ so $(1-0.408)/4\approx 0.148&amp;gt;0.125$).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A9.SS3.SSS4.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 4 (summation).&lt;/span&gt; By the monotonicity of Step 2, $\mathbb{E}[V_{r-1}]\geq\mathbb{E}[V_{K^{2}}]\geq 1/8$ for all $r\in[K^{2}]\text{.}$ Combined with Step 1,&lt;/p&gt;
&lt;table id="A9.Ex223" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{r=1}^{K^{2}}\mathbb{E}\!\bigl[(\hat{y}_{r}-c_{b}^{\beta})^{2}\bigr]\;\geq\;\delta^{2}\sum_{r=1}^{K^{2}}\mathbb{E}[V_{r-1}]\;\geq\;\frac{\delta^{2}K^{2}}{8}\;=\;\frac{1}{128}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Since $\delta^{2}K^{2}=1/16$ does not depend on $K\text{,}$ the constant $c_{*}=1/128$ is absolute.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A9.SS3.SSS5" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="total-regret-accumulation"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;I.3.5 &lt;/span&gt;Total Regret Accumulation&lt;/h4&gt;
&lt;div id="A9.SS3.SSS5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step A (regret reduction to per-round MSE).&lt;/span&gt; Since $f^{*}\in\mathcal{F}_{[n]}^{\uparrow}$ almost surely, $R_{T}\geq\sum_{t=1}^{T}[(\hat{y}_{t}-y_{t})^{2}-(f^{*}(x_{t})-y_{t})^{2}]$ by definition of the minimax regret. As in Step A of the proof of &lt;a href="#Thmtheorem31" title="Lemma 31 (Interior-Cube Lower Bound). ‣ E.2.6 Proof of Lemma 31 ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;31&lt;/span&gt;&lt;/a&gt;, the cross term $(\hat{y}_{t}-f^{*}(x_{t}))(f^{*}(x_{t})-y_{t})$ has zero conditional expectation given $\sigma(\text{past},\,f^{*},\,x_{t})$ (since $\mathbb{E}[y_{t}\mid f^{*},x_{t}]=f^{*}(x_{t})$), so&lt;/p&gt;
&lt;table id="A9.Ex224" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[R_{T}]\;\geq\;\sum_{t=1}^{T}\mathbb{E}\!\bigl[(\hat{y}_{t}-f^{*}(x_{t}))^{2}\bigr].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A9.SS3.SSS5.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step B (aggregation by stages).&lt;/span&gt; Each stage $(b,i)$ occupies $K^{2}$ consecutive rounds, throughout which $f^{*}(x_{t})=c_{b}^{\beta_{b,i}}$ by &lt;a href="#Thmtheorem47" title="Lemma 47 (Comparator value at the queried midpoint). ‣ I.3.2 Adversary’s Query Schedule ‣ I.3 Phase 0 and Phase 1 Lower Bound: Noisy Bisection ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;47&lt;/span&gt;&lt;/a&gt;; by &lt;a href="#Thmtheorem49" title="Lemma 49 (Single-stage Bayes regret lower bound). ‣ I.3.4 Single-Stage Bayes Regret ‣ I.3 Phase 0 and Phase 1 Lower Bound: Noisy Bisection ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;49&lt;/span&gt;&lt;/a&gt;, every fully executed stage contributes at least $c_{*}$ to $\mathbb{E}[R_{T}]\text{.}$ Hence&lt;/p&gt;
&lt;table id="A9.Ex225" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[R_{T}]\;\geq\;\sum_{(b,i)\in\mathcal{S}_{\mathrm{full}}}\sum_{r=1}^{K^{2}}\mathbb{E}\!\bigl[(\hat{y}_{(b,i,r)}-c_{b}^{\beta_{b,i}})^{2}\bigr]\;\geq\;c_{*}\cdot|\mathcal{S}_{\mathrm{full}}|,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where $\mathcal{S}_{\mathrm{full}}$ is the set of fully executed stages.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A9.SS3.SSS5.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step C (number of completed stages).&lt;/span&gt; Each stage uses exactly $K^{2}$ rounds, so $|\mathcal{S}_{\mathrm{full}}|=\min(Kd,\,\lfloor T/K^{2}\rfloor)\text{,}$ and therefore&lt;/p&gt;
&lt;table id="A9.Ex226" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[R_{T}]\;\geq\;c_{*}\min\!\bigl\{K\lfloor\log_{2}(n/K)\rfloor,\;\lfloor T/K^{2}\rfloor\bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A9.SS3.SSS5.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step D (Yao’s principle and the supremum over $K$).&lt;/span&gt; The adversary is fully oblivious: query positions are determined by the pre-sampled $\{J_{b}\}$ and the deterministic schedule rule, independently of the learner’s actions. Yao’s principle therefore yields the minimax lower bound $R_{T}^{*}([n])\geq c_{*}\min\{K\lfloor\log_{2}(n/K)\rfloor,\,\lfloor T/K^{2}\rfloor\}\text{;}$ taking the supremum over $K\in[1,\lfloor n/8\rfloor]$ completes the proof of the claim. ∎&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A9.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="phase-2-lower-bound-one-dimensional-van-trees"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;I.4 &lt;/span&gt;Phase 2 Lower Bound: One-Dimensional van Trees&lt;/h3&gt;
&lt;section id="A9.SS4.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Claim.&lt;/h5&gt;
&lt;div id="A9.SS4.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For all $n\geq 2$ and $T\geq n\text{,}$&lt;/p&gt;
&lt;table id="A9.Ex227" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}([n])\;\geq\;\frac{3n}{16}\log\!\left(1+\frac{T}{240\,n^{3}}\right).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The construction and analysis are the one-dimensional specialization of the interior-cube lower bound of &lt;a href="#A5.SS2" title="E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;E.2&lt;/span&gt;&lt;/a&gt;: every supporting lemma (prior Fisher information, posterior factorization, the van Trees fact) carries over verbatim, the only differences being the choice of parameters and the index set ($n$ instead of $m^{2}$). We list the parameters and the key steps below; the proof skeleton itself is not reproduced.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A9.SS4.SSS1" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="construction-3"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;I.4.1 &lt;/span&gt;Construction&lt;/h4&gt;
&lt;div id="A9.SS4.SSS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Fix $n\geq 2$ and $T\geq n\text{.}$ Set $\varepsilon:=1/(8n)$ and $q:=\lfloor T/n\rfloor\geq 1\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A9.SS4.SSS1.p2" class="ltx_para"&gt;
&lt;ul id="A9.I4" class="ltx_itemize"&gt;
&lt;li id="A9.I4.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I4.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Base points.&lt;/span&gt; $b_{i}:=1/3+(i-1)/(3n)$ for $i\in[n]\text{.}$ The adjacent gap is $b_{i+1}-b_{i}=1/(3n)\text{,}$ with buffer $b_{i+1}-b_{i}-2\varepsilon=1/(12n)&amp;gt;0\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A9.I4.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I4.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Prior.&lt;/span&gt; The same density as in &lt;a href="#A5.SS2" title="E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;E.2&lt;/span&gt;&lt;/a&gt;,&lt;/p&gt;
&lt;table id="A9.Ex228" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\pi_{\varepsilon}(\theta)\;:=\;\frac{15}{16\,\varepsilon}\!\left(1-\theta^{2}/\varepsilon^{2}\right)^{2}\mathbf{1}\!\left[|\theta|\leq\varepsilon\right],$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;satisfying $\pi_{\varepsilon}(\pm\varepsilon)=0$ and $J(\pi_{\varepsilon})=10/\varepsilon^{2}=640\,n^{2}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A9.I4.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I4.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Parameters.&lt;/span&gt; Sample $\Theta_{i}\sim\pi_{\varepsilon}$ independently and set $P_{i}:=b_{i}+\Theta_{i}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A9.I4.i4" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I4.i4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Schedule.&lt;/span&gt; Partition the first $nq$ rounds into $n$ blocks; in block $i\text{,}$ query $x_{t}=i$ for $q$ consecutive rounds. The remaining $T-nq&amp;lt;n$ rounds query $x_{t}=1$ (this contributes nonnegatively to the regret and is dropped from the lower bound). Labels are sampled as $y_{t}\mid\Theta\sim\mathrm{Ber}(P_{x_{t}})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A9.SS4.SSS2" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="validity-of-the-construction"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;I.4.2 &lt;/span&gt;Validity of the Construction&lt;/h4&gt;
&lt;div id="A9.SS4.SSS2.p1" class="ltx_para"&gt;
&lt;ul id="A9.I5" class="ltx_itemize"&gt;
&lt;li id="A9.I5.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I5.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Strict isotonicity.&lt;/em&gt; For any $i&amp;lt;j\text{,}$ $P_{j}-P_{i}\geq 1/(3n)-2\varepsilon=1/(12n)&amp;gt;0\text{,}$ so $P\in\mathcal{F}_{[n]}^{\uparrow}$ almost surely.&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A9.I5.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I5.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Range.&lt;/em&gt; $b_{i}\in[1/3,\,2/3-1/(3n)]$ and $|\Theta_{i}|\leq 1/(8n)\text{.}$ For $n\geq 2\text{,}$ $P_{i}\geq 1/3-1/16=13/48&amp;gt;1/4$ and $P_{i}\leq 2/3-1/(3n)+1/(8n)=2/3-5/(24n)&amp;lt;3/4\text{;}$ hence $P_{i}\in[1/4,3/4]$ uniformly.&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A9.I5.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I5.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Bernoulli Fisher upper bound.&lt;/em&gt; $p(1-p)$ attains its minimum $3/16$ on $[1/4,3/4]$ at the endpoints, so $I_{1}=1/[P_{i}(1-P_{i})]\leq 16/3\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A9.SS4.SSS3" class="ltx_subsubsection"&gt;
&lt;h4 class="ltx_title ltx_title_subsubsection" id="proof-skeleton"&gt;
&lt;span class="ltx_tag ltx_tag_subsubsection"&gt;I.4.3 &lt;/span&gt;Proof Skeleton&lt;/h4&gt;
&lt;div id="A9.SS4.SSS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The proof skeleton matches that of &lt;a href="#Thmtheorem31" title="Lemma 31 (Interior-Cube Lower Bound). ‣ E.2.6 Proof of Lemma 31 ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;31&lt;/span&gt;&lt;/a&gt; step by step.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A9.SS4.SSS3.p2" class="ltx_para"&gt;
&lt;ul id="A9.I6" class="ltx_itemize"&gt;
&lt;li id="A9.I6.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I6.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step A (regret reduction).&lt;/span&gt; As in Step A of &lt;a href="#Thmtheorem31" title="Lemma 31 (Interior-Cube Lower Bound). ‣ E.2.6 Proof of Lemma 31 ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;31&lt;/span&gt;&lt;/a&gt;: $\mathbb{E}[R_{T}]\geq\sum_{t=1}^{nq}\mathbb{E}[(\hat{y}_{t}-P_{x_{t}})^{2}]\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A9.I6.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I6.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step B (posterior factorization).&lt;/span&gt; The factorization lemma &lt;a href="#Thmtheorem29" title="Lemma 29 (Posterior Factorization). ‣ Setup. ‣ E.2.4 Posterior Factorization ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;29&lt;/span&gt;&lt;/a&gt; holds for any finite index set $V\text{;}$ specializing to $V=[n]$ gives $\mathcal{L}(\Theta_{i}\mid\mathcal{H}_{t-1})=\mathcal{L}(\Theta_{i}\mid Y_{i}^{1:s(t)-1})\text{,}$ where $s(t)$ is the visit index of $x_{t}=i\text{.}$ Combined with the minimum-MSE property,&lt;/p&gt;
&lt;table id="A9.Ex229" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[(\hat{y}_{t}-P_{x_{t}})^{2}]\;\geq\;\mathbb{E}\!\left[\mathrm{Var}(\Theta_{x_{t}}\mid Y_{x_{t}}^{1:s(t)-1})\right].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A9.I6.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I6.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step C (van Trees).&lt;/span&gt; &lt;a href="#Thmtheorem30" title="Fact 30 (Van Trees Inequality). ‣ E.2.5 Van Trees Inequality ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Fact&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;30&lt;/span&gt;&lt;/a&gt;, applied with $J(\pi_{\varepsilon})=10/\varepsilon^{2}$ and $I_{n}(\theta)\leq 16n/3\text{,}$ gives&lt;/p&gt;
&lt;table id="A9.Ex230" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\!\left[\mathrm{Var}(\Theta_{i}\mid Y_{i}^{1:s-1})\right]\;\geq\;\frac{1}{16(s-1)/3+10/\varepsilon^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A9.I6.i4" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I6.i4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step D (summation).&lt;/span&gt; Set $a:=16/3$ and $b:=10/\varepsilon^{2}\text{.}$ Each grid point contributes $q$ visits ($s=1,\ldots,q$), and integral comparison gives&lt;/p&gt;
&lt;table id="A9.Ex231" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{k=0}^{q-1}\frac{1}{ak+b}\;\geq\;\int_{0}^{q}\frac{dt}{at+b}\;=\;\frac{1}{a}\log\!\left(1+\frac{aq}{b}\right)\;=\;\frac{3}{16}\log\!\left(1+\frac{8q\varepsilon^{2}}{15}\right).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Substituting $\varepsilon^{2}=1/(64n^{2})$ gives $8q\varepsilon^{2}/15=q/(120n^{2})\text{.}$ Since $q\geq T/(2n)$ for $T\geq n\text{,}$ this is bounded below by $T/(240n^{3})\text{.}$ Multiplying by $n$ and applying Yao’s principle,&lt;/p&gt;
&lt;table id="A9.Ex232" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}([n])\;\geq\;\frac{3n}{16}\log\!\left(1+\frac{T}{240\,n^{3}}\right).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A9.SS5" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="putting-the-three-phases-together"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;I.5 &lt;/span&gt;Putting the Three Phases Together&lt;/h3&gt;
&lt;div id="A9.SS5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Combining the upper bound of &lt;a href="#A9.SS2" title="I.2 Upper Bound ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;I.2&lt;/span&gt;&lt;/a&gt; with the lower bounds of &lt;a href="#A9.SS3" title="I.3 Phase 0 and Phase 1 Lower Bound: Noisy Bisection ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Sections&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;I.3&lt;/span&gt;&lt;/a&gt; and &lt;a href="#A9.SS4" title="I.4 Phase 2 Lower Bound: One-Dimensional van Trees ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;I.4&lt;/span&gt;&lt;/a&gt; yields &lt;a href="#Thmtheorem46" title="Theorem 46 (Chain Complete Minimax). ‣ Order polynomial of the chain. ‣ I.1 Setup and Main Theorem ‣ Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;46&lt;/span&gt;&lt;/a&gt;. The matching in each phase is as follows.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A9.SS5.p2" class="ltx_para"&gt;
&lt;ul id="A9.I7" class="ltx_itemize"&gt;
&lt;li id="A9.I7.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I7.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Phase 0&lt;/span&gt; ($T\lesssim\log n$): the trivial upper bound $R_{T}\leq T$ is matched by the noisy-bisection lower bound $c\min(\lfloor\log_{2}n\rfloor,T)=cT$ (taking $K=1$); thus $R_{T}^{*}([n])=\Theta(T)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A9.I7.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I7.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Phase 1&lt;/span&gt; ($\log n\lesssim T\lesssim n^{3}$): the upper bound $\Psi_{[n]}(T)\asymp T^{1/3}L_{T}^{2/3}$ is matched by the noisy-bisection lower bound at the optimal $K_{*}\asymp(T/L_{T})^{1/3}\text{,}$ where $K_{*}\log_{2}(n/K_{*})\asymp T^{1/3}L_{T}^{2/3}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A9.I7.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="A9.I7.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Phase 2&lt;/span&gt; ($T\gtrsim n^{3}$): the upper bound $\Psi_{[n]}(T)\asymp n\log(T/n^{3})$ (at $K_{*}\asymp\sqrt{T/n}$) is matched by the van Trees lower bound $(3n/16)\log(1+T/(240n^{3}))=\Theta(n\log(T/n^{3}))$ (since $T/(240n^{3})\gg 1$ for $T\gg n^{3}$).&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A10" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="convex-losses-proofs"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix J &lt;/span&gt;Convex Losses: Proofs&lt;/h2&gt;
&lt;div id="A10.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This appendix proves the loss-side results of &lt;a href="#S2" title="2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Sections&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S4" title="4 The Lipschitz Boundary ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;: level-set stationarity (&lt;a href="#A10.SS1" title="J.1 Level-Set Stationarity ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;J.1&lt;/span&gt;&lt;/a&gt;), the universal upper bound (&lt;a href="#A10.SS2" title="J.2 The Universal Upper Bound ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;J.2&lt;/span&gt;&lt;/a&gt;), the substitution that carries every lower bound of &lt;a href="#A11" title="Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;K&lt;/span&gt;&lt;/a&gt; across the loss class of &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; (&lt;a href="#A10.SS3" title="J.3 Loss Substitutions in the Lower Bounds ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;J.3&lt;/span&gt;&lt;/a&gt;), the entropic loss (&lt;a href="#A10.SS4" title="J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;J.4&lt;/span&gt;&lt;/a&gt;), and the Lipschitz boundary (&lt;a href="#A10.SS5" title="J.5 Lipschitz Losses ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;J.5&lt;/span&gt;&lt;/a&gt;). Its last two subsections serve &lt;a href="#S5" title="5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;: the loss-increment form of the surrogate (&lt;a href="#A10.SS6" title="J.6 The Loss-Increment Surrogate ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;J.6&lt;/span&gt;&lt;/a&gt;) and the planar engine across the loss class (&lt;a href="#A10.SS7" title="J.7 The Planar Engine Across the Loss Class ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;J.7&lt;/span&gt;&lt;/a&gt;), the algorithmic input to the slicing theorem.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A10.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="level-set-stationarity"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;J.1 &lt;/span&gt;Level-Set Stationarity&lt;/h3&gt;
&lt;div id="Thmtheorem50" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 50&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Level-Set Stationarity).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem50.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $\mathcal{P}$ be a finite poset and let $\ell(\cdot,y)$ be convex on $[0,1]$ for every $y$ and differentiable on $(0,1)\text{.}$ Let $f^{*}$ minimize $L_{T}(f):=\sum_{t=1}^{T}\ell(f(x_{t}),y_{t})$ over $\mathcal{F}_{\mathcal{P}}^{\uparrow}\text{,}$ with $L_{T}(f^{*})&amp;lt;\infty\text{,}$ and for each value $c$ attained by $f^{*}$ let $B_{c}:=\{u\in\mathcal{P}:w_{u}&amp;gt;0,\ f^{*}(u)=c\}\text{,}$ where $w_{u}:=|\{t:x_{t}=u\}|\text{.}$ Then&lt;/span&gt;&lt;/p&gt;
&lt;table id="A10.Ex233" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{t\,:\,x_{t}\in B_{c}}\partial_{1}\ell(c,y_{t})\;=\;0\qquad\text{for every }c\in(0,1),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;while the corresponding sum of right derivatives at $c=0$ is nonnegative and the sum of left derivatives at $c=1$ is nonpositive.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A10.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The proof perturbs the complete level set. Fix a value $c$ attained by $f^{*}$ and let $C_{c}:=\{u\in\mathcal{P}:f^{*}(u)=c\}\text{,}$ so that $B_{c}=\{u\in C_{c}:w_{u}&amp;gt;0\}\text{,}$ and perturb the whole of it uniformly:&lt;/p&gt;
&lt;table id="A10.Ex234" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$f_{\epsilon}\;:=\;f^{*}+\epsilon\,\mathbf{1}\!\left[\cdot\in C_{c}\right].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A10.SS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;If $u\in C_{c}\text{,}$ $v\notin C_{c}\text{,}$ and $u\prec v\text{,}$ then $f^{*}(v)\geq c$ and $f^{*}(v)\neq c\text{,}$ so $f^{*}(v)&amp;gt;c\text{;}$ symmetrically, $f^{*}(u)&amp;lt;c$ whenever $u\notin C_{c}\text{,}$ $v\in C_{c}\text{,}$ $u\prec v\text{.}$ Since $\mathcal{P}$ is finite, there is $\epsilon_{0}&amp;gt;0$ smaller than all these gaps, and smaller than $\min\{c,1-c\}$ when $c\in(0,1)\text{.}$ For $|\epsilon|\leq\epsilon_{0}$ the function $f_{\epsilon}$ is then order-preserving: pairs inside or outside $C_{c}$ keep their differences, and pairs across the boundary retain a positive gap. Its values lie in $[0,1]$ for $|\epsilon|\leq\epsilon_{0}$ when $c\in(0,1)\text{,}$ for $\epsilon\in[0,\epsilon_{0}]$ when $c=0\text{,}$ and for $\epsilon\in[-\epsilon_{0},0]$ when $c=1\text{;}$ at $c=0$ no element of $\mathcal{P}$ lies below $C_{c}$ with a smaller value, so only the upward comparisons matter, and symmetrically at $c=1\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Only the rounds with $x_{t}\in B_{c}$ see the perturbation, so&lt;/p&gt;
&lt;table id="A10.Ex235" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F(\epsilon)\;:=\;\sum_{t\,:\,x_{t}\in B_{c}}\ell(c+\epsilon,y_{t})\;=\;L_{T}(f_{\epsilon})\,-\,\text{const}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;is minimized at $\epsilon=0$ over the admissible range, and $F(0)\leq L_{T}(f^{*})&amp;lt;\infty\text{.}$ For $c\in(0,1)\text{,}$ each summand is finite and differentiable on a two-sided neighborhood of $c\text{,}$ since a convex function is finite where it is differentiable; an interior minimum of the differentiable $F$ gives&lt;/p&gt;
&lt;table id="A10.Ex236" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F^{\prime}(0)\;=\;\sum_{t\,:\,x_{t}\in B_{c}}\partial_{1}\ell(c,y_{t})\;=\;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;For $c=0\text{,}$ convexity gives each summand a right derivative in $[-\infty,\infty)$ at $0\text{,}$ and the right derivative of the finite sum is the sum of right derivatives; if that sum were negative, $F$ would take values below $F(0)$ arbitrarily close to $0\text{,}$ contradicting minimality. The case $c=1$ is symmetric.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A10.SS1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Convexity enters only through the existence of the one-sided derivatives at the endpoints: the interior identity holds for every loss with $\ell(\cdot,y)$ differentiable on $(0,1)\text{,}$ since $\epsilon=0$ is then an interior minimum of a differentiable function of one variable. &lt;a href="#A10.SS4" title="J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;J.4&lt;/span&gt;&lt;/a&gt; uses the lemma in that form.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS1.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For the squared loss, $\partial_{1}\ell(c,y)=2(c-y)\text{,}$ and &lt;a href="#Thmtheorem50" title="Lemma 50 (Level-Set Stationarity). ‣ J.1 Level-Set Stationarity ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;50&lt;/span&gt;&lt;/a&gt; yields &lt;a href="#Thmtheorem8" title="Lemma 8 (Block Residual). ‣ Recall. ‣ Appendix B Block Residual Property ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt;: at interior levels the identity $\sum_{t:x_{t}\in B_{c}}(c-y_{t})=0$ is immediate; at $c=0$ the right-derivative sum $-2\sum_{t}y_{t}\geq 0$ forces every label on $B_{0}$ to vanish, and at $c=1$ the left-derivative sum $2\sum_{t}(1-y_{t})\leq 0$ forces every label on $B_{1}$ to equal one, so the residual sum vanishes there as well.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem51" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Remark 51&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Subgradient form).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem51.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For a convex loss not differentiable on $(0,1)\text{,}$ the same perturbation yields stationarity in subgradient form: $F$ is convex with an interior minimum at $0\text{,}$ so $0\in\partial F(0)=\sum_{t:x_{t}\in B_{c}}\partial_{1}\ell(c,y_{t})$ for every attained $c\in(0,1)\text{,}$ the subdifferential of a finite sum of finite convex functions being the sum of subdifferentials; the endpoint signs persist unchanged.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A10.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-universal-upper-bound"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;J.2 &lt;/span&gt;The Universal Upper Bound&lt;/h3&gt;
&lt;div id="A10.SS2.p1" class="ltx_para"&gt;
&lt;div id="restatement-Thmtheorem1-Thmtheorem1" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 1&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Universal Upper Bound).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="restatement-Thmtheorem1-Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Fix a finite poset $\mathcal{P}\text{,}$ an integer $T\geq 1\text{,}$ and a loss $\ell$ with $\ell(\cdot,y)$ convex, $\eta$-exp-concave, and $\beta$-smooth on $[0,1]$ for every $y\text{.}$ There exists a deterministic online learner achieving, for every sequence $(x_{t},y_{t})_{t=1}^{T}\in\mathcal{P}\times[0,1]\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="restatement-Thmtheorem1-S2.Ex7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\inf_{K\in\mathbb{N}_{+}}\Bigl\{\,\tfrac{1}{\eta}\,H_{\mathcal{P}}(K)+\tfrac{\beta T}{8K^{2}}\,\Bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For the squared loss, with $(\eta,\beta)=(\tfrac{1}{2},2)\text{,}$ this reads&lt;/span&gt;&lt;/p&gt;
&lt;table id="restatement-Thmtheorem1-S2.E2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\Psi_{\mathcal{P}}(T)\;:=\;\inf_{K\in\mathbb{N}_{+}}\Bigl\{\,2H_{\mathcal{P}}(K)+\frac{T}{4K^{2}}\,\Bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(2)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;and in particular $R_{T}^{*}(\mathcal{P})\leq\Psi_{\mathcal{P}}(T)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A10.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Let $\mathcal{F}_{K}$ be the isotonic $G_{K}$-valued functions, $\log|\mathcal{F}_{K}|=H_{\mathcal{P}}(K)\text{.}$ The learner, knowing $T\text{,}$ fixes $K$ at the minimizer of the stated bound, runs exponential weights over $\mathcal{F}_{K}$ at rate $\eta\text{,}$ and predicts the weighted mean; it is deterministic, and the bound follows from the aggregation and rounding estimates below.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Aggregation.&lt;/em&gt; Let $w_{t}(f):=\exp(-\eta\sum_{s&amp;lt;t}\ell(f(x_{s}),y_{s}))\text{,}$ $W_{t}:=\sum_{f\in\mathcal{F}_{K}}w_{t}(f)\text{,}$ $q_{t}(f):=w_{t}(f)/W_{t}\text{,}$ and $\hat{y}_{t}:=\mathbb{E}_{f\sim q_{t}}[f(x_{t})]\text{.}$ Concavity of $p\mapsto e^{-\eta\ell(p,y_{t})}$ and Jensen’s inequality give&lt;/p&gt;
&lt;table id="A10.Ex237" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$e^{-\eta\,\ell(\hat{y}_{t},y_{t})}\;\geq\;\mathbb{E}_{f\sim q_{t}}\bigl[e^{-\eta\,\ell(f(x_{t}),y_{t})}\bigr]\;=\;\frac{W_{t+1}}{W_{t}},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;so summing $\ell(\hat{y}_{t},y_{t})\leq-\tfrac{1}{\eta}\log(W_{t+1}/W_{t})$ over $t$ and using $W_{T+1}\geq w_{T+1}(\hat{f})=e^{-\eta L_{T}(\hat{f})}$ for any $\hat{f}\in\mathcal{F}_{K}\text{,}$&lt;/p&gt;
&lt;table id="A10.Ex238" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{t=1}^{T}\ell(\hat{y}_{t},y_{t})\;\leq\;L_{T}(\hat{f})+\tfrac{1}{\eta}\log|\mathcal{F}_{K}|\;=\;L_{T}(\hat{f})+\tfrac{1}{\eta}H_{\mathcal{P}}(K).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A10.SS2.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Rounding.&lt;/em&gt; Smoothness makes $\ell(\cdot,y)$ finite and continuous on $[0,1]\text{,}$ so a minimizer $f^{*}$ of $L_{T}$ over the compact $\mathcal{F}_{\mathcal{P}}^{\uparrow}$ exists and &lt;a href="#Thmtheorem50" title="Lemma 50 (Level-Set Stationarity). ‣ J.1 Level-Set Stationarity ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;50&lt;/span&gt;&lt;/a&gt; applies. Let $q$ be nearest-grid rounding onto $G_{K}$ and $\hat{f}:=q\circ f^{*}\in\mathcal{F}_{K}\text{;}$ each offset $\delta_{c}:=q(c)-c$ obeys $|\delta_{c}|\leq\tfrac{1}{2K}\text{,}$ with $\delta_{0}=\delta_{1}=0$ since $0,1\in G_{K}\text{.}$ By the Taylor bound for a loss with $\beta$-Lipschitz derivative, for every $t$ with $x_{t}\in B_{c}\text{,}$&lt;/p&gt;
&lt;table id="A10.Ex239" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\ell(c+\delta_{c},y_{t})-\ell(c,y_{t})\;\leq\;\delta_{c}\,\partial_{1}\ell(c,y_{t})+\tfrac{\beta}{2}\,\delta_{c}^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Summing over $\{t:x_{t}\in B_{c}\}\text{,}$ the first-order term vanishes: at interior levels by &lt;a href="#Thmtheorem50" title="Lemma 50 (Level-Set Stationarity). ‣ J.1 Level-Set Stationarity ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;50&lt;/span&gt;&lt;/a&gt;, and at $c\in\{0,1\}$ because $\delta_{c}=0\text{.}$ Summing over the levels and using $\sum_{c}w_{B_{c}}=T\text{,}$&lt;/p&gt;
&lt;table id="A10.Ex240" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$L_{T}(\hat{f})-L_{T}(f^{*})\;\leq\;\frac{\beta}{2}\sum_{c}w_{B_{c}}\,\delta_{c}^{2}\;\leq\;\frac{\beta\,T}{8K^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A10.SS2.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Combining the two estimates gives $R_{T}\leq\tfrac{1}{\eta}H_{\mathcal{P}}(K)+\tfrac{\beta T}{8K^{2}}$ at the chosen $K\text{,}$ hence at the infimum; the squared loss has $(\eta,\beta)=(\tfrac{1}{2},2)\text{,}$ giving (&lt;a href="#S2.E2" title="Equation 2 ‣ Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;), and a bound achieved by a deterministic learner on every sequence bounds the minimax regret.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A10.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="loss-substitutions-in-the-lower-bounds"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;J.3 &lt;/span&gt;Loss Substitutions in the Lower Bounds&lt;/h3&gt;
&lt;div id="A10.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The lower-bound constructions of &lt;a href="#A11" title="Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;K&lt;/span&gt;&lt;/a&gt; and the chain construction of &lt;a href="#A9" title="Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;I&lt;/span&gt;&lt;/a&gt; are proved for the squared loss. The next lemma is the entire interface between those constructions and the loss class of &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;: strong properness substitutes at the single step of each argument where the loss appears, and one antichain bound covers the short-horizon regime of &lt;a href="#Thmtheorem67" title="Proposition 67 (Height-Two Posets). ‣ K.6 Height-Two Posets ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;67&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem52" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 52&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Loss Substitution).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem52.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $\ell$ satisfy (&lt;a href="#S2.E1" title="Equation 1 ‣ 2.1 Setup ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;) with constant $\alpha&amp;gt;0\text{.}$ Then:&lt;/span&gt;&lt;/p&gt;
&lt;ol id="A10.I1" class="ltx_enumerate"&gt;
&lt;li id="A10.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(a)&lt;/span&gt;
&lt;div id="A10.I1.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;under the hypotheses of &lt;/span&gt;&lt;a href="#Thmtheorem59" title="Lemma 59 (Rank-Level Lower Bound). ‣ K.1 The Two Mechanisms in General Form ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref ltx_font_italic"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;59&lt;/span&gt;&lt;/a&gt;&lt;span class="ltx_text ltx_font_italic"&gt;,
&lt;/span&gt;$R_{T}^{*}(\mathcal{P},\ell)\geq\alpha\,\frac{1-\sqrt{2/3}}{16}\min\{N_{0}K,\,T/K^{2}\}$&lt;span class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A10.I1.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(b)&lt;/span&gt;
&lt;div id="A10.I1.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;under the hypotheses of &lt;/span&gt;&lt;a href="#Thmtheorem60" title="Lemma 60 (Separated-Core Lower Bound). ‣ K.1 The Two Mechanisms in General Form ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref ltx_font_italic"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;60&lt;/span&gt;&lt;/a&gt;&lt;span class="ltx_text ltx_font_italic"&gt;, for &lt;/span&gt;$T\geq n$&lt;span class="ltx_text ltx_font_italic"&gt;,
&lt;/span&gt;$R_{T}^{*}(\mathcal{P},\ell)\geq\frac{3\alpha}{16}\,n\log\bigl(1+\frac{4T\varepsilon^{2}}{15n}\bigr)$&lt;span class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A10.I1.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(c)&lt;/span&gt;
&lt;div id="A10.I1.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;if &lt;/span&gt;$W\subseteq\mathcal{P}$&lt;span class="ltx_text ltx_font_italic"&gt; is an antichain such that every &lt;/span&gt;$\{\tfrac{1}{4},\tfrac{3}{4}\}$&lt;span class="ltx_text ltx_font_italic"&gt;-valued map on &lt;/span&gt;$W$&lt;span class="ltx_text ltx_font_italic"&gt; extends to a member of &lt;/span&gt;$\mathcal{F}_{\mathcal{P}}^{\uparrow}$&lt;span class="ltx_text ltx_font_italic"&gt;, then &lt;/span&gt;$R_{T}^{*}(\mathcal{P},\ell)\geq\frac{\alpha}{16}\min\{T,\,|W|\}$&lt;span class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A10.I1.i4" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(d)&lt;/span&gt;
&lt;div id="A10.I1.i4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;on the chain, if &lt;/span&gt;$\ell$&lt;span class="ltx_text ltx_font_italic"&gt; is in addition curved or the entropic loss, &lt;/span&gt;$R_{T}^{*}([n],\ell)=\Theta\bigl(\min\{T,\,\Psi_{[n]}(T)\}\bigr)$&lt;span class="ltx_text ltx_font_italic"&gt; for all &lt;/span&gt;$n,T\geq 1$&lt;span class="ltx_text ltx_font_italic"&gt;, with implied constants depending only on the loss parameters.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;The entropic loss satisfies (&lt;a href="#S2.E1" title="Equation 1 ‣ 2.1 Setup ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;) with $\alpha=2\text{,}$ so &lt;/span&gt;(a)&lt;span class="ltx_text ltx_font_italic"&gt; through &lt;/span&gt;(d)&lt;span class="ltx_text ltx_font_italic"&gt; apply to it.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A10.SS3.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;(a) and (b).&lt;/em&gt; In each of the two proofs, the loss enters at exactly one step, the reduction of regret to estimation error, and every later step concerns the Bernoulli observation law alone. In the proof of &lt;a href="#Thmtheorem59" title="Lemma 59 (Rank-Level Lower Bound). ‣ K.1 The Two Mechanisms in General Form ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;59&lt;/span&gt;&lt;/a&gt;, the adversary plays $f_{\theta}\in\mathcal{F}_{\mathcal{P}}^{\uparrow}$ with values in $[\tfrac{1}{4},\tfrac{3}{4}]$ and Bernoulli labels; for any loss, $R_{T}\geq\sum_{t}[\ell(\hat{y}_{t},Y_{t})-\ell(f_{\theta}(x_{t}),Y_{t})]\text{,}$ and conditionally on $\theta$ and the past, $Y_{t}\sim\mathrm{Ber}(f_{\theta}(x_{t}))$ with $\hat{y}_{t}$ measurable, so (&lt;a href="#S2.E1" title="Equation 1 ‣ 2.1 Setup ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;) with $p=f_{\theta}(x_{t})\in[\tfrac{1}{4},\tfrac{3}{4}]$ gives&lt;/p&gt;
&lt;table id="A10.Ex241" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[R_{T}]\;\geq\;\alpha\sum_{t}\mathbb{E}\bigl[(\hat{y}_{t}-f_{\theta}(x_{t}))^{2}\bigr].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The right-hand sum is the quantity the remainder of that proof bounds from below, so the conclusion holds with the extra factor $\alpha\text{.}$ The same substitution applies in the proof of &lt;a href="#Thmtheorem60" title="Lemma 60 (Separated-Core Lower Bound). ‣ K.1 The Two Mechanisms in General Form ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;60&lt;/span&gt;&lt;/a&gt;, whose adversary plays $P\in\mathcal{F}_{\mathcal{P}}^{\uparrow}$ with values in $[\tfrac{1}{4},\tfrac{3}{4}]\text{:}$ the regret-to-estimation step, Step A of &lt;a href="#A5.SS2" title="E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;E.2&lt;/span&gt;&lt;/a&gt;, is replaced by the display above, and the remaining steps bound the estimation sum alone.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS3.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;(c).&lt;/em&gt; Assume $W\neq\varnothing\text{,}$ the claim being trivial otherwise. Sample $\sigma_{a}\in\{\tfrac{1}{4},\tfrac{3}{4}\}$ uniformly and independently for $a\in W\text{,}$ and let $f_{\sigma}\in\mathcal{F}_{\mathcal{P}}^{\uparrow}$ extend $\sigma\text{.}$ The adversary queries $s:=\min\{T,|W|\}$ distinct points $a_{1},\ldots,a_{s}$ of $W$ once each, then queries $a_{1}$ for the remaining rounds; all labels are $Y_{t}\sim\mathrm{Ber}(f_{\sigma}(x_{t}))\text{,}$ drawn independently, and every queried value is $\sigma_{a_{t}}\in\{\tfrac{1}{4},\tfrac{3}{4}\}\text{.}$ Since $f_{\sigma}\in\mathcal{F}_{\mathcal{P}}^{\uparrow}\text{,}$ the display above applies and the terms with $t&amp;gt;s$ are nonnegative, so&lt;/p&gt;
&lt;table id="A10.Ex242" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[R_{T}]\;\geq\;\alpha\sum_{t=1}^{s}\mathbb{E}\bigl[(\hat{y}_{t}-\sigma_{a_{t}})^{2}\bigr].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;At round $t\leq s$ the point $a_{t}$ has not been queried before, and the earlier labels are generated from the values of $\sigma$ at other points, so $\hat{y}_{t}$ is independent of $\sigma_{a_{t}}\text{;}$ hence $\mathbb{E}[(\hat{y}_{t}-\sigma_{a_{t}})^{2}]\geq\mathrm{Var}(\sigma_{a_{t}})=\tfrac{1}{16}\text{.}$ Summing and applying Yao’s principle gives the claim.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS3.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;(d).&lt;/em&gt; The upper bound is &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; or &lt;a href="#Thmtheorem55" title="Theorem 55 (Entropic Upper Bound). ‣ J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;55&lt;/span&gt;&lt;/a&gt; with $R_{T}\leq\Lambda T\text{,}$ respectively $R_{T}\leq T\log 2\text{,}$ and the homogeneity comparison of &lt;a href="#S2.SS3" title="2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt;. For the lower bound, the noisy-bisection adversary of &lt;a href="#A9" title="Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;I&lt;/span&gt;&lt;/a&gt; plays a comparator with values in $(\tfrac{1}{4},\tfrac{3}{4})$ and Bernoulli labels, and the loss enters its analysis only through the reduction of regret to the estimation sums of the stagewise Bayes bounds; the display of (a) performs that reduction for any loss satisfying (&lt;a href="#S2.E1" title="Equation 1 ‣ 2.1 Setup ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;), at the cost of the factor $\alpha\text{,}$ and every later step of that appendix concerns the observation law alone. Its deep-horizon branch specializes the interior-cube construction to one dimension and is the case (b), and its constant-size range follows from (c) with a single-point antichain. The synthesis of &lt;a href="#A9" title="Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;I&lt;/span&gt;&lt;/a&gt;, which assembles the stagewise bounds into $\min\{T,\Psi_{[n]}(T)\}\text{,}$ is a computation about $\Psi_{[n]}$ and is untouched.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS3.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Entropic loss.&lt;/em&gt; For $p,q\in(0,1)\text{,}$ expanding both expectations gives&lt;/p&gt;
&lt;table id="A10.Ex243" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}_{Y\sim\mathrm{Ber}(p)}\bigl[\ell_{\log}(q,Y)-\ell_{\log}(p,Y)\bigr]\;=\;p\log\tfrac{p}{q}+(1-p)\log\tfrac{1-p}{1-q}\;=\;\mathrm{kl}(p\,\|\,q),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and Pinsker’s inequality in its binary form &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[Tsybakov, &lt;a href="#bib.bib14" title="Introduction to nonparametric estimation" class="ltx_ref"&gt;2009&lt;/a&gt;]&lt;/cite&gt; gives $\mathrm{kl}(p\,\|\,q)\geq 2(p-q)^{2}\text{;}$ the case $q\in\{0,1\}$ has infinite left side. So (&lt;a href="#S2.E1" title="Equation 1 ‣ 2.1 Setup ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;) holds with $\alpha=2\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A10.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-entropic-loss"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;J.4 &lt;/span&gt;The Entropic Loss&lt;/h3&gt;
&lt;div id="A10.SS4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The upper bound for the entropic loss rests on two lemmas: an exact Bregman form of the block identity, and a nonuniform quantizer whose Kullback–Leibler covering radius is quadratic in the resolution. We state the first for a general Bregman loss, since the mechanism does not depend on the entropy function.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem53" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 53&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Bregman Block Identity).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem53.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $\phi$ be convex and continuous on $[0,1]$ and twice differentiable on $(0,1)$ with $\phi^{\prime\prime}&amp;gt;0\text{,}$ let&lt;/span&gt;&lt;/p&gt;
&lt;table id="A10.Ex244" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\ell_{\phi}(p,y)\;:=\;D_{\phi}(y\,\|\,p)\;:=\;\phi(y)-\phi(p)-\phi^{\prime}(p)(y-p)\qquad(p\in(0,1)),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;extended to $p\in\{0,1\}$ by its limits with values in $[0,+\infty]\text{,}$ and let $f^{*}$ minimize $L_{T}(f)=\sum_{t}\ell_{\phi}(f(x_{t}),y_{t})$ over $\mathcal{F}_{\mathcal{P}}^{\uparrow}$ with $L_{T}(f^{*})&amp;lt;\infty\text{.}$ Then for every value $c$ attained by $f^{*}\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A10.E112" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{t\,:\,x_{t}\in B_{c}}(y_{t}-c)\;=\;0,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(111)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;and for every $z\in(0,1)\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A10.E113" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{t\,:\,x_{t}\in B_{c}}\bigl[\ell_{\phi}(z,y_{t})-\ell_{\phi}(c,y_{t})\bigr]\;=\;w_{B_{c}}\,D_{\phi}(c\,\|\,z).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(112)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A10.SS4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;On $(0,1)\text{,}$ $\partial_{1}\ell_{\phi}(p,y)=-\phi^{\prime\prime}(p)(y-p)\text{.}$ For $c\in(0,1)\text{,}$ the interior identity of &lt;a href="#Thmtheorem50" title="Lemma 50 (Level-Set Stationarity). ‣ J.1 Level-Set Stationarity ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;50&lt;/span&gt;&lt;/a&gt;, which requires only differentiability on $(0,1)$ by the remark following its proof, gives $\phi^{\prime\prime}(c)\sum_{t:x_{t}\in B_{c}}(y_{t}-c)=0\text{,}$ and $\phi^{\prime\prime}(c)&amp;gt;0$ yields (&lt;a href="#A10.E112" title="Equation 111 ‣ Lemma 53 (Bregman Block Identity). ‣ J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;111&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Let now $c=0$ and $F(\epsilon):=\sum_{t:x_{t}\in B_{0}}\ell_{\phi}(\epsilon,y_{t})\text{,}$ which the perturbation in the proof of &lt;a href="#Thmtheorem50" title="Lemma 50 (Level-Set Stationarity). ‣ J.1 Level-Set Stationarity ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;50&lt;/span&gt;&lt;/a&gt; shows is minimized over $[0,\epsilon_{0}]$ at $\epsilon=0\text{;}$ moreover $F(0)\leq L_{T}(f^{*})&amp;lt;\infty\text{,}$ and $F$ is right-continuous at $0\text{,}$ its finitely many summands being defined as limits. On $(0,\epsilon_{0})\text{,}$ $F^{\prime}(\epsilon)=-\phi^{\prime\prime}(\epsilon)\sum_{t}(y_{t}-\epsilon)\text{.}$ If $\sum_{t}y_{t}&amp;gt;0\text{,}$ then $F^{\prime}&amp;lt;0$ on a right neighborhood of $0\text{,}$ so $F$ is strictly decreasing there, and right-continuity places values of $F$ strictly below $F(0)\text{,}$ contradicting minimality. Hence $\sum_{t}y_{t}\leq 0\text{,}$ and $y_{t}\geq 0$ forces every label on $B_{0}$ to vanish, so (&lt;a href="#A10.E112" title="Equation 111 ‣ Lemma 53 (Bregman Block Identity). ‣ J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;111&lt;/span&gt;&lt;/a&gt;) holds at $c=0$ with both sides zero; the case $c=1$ is symmetric.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS4.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For (&lt;a href="#A10.E113" title="Equation 112 ‣ Lemma 53 (Bregman Block Identity). ‣ J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;112&lt;/span&gt;&lt;/a&gt;) with $c\in(0,1)\text{,}$ expanding the four defining terms verifies&lt;/p&gt;
&lt;table id="A10.Ex245" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$D_{\phi}(y\,\|\,z)-D_{\phi}(y\,\|\,c)\;=\;D_{\phi}(c\,\|\,z)+\bigl(\phi^{\prime}(c)-\phi^{\prime}(z)\bigr)(y-c),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and summing over $\{t:x_{t}\in B_{c}\}$ kills the second term by (&lt;a href="#A10.E112" title="Equation 111 ‣ Lemma 53 (Bregman Block Identity). ‣ J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;111&lt;/span&gt;&lt;/a&gt;). At $c\in\{0,1\}$ every label on $B_{c}$ equals $c\text{,}$ so each summand is $\ell_{\phi}(z,c)-\ell_{\phi}(c,c)=D_{\phi}(c\,\|\,z)\text{,}$ using $\ell_{\phi}(c,c)=0\text{:}$ for $c=0\text{,}$ say, $\ell_{\phi}(0,0)=\lim_{p\downarrow 0}[\phi(0)-\phi(p)+p\,\phi^{\prime}(p)]=0\text{,}$ since continuity handles the first two terms and convexity traps $p\phi^{\prime}(p)$ between $2[\phi(p)-\phi(p/2)]$ and $\phi(2p)-\phi(p)\text{,}$ both of which vanish.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem54" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 54&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Arcsine Quantizer).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem54.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For $K\geq 1$ put $h:=\tfrac{\pi}{4(K+1)}$ and $Z_{K}:=\{\sin^{2}((2k{+}1)h):k=0,1,\ldots,K\}\subset(0,1)\text{.}$ Define $q_{K}:[0,1]\to Z_{K}$ by $q_{K}(c):=\sin^{2}((2k(\theta)+1)h)\text{,}$ where $c=\sin^{2}\theta$ with $\theta\in[0,\pi/2]$ and $k(\theta)$ indexes the cell $(2kh,\,2(k{+}1)h]$ containing $\theta\text{,}$ the cell $k=0$ being closed at the origin. Then $q_{K}$ is nondecreasing and&lt;/span&gt;&lt;/p&gt;
&lt;table id="A10.Ex246" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sup_{c\in[0,1]}\,\mathrm{kl}\bigl(c\,\|\,q_{K}(c)\bigr)\;\leq\;\frac{9\pi^{4}}{64\,(K+1)^{2}}\;&amp;lt;\;\frac{14}{K^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A10.SS4.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The $K+1$ cells of length $2h$ partition $[0,\pi/2]\text{,}$ and $\bar{\theta}:=(2k(\theta)+1)h$ is the midpoint of the cell of $\theta\text{,}$ so $|\theta-\bar{\theta}|\leq h\text{;}$ the cell index is nondecreasing in $\theta$ and $\sin^{2}$ increases on $[0,\pi/2]\text{,}$ so $q_{K}$ is nondecreasing.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS4.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Suppose first $\theta\leq\pi/4\text{.}$ Since $\pi/4=(K{+}1)h\text{,}$ the index satisfies $2k(\theta)+1\leq K+1\text{,}$ so $h\leq\bar{\theta}\leq\pi/4$ and $\theta\leq\bar{\theta}+h\leq 2\bar{\theta}\text{.}$ Write $z:=\sin^{2}\bar{\theta}\text{.}$ Using $c-z=\sin(\theta+\bar{\theta})\sin(\theta-\bar{\theta})$ and $z(1-z)=\tfrac{1}{4}\sin^{2}(2\bar{\theta})\text{,}$&lt;/p&gt;
&lt;table id="A10.Ex247" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathrm{kl}(c\,\|\,z)\;\leq\;\chi^{2}(c\,\|\,z)\;=\;\frac{(c-z)^{2}}{z(1-z)}\;=\;\frac{4\sin^{2}(\theta+\bar{\theta})\,\sin^{2}(\theta-\bar{\theta})}{\sin^{2}(2\bar{\theta})},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;the first inequality being standard &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[Tsybakov, &lt;a href="#bib.bib14" title="Introduction to nonparametric estimation" class="ltx_ref"&gt;2009&lt;/a&gt;]&lt;/cite&gt;. Bounding $\sin(\theta+\bar{\theta})\leq\theta+\bar{\theta}\leq 3\bar{\theta}\text{,}$ $|\sin(\theta-\bar{\theta})|\leq h\text{,}$ and $\sin(2\bar{\theta})\geq\tfrac{2}{\pi}\,(2\bar{\theta})\text{,}$ the last valid because $2\bar{\theta}\leq\pi/2\text{,}$ gives $\mathrm{kl}(c\,\|\,z)\leq\tfrac{9}{4}\pi^{2}h^{2}=9\pi^{4}/(64(K{+}1)^{2})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS4.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;If instead $\theta&amp;gt;\pi/4\text{,}$ then $2k(\theta)+1\geq K+1\text{,}$ so $\pi/4\leq\bar{\theta}\leq\pi/2-h\text{.}$ Setting $\theta^{\prime}:=\pi/2-\theta$ and $\bar{\theta}^{\prime}:=\pi/2-\bar{\theta}\text{,}$ the pair $(\theta^{\prime},\bar{\theta}^{\prime})$ satisfies $|\theta^{\prime}-\bar{\theta}^{\prime}|\leq h$ and $h\leq\bar{\theta}^{\prime}\leq\pi/4\text{,}$ hence $\theta^{\prime}\leq 2\bar{\theta}^{\prime}\text{,}$ and $\mathrm{kl}(c\,\|\,z)=\mathrm{kl}(1-c\,\|\,1-z)$ with $1-c=\sin^{2}\theta^{\prime}\text{,}$ $1-z=\sin^{2}\bar{\theta}^{\prime}\text{,}$ so the same computation applies. Finally $9\pi^{4}/64&amp;lt;14$ and $(K+1)^{2}&amp;gt;K^{2}\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem55" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 55&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Entropic Upper Bound).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem55.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For every finite poset $\mathcal{P}$ and every integer $T\geq 1\text{,}$ there exists a deterministic online learner achieving, under $\ell_{\log}$ and for every sequence $(x_{t},y_{t})_{t=1}^{T}\in\mathcal{P}\times[0,1]\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A10.Ex248" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\inf_{K\in\mathbb{N}_{+}}\Bigl\{\,H_{\mathcal{P}}(K)+\frac{14\,T}{K^{2}}\,\Bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A10.SS4.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The arcsine levels are $\sin^{2}\bigl(\tfrac{(2k+1)\pi}{4(K+1)}\bigr)\text{,}$ $k=0,\ldots,K\text{,}$ which &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Kotłowski&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt; [&lt;a href="#bib.bib2" title="Online isotonic regression" class="ltx_ref"&gt;2016&lt;/a&gt;, Section 7.1]&lt;/cite&gt; use on the chain and attribute to de Rooij and van Erven; $\mathrm{kl}(a\,\|\,b):=a\log\tfrac{a}{b}+(1-a)\log\tfrac{1-a}{1-b}$ is the binary Kullback–Leibler divergence, and $w_{B_{c}}$ counts the rounds whose queries lie in the level set $B_{c}\text{.}$ The matching lower bound, for $\ell_{\log}$ and for the whole curved class, is part of the characterization (&lt;a href="#A11" title="Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;K&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A10.SS4.p9" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Fix $K\text{.}$ The learner runs exponential weights at rate $1$ over the isotonic maps into $Z_{K}\text{,}$ of which there are $\Omega(\mathcal{P},K{+}1)\text{,}$ and predicts the weighted mean, which lies in $[\min Z_{K},\max Z_{K}]\subset(0,1)\text{,}$ so its losses are finite.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS4.p10" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Aggregation.&lt;/em&gt; The entropic loss is $1$-exp-concave: for $y\in\{0,1\}$ the map $g(p):=e^{-\ell_{\log}(p,y)}=p^{y}(1-p)^{1-y}$ is affine, and for $y\in(0,1)\text{,}$ writing $A:=y/p$ and $B:=(1-y)/(1-p)\text{,}$ one has $(\log g)^{\prime}=A-B$ and $(\log g)^{\prime\prime}=-A^{2}/y-B^{2}/(1-y)\text{,}$ so&lt;/p&gt;
&lt;table id="A10.Ex249" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{g^{\prime\prime}}{g}\;=\;(\log g)^{\prime\prime}+\bigl((\log g)^{\prime}\bigr)^{2}\;=\;(A-B)^{2}-\frac{A^{2}}{y}-\frac{B^{2}}{1-y}\;\leq\;0$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;by the Cauchy–Schwarz inequality $(A-B)^{2}\leq(y+(1-y))(A^{2}/y+B^{2}/(1-y))\text{.}$ The aggregation estimate in the proof of &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; therefore applies at rate $\eta=1$ and costs $H_{\mathcal{P}}(K)$ against the best isotonic $Z_{K}$-valued map.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS4.p11" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Rounding.&lt;/em&gt; With the endpoint values supplied by limits, $\ell_{\log}(\cdot,y)$ is continuous as a $[0,\infty]$-valued function of the prediction, so $L_{T}$ attains its minimum on the compact $\mathcal{F}_{\mathcal{P}}^{\uparrow}\text{;}$ and the constant function $\tfrac{1}{2}\text{,}$ isotonic with $\ell_{\log}(\tfrac{1}{2},y)=\log 2$ for every $y\text{,}$ shows the minimum is at most $T\log 2\text{,}$ so a minimizer $f^{*}$ with finite loss exists. With $\phi(u):=u\log u+(1-u)\log(1-u)\text{,}$ the negative binary entropy, one has $D_{\phi}(y\,\|\,p)=\mathrm{kl}(y\,\|\,p)=\ell_{\log}(p,y)+\phi(y)\text{,}$ and $\phi(y)$ does not depend on the prediction, so $\ell_{\log}$ and $\ell_{\phi}$ have identical regret and identical minimizers. Set $\hat{f}:=q_{K}\circ f^{*}\text{,}$ isotonic and $Z_{K}$-valued by &lt;a href="#Thmtheorem54" title="Lemma 54 (Arcsine Quantizer). ‣ J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;54&lt;/span&gt;&lt;/a&gt;. Applying &lt;a href="#Thmtheorem53" title="Lemma 53 (Bregman Block Identity). ‣ J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;53&lt;/span&gt;&lt;/a&gt; blockwise with $z=q_{K}(c)$ and then &lt;a href="#Thmtheorem54" title="Lemma 54 (Arcsine Quantizer). ‣ J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;54&lt;/span&gt;&lt;/a&gt;,&lt;/p&gt;
&lt;table id="A10.Ex250" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$L_{T}(\hat{f})-L_{T}(f^{*})\;=\;\sum_{c}w_{B_{c}}\,\mathrm{kl}\bigl(c\,\|\,q_{K}(c)\bigr)\;\leq\;\frac{14\,T}{K^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Combining the two estimates and taking the infimum over $K$ gives the theorem.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A10.SS5" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="lipschitz-losses"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;J.5 &lt;/span&gt;Lipschitz Losses&lt;/h3&gt;
&lt;div id="A10.SS5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This subsection proves &lt;a href="#Thmtheorem56" title="Theorem 56 (Pinball and Absolute Losses on Grids). ‣ J.5 Lipschitz Losses ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;56&lt;/span&gt;&lt;/a&gt; and completes the one-point separation stated in &lt;a href="#S4" title="4 The Lipschitz Boundary ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;. The two bounds behind the theorem hold on every finite poset in explicit form; the grid enters only at the end, through its rank levels.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem56" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 56&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Pinball and Absolute Losses on Grids).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem56.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Fix an integer $d\geq 2\text{.}$ For all $\tau\in(0,1)$ and all integers $m\geq 2$ and $T\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A10.Ex251" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}\bigl([m]^{d},\ell_{\tau}\bigr)\;=\;\Theta_{d}\Bigl(\min\bigl\{\rho_{\tau}T,\;\sqrt{\rho_{\tau}\,m^{d-1}\,T}\bigr\}\Bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;with implied constants depending only on $d\text{;}$ in particular $R_{T}^{*}([m]^{d},\lvert\cdot\rvert)=\Theta_{d}\bigl(\min\{T,\sqrt{m^{d-1}T}\}\bigr)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A10.SS5.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We establish two bounds on an arbitrary finite poset $\mathcal{P}\text{:}$ a deterministic learner achieves, on every sequence,&lt;/p&gt;
&lt;table id="A10.E114" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\min\Bigl\{\rho_{\tau}T,\;2\sqrt{2\,\rho_{\tau}T\,H_{\mathcal{P}}(1)}\Bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(113)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and, whenever $\mathcal{P}$ contains an antichain of size $N_{0}\text{,}$&lt;/p&gt;
&lt;table id="A10.E115" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}(\mathcal{P},\ell_{\tau})\;\geq\;\frac{e^{-4}}{4}\,\min\Bigl\{\rho_{\tau}T,\;\sqrt{\rho_{\tau}\,N_{0}\,T}\Bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(114)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A10.SS5.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Upper bound.&lt;/em&gt; Two strategies realize the two entries of (&lt;a href="#A10.E114" title="Equation 113 ‣ J.5 Lipschitz Losses ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;113&lt;/span&gt;&lt;/a&gt;); comparing $\rho_{\tau}T$ with $8H_{\mathcal{P}}(1)$ selects the smaller, since $2\sqrt{2\rho_{\tau}TH_{\mathcal{P}}(1)}\leq\rho_{\tau}T$ exactly when $8H_{\mathcal{P}}(1)\leq\rho_{\tau}T\text{.}$ The constant strategy predicts $\hat{y}_{t}\equiv\tau\text{:}$ its per-round loss satisfies $\ell_{\tau}(\tau,y)\leq\rho_{\tau}$ for every $y\in[0,1]\text{,}$ the two branches of the loss contributing at most $\tau(1-\tau)$ and $(1-\tau)\tau\text{,}$ and the comparator loss is nonnegative, so $R_{T}\leq\rho_{\tau}T\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS5.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For the aggregation strategy, suppose $\rho_{\tau}T\geq 8H_{\mathcal{P}}(1)$ and recall that the $G_{1}$-valued isotonic functions are exactly the indicators of upsets, so their number is $e^{H_{\mathcal{P}}(1)}\text{.}$ The learner runs exponential weights over the experts $\{\mathbf{1}\!\left[\cdot\in U\right]:U\in\mathcal{U}(\mathcal{P})\}$ at rate $\eta:=\sqrt{2H_{\mathcal{P}}(1)/(\rho_{\tau}T)}\leq\tfrac{1}{2}$ and predicts the marginal $p_{t}:=\Pr_{U\sim q_{t}}[x_{t}\in U]$ under the current weight distribution $q_{t}\text{;}$ the losses driving the weights are specified below. For any subgradient $g_{t}\in\partial_{1}\ell_{\tau}(p_{t},y_{t})\subseteq[-\tau,1-\tau]\text{,}$ convexity gives, for every $f\in\mathcal{F}_{\mathcal{P}}^{\uparrow}\text{,}$&lt;/p&gt;
&lt;table id="A10.Ex252" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{t=1}^{T}\bigl[\ell_{\tau}(p_{t},y_{t})-\ell_{\tau}(f(x_{t}),y_{t})\bigr]\;\leq\;\sum_{t=1}^{T}g_{t}\bigl(p_{t}-f(x_{t})\bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and the layer-cake identity $f(x)=\int_{0}^{1}\mathbf{1}\!\left[x\in\{f\geq s\}\right]\,ds\text{,}$ whose level sets $\{f\geq s\}$ are upsets, expresses the right side as an average over $s$ of linearized regrets against single upsets:&lt;/p&gt;
&lt;table id="A10.Ex253" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{t}g_{t}\bigl(p_{t}-f(x_{t})\bigr)\;=\;\int_{0}^{1}\sum_{t}g_{t}\bigl(p_{t}-\mathbf{1}\!\left[x_{t}\in\{f\geq s\}\right]\bigr)\,ds\;\leq\;\max_{U\in\mathcal{U}(\mathcal{P})}\,\sum_{t}g_{t}\bigl(p_{t}-\mathbf{1}\!\left[x_{t}\in U\right]\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Shift the linearized losses to $v_{t,U}:=g_{t}\,\mathbf{1}\!\left[x_{t}\in U\right]-\min\{0,g_{t}\}\in[0,1]\text{:}$ the shift preserves every difference between experts, and the learner’s mean shifted loss $\mathbb{E}_{U\sim q_{t}}[v_{t,U}]=g_{t}\,p_{t}-\min\{0,g_{t}\}$ is the shift of $g_{t}p_{t}\text{,}$ so with $V_{U}:=\sum_{t}v_{t,U}$ and $\widehat{V}:=\sum_{t}\mathbb{E}_{q_{t}}[v_{t,U}]$ the maximum above equals $\widehat{V}-\min_{U}V_{U}\text{.}$ The weights are the exponential weights of the shifted losses, $w_{t+1}(U):=w_{t}(U)\,e^{-\eta v_{t,U}}$ with $w_{1}\equiv 1\text{,}$ the same posterior as under $g_{t}\mathbf{1}\!\left[x_{t}\in U\right]\text{;}$ the small-loss estimate for losses in $[0,1]$ &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[Cesa-Bianchi and Lugosi, &lt;a href="#bib.bib1" title="Prediction, learning, and games" class="ltx_ref"&gt;2006&lt;/a&gt;]&lt;/cite&gt; then applies. Convexity gives $e^{-\eta v}\leq 1-(1-e^{-\eta})v$ on $[0,1]\text{,}$ so $\log(W_{t+1}/W_{t})\leq-(1-e^{-\eta})\,\mathbb{E}_{q_{t}}[v_{t,U}]\text{;}$ telescoping against $W_{T+1}\geq e^{-\eta V_{U}}\text{,}$ with $\log W_{1}=H_{\mathcal{P}}(1)\text{,}$ and using $1-e^{-\eta}\geq\eta/2$ and $\eta\leq(1+\eta)(1-e^{-\eta})$ for $\eta\in(0,1]\text{,}$&lt;/p&gt;
&lt;table id="A10.Ex254" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widehat{V}-\min_{U}V_{U}\;\leq\;\eta\,\min_{U}V_{U}+\frac{2}{\eta}\,H_{\mathcal{P}}(1).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The empty and full upsets bound the best expert: $v_{t,\varnothing}=(-g_{t})_{+}\leq\tau\,\mathbf{1}\!\left[g_{t}&amp;lt;0\right]$ and $v_{t,\mathcal{P}}=(g_{t})_{+}\leq(1-\tau)\,\mathbf{1}\!\left[g_{t}\geq 0\right]\text{,}$ so with $n_{-}$ and $n_{+}$ counting the rounds of either sign,&lt;/p&gt;
&lt;table id="A10.Ex255" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\min_{U}V_{U}\;\leq\;\min\bigl\{\tau n_{-},\;(1-\tau)\,n_{+}\bigr\}\;\leq\;\rho_{\tau}T,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;the last step because the middle expression, under $n_{-}+n_{+}\leq T\text{,}$ is maximized at $\tau n_{-}=(1-\tau)n_{+}\text{.}$ Combining the displays above and evaluating at the chosen $\eta\text{,}$&lt;/p&gt;
&lt;table id="A10.Ex256" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\eta\,\rho_{\tau}T+\frac{2}{\eta}\,H_{\mathcal{P}}(1)\;=\;2\sqrt{2\,\rho_{\tau}T\,H_{\mathcal{P}}(1)}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A10.SS5.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Lower bound.&lt;/em&gt; Let $A\subseteq\mathcal{P}$ be an antichain of size $N_{0}\text{.}$ Any $\{0,1\}$-valued assignment on $A$ extends to a member of $\mathcal{F}_{\mathcal{P}}^{\uparrow}\text{:}$ give each $x$ the largest value assigned on $\{a\in A:a\preceq x\}\text{,}$ with default $0\text{;}$ the extension is isotonic, and on the antichain $A$ it returns the assignment itself. The comparator may therefore choose an endpoint at each point of $A$ independently. The adversary draws every label independently from $\mathrm{Ber}(1-\tau)\text{,}$ a bias at which the pinball Bayes risk is flat:&lt;/p&gt;
&lt;table id="A10.Ex257" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}_{Y\sim\mathrm{Ber}(1-\tau)}\,\ell_{\tau}(p,Y)\;=\;(1-\tau)\cdot\tau(1-p)+\tau\cdot(1-\tau)\,p\;=\;\rho_{\tau}\qquad\text{for every }p\in[0,1],$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;so every learner’s conditional expected loss is $\rho_{\tau}$ at every round, for a total of $\rho_{\tau}T\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS5.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;If $T&amp;lt;N_{0}\text{,}$ the adversary queries $T$ distinct points of $A$ once each. A single label $y\in\{0,1\}$ at a point is matched by the endpoint $y$ itself at zero cost, so the extension of the pointwise optimal endpoints has zero loss, and $\mathbb{E}[R_{T}]=\rho_{\tau}T\text{.}$ If $T\geq N_{0}\text{,}$ the adversary spreads the $T$ rounds over $A$ as evenly as possible, querying the $i$-th point for $n_{i}\geq\lfloor T/N_{0}\rfloor\geq T/(2N_{0})$ consecutive rounds. With $S_{i}\sim\mathrm{Bin}(n_{i},1-\tau)$ the number of ones observed there, the two endpoint costs at that point are $\tau S_{i}$ and $(1-\tau)(n_{i}-S_{i})\text{,}$ each of mean $\rho_{\tau}n_{i}$ and with difference $S_{i}-(1-\tau)n_{i}\text{,}$ so $\min\{u,v\}=\tfrac{u+v}{2}-\tfrac{|u-v|}{2}$ gives&lt;/p&gt;
&lt;table id="A10.Ex258" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[R_{T}]\;\geq\;\frac{1}{2}\sum_{i=1}^{N_{0}}\mathbb{E}\bigl|S_{i}-(1-\tau)\,n_{i}\bigr|.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;For $S\sim\mathrm{Bin}(n,\theta)\text{,}$ write $\bar{S}:=S-n\theta$ and $\sigma^{2}:=n\theta(1-\theta)\text{.}$ If $\sigma^{2}\geq 1\text{,}$ Hölder’s inequality $\mathbb{E}\bar{S}^{2}\leq(\mathbb{E}|\bar{S}|)^{2/3}(\mathbb{E}\bar{S}^{4})^{1/3}$ and the fourth-moment bound $\mathbb{E}\bar{S}^{4}\leq 3\sigma^{4}+\sigma^{2}\leq 4\sigma^{4}$ give $\mathbb{E}|\bar{S}|\geq\sigma/2\text{.}$ If $\sigma^{2}&amp;lt;1$ and $\theta\leq\tfrac{1}{2}\text{,}$ then $n\theta\leq 2\sigma^{2}&amp;lt;2\text{,}$ so $\Pr(S=0)=(1-\theta)^{n}\geq e^{-2n\theta}\geq e^{-4}\text{,}$ using $\log(1-\theta)\geq-2\theta$ on $[0,\tfrac{1}{2}]\text{,}$ and $\mathbb{E}|\bar{S}|\geq e^{-4}\,n\theta\geq e^{-4}\sigma^{2}\text{;}$ the case $\theta&amp;gt;\tfrac{1}{2}$ follows by exchanging $S$ with $n-S\text{.}$ In all cases $\mathbb{E}|\bar{S}|\geq e^{-4}\min\{\sigma,\sigma^{2}\}\text{;}$ since $\sigma_{i}^{2}=\rho_{\tau}n_{i}\geq\rho_{\tau}T/(2N_{0})$ and $u\mapsto\min\{\sqrt{u},u\}$ is nondecreasing,&lt;/p&gt;
&lt;table id="A10.Ex259" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[R_{T}]\;\geq\;\frac{N_{0}\,e^{-4}}{2}\min\biggl\{\sqrt{\frac{\rho_{\tau}T}{2N_{0}}},\;\frac{\rho_{\tau}T}{2N_{0}}\biggr\}\;\geq\;\frac{e^{-4}}{4}\min\Bigl\{\sqrt{\rho_{\tau}N_{0}T},\;\rho_{\tau}T\Bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Yao’s principle converts the Bayesian bound into (&lt;a href="#A10.E115" title="Equation 114 ‣ J.5 Lipschitz Losses ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;114&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS5.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Grids.&lt;/em&gt; On $[m]^{d}\text{,}$ &lt;a href="#Thmtheorem61" title="Lemma 61 (Central Rank Levels). ‣ K.2 Grid Entropy ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;61&lt;/span&gt;&lt;/a&gt; supplies a rank level of size at least $m^{d-1}/(2d)\text{,}$ an antichain since the rank is strictly monotone, and &lt;a href="#Thmtheorem62" title="Lemma 62 (Grid Entropy). ‣ K.2 Grid Entropy ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;62&lt;/span&gt;&lt;/a&gt; at $K=1$ gives $H_{[m]^{d}}(1)=\Theta_{d}(m^{d-1})\text{.}$ The bounds (&lt;a href="#A10.E114" title="Equation 113 ‣ J.5 Lipschitz Losses ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;113&lt;/span&gt;&lt;/a&gt;) and (&lt;a href="#A10.E115" title="Equation 114 ‣ J.5 Lipschitz Losses ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;114&lt;/span&gt;&lt;/a&gt;) then match up to factors depending only on $d\text{,}$ uniformly in $\tau\text{,}$ proving the pinball claim. The absolute-loss claim follows by homogeneity: $\lvert\cdot\rvert=2\ell_{1/2}\text{,}$ so $R_{T}^{*}([m]^{d},\lvert\cdot\rvert)=2R_{T}^{*}([m]^{d},\ell_{1/2})\text{,}$ and $\rho_{1/2}=\tfrac{1}{4}$ is absorbed into the constants.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;section id="A10.SS5.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h5 class="ltx_title ltx_title_paragraph"&gt;Efficiency.&lt;/h5&gt;
&lt;div id="A10.SS5.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The aggregation strategy runs as written. Shifting the linearized losses moves every expert by the same amount, so the weights are those of $g_{t}\mathbf{1}\!\left[x_{t}\in U\right]\text{:}$ writing $G_{t}(x):=\sum_{s&amp;lt;t\,:\,x_{s}=x}g_{s}$ for the subgradients accumulated at $x\text{,}$ the prediction $p_{t}=\Pr_{U\sim q_{t}}[x_{t}\in U]$ is the marginal of the product measure $q_{t}(U)\propto\prod_{x\in U}e^{-\eta\,G_{t}(x)}\text{.}$ On the plane that is one call per round to the $O(m^{2})$ dynamic program of &lt;a href="#Thmtheorem38" title="Lemma 38 (Upset Marginal DP). ‣ F.2.2 Upset Marginal DP ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;38&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS5.SSS0.Px1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Beyond the plane, run the same learner on the disjoint union $\bigsqcup_{z}Q_{z}$ of the $S:=m^{d-2}$ slices $Q_{z}:=\{z\}\times[m]^{2}\text{,}$ each order-isomorphic to the plane. Every $f\in\mathcal{F}_{[m]^{d}}^{\uparrow}$ restricts to an isotonic function on each slice, so this only enlarges the comparator, and an upset of a disjoint union is a tuple of upsets of its parts:&lt;/p&gt;
&lt;table id="A10.Ex260" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H_{\bigsqcup_{z}Q_{z}}(1)\;=\;S\,H_{[m]^{2}}(1)\;=\;m^{d-2}\,\log\!\binom{2m}{m}\;=\;\Theta_{d}\bigl(m^{d-1}\bigr)\;=\;\Theta_{d}\bigl(H_{[m]^{d}}(1)\bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;so the slicing costs no entropy at this resolution. Now (&lt;a href="#A10.E114" title="Equation 113 ‣ J.5 Lipschitz Losses ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;113&lt;/span&gt;&lt;/a&gt;) on $\bigsqcup_{z}Q_{z}$ gives&lt;/p&gt;
&lt;table id="A10.Ex261" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\min\Bigl\{\rho_{\tau}T,\;2\sqrt{2\,\rho_{\tau}T\,S\,H_{[m]^{2}}(1)}\Bigr\}\;=\;\Theta_{d}\Bigl(\min\bigl\{\rho_{\tau}T,\;\sqrt{\rho_{\tau}\,m^{d-1}\,T}\bigr\}\Bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;the rate of &lt;a href="#Thmtheorem56" title="Theorem 56 (Pinball and Absolute Losses on Grids). ‣ J.5 Lipschitz Losses ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;56&lt;/span&gt;&lt;/a&gt;. The measure $q_{t}$ factorizes across the slices, so the marginal at $x_{t}$ is the planar marginal inside the slice holding it: one $O(m^{2})$ call per round, in every fixed dimension.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS5.SSS0.Px1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The one-point separation of &lt;a href="#S4" title="4 The Lipschitz Boundary ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; is now complete. On $\mathcal{P}=\{\ast\}$ the isotonic class is the interval $[0,1]\text{,}$ and $H_{\mathcal{P}}(1)=\log 2\text{,}$ the two upsets being $\varnothing$ and $\mathcal{P}\text{.}$ For the squared loss, &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; with $H_{\mathcal{P}}(K)=\log(K{+}1)$ and $K=\lceil\sqrt{T}\rceil$ gives $R_{T}\leq 2\log(\sqrt{T}+2)+\tfrac{1}{4}\text{,}$ and the one-point bound recorded after &lt;a href="#Thmtheorem60" title="Lemma 60 (Separated-Core Lower Bound). ‣ K.1 The Two Mechanisms in General Form ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;60&lt;/span&gt;&lt;/a&gt; gives $R_{T}^{*}\geq\tfrac{3}{16}\log(1+T/540)\text{:}$ the rate is $\Theta(\log T)\text{.}$ For the absolute loss, (&lt;a href="#A10.E114" title="Equation 113 ‣ J.5 Lipschitz Losses ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;113&lt;/span&gt;&lt;/a&gt;) and (&lt;a href="#A10.E115" title="Equation 114 ‣ J.5 Lipschitz Losses ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;114&lt;/span&gt;&lt;/a&gt;) with $H_{\mathcal{P}}(1)=\log 2\text{,}$ $N_{0}=1\text{,}$ and the homogeneity $\lvert\cdot\rvert=2\ell_{1/2}$ give $R_{T}^{*}(\mathcal{P},\lvert\cdot\rvert)=\Theta(\sqrt{T})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS5.SSS0.Px1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The two displayed bounds match whenever the poset carries an antichain of size $\Theta(H_{\mathcal{P}}(1))\text{,}$ which is what the grids supply. The chain does not: its width is $1$ while $H_{[n]}(1)=\log(n{+}1)\text{,}$ so the two bounds separate by a logarithmic factor, matching the gap &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Kotłowski&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt; [&lt;a href="#bib.bib2" title="Online isotonic regression" class="ltx_ref"&gt;2016&lt;/a&gt;, Section 7.2]&lt;/cite&gt; record for absolute-loss regret on the chain.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A10.SS6" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-loss-increment-surrogate"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;J.6 &lt;/span&gt;The Loss-Increment Surrogate&lt;/h3&gt;
&lt;div id="A10.SS6.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The surrogate of &lt;a href="#S5.SS2" title="5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.2&lt;/span&gt;&lt;/a&gt; extends from the squared loss to every convex loss by charging each layer its loss increment, and its dominance is a rearrangement inequality. Fix levels $z_{0}&amp;lt;\cdots&amp;lt;z_{K}$ in $[0,1]$ and, for a tuple $G=(U_{1},\ldots,U_{K})$ of upsets of a finite poset, let&lt;/p&gt;
&lt;table id="A10.Ex262" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$g_{G}(x)\;:=\;z_{0}+\sum_{r=1}^{K}d_{r}\,\mathbf{1}\!\left[x\in U_{r}\right],\qquad d_{r}:=z_{r}-z_{r-1},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;so that the surrogate reads $\widetilde{\ell}(G;\,x,y)=\ell(z_{0},y)+\sum_{r}[\ell(z_{r},y)-\ell(z_{r-1},y)]\,\mathbf{1}\!\left[x\in U_{r}\right]\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem57" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 57&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Increment Dominance).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem57.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $\ell(\cdot,y)$ be convex on $[0,1]\text{,}$ finite and continuous on $[z_{0},z_{K}]\text{.}$ For every tuple $G$ and every $(x,y)\text{:}$
&lt;/span&gt;(a)&lt;span class="ltx_text ltx_font_italic"&gt; $\widetilde{\ell}(G;\,x,y)\geq\ell(g_{G}(x),y)\text{;}$
&lt;/span&gt;(b)&lt;span class="ltx_text ltx_font_italic"&gt; equality holds if the membership vector $(\mathbf{1}\!\left[x\in U_{1}\right],\ldots,\mathbf{1}\!\left[x\in U_{K}\right])$ is a prefix of ones, in particular at every $x$ when $U_{1}\supseteq\cdots\supseteq U_{K}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A10.SS6.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Fix $(x,y)\text{,}$ let $A:=\{r:x\in U_{r}\}$ and $\Delta_{A}:=\sum_{r\in A}d_{r}\text{,}$ so $g_{G}(x)=z_{0}+\Delta_{A}\text{.}$ If $A=\varnothing$ or $A=\{1,\ldots,K\}\text{,}$ the two sides coincide; assume otherwise, so that $z_{0}+\Delta_{A}$ is interior to $[z_{0},z_{K}]$ and the right derivative there is finite. On $[z_{0},z_{K}]$ the convex, finite, continuous $\ell(\cdot,y)$ is the integral of its nondecreasing right derivative $\ell^{\prime}(\cdot,y)\text{,}$ so&lt;/p&gt;
&lt;table id="A10.Ex263" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widetilde{\ell}(G;\,x,y)-\ell(z_{0},y)\;=\;\int_{S_{A}}\ell^{\prime}(u,y)\,du,\qquad S_{A}:=\bigcup_{r\in A}[z_{r-1},z_{r}],$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;while $\ell(g_{G}(x),y)-\ell(z_{0},y)=\int_{E}\ell^{\prime}(u,y)\,du$ with $E:=[z_{0},z_{0}+\Delta_{A}]\text{.}$ The two sets have the same measure $\Delta_{A}\text{,}$ and $E$ is the leftmost subset of $[z_{0},z_{K}]$ of that measure: every point of $E\setminus S_{A}$ is at most $z_{0}+\Delta_{A}$ and every point of $S_{A}\setminus E$ is at least $z_{0}+\Delta_{A}\text{,}$ so the monotonicity of $\ell^{\prime}$ gives&lt;/p&gt;
&lt;table id="A10.Ex264" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\int_{S_{A}\setminus E}\ell^{\prime}(u,y)\,du\;\geq\;\ell^{\prime}(z_{0}+\Delta_{A},y)\,\lvert S_{A}\setminus E\rvert\;\geq\;\int_{E\setminus S_{A}}\ell^{\prime}(u,y)\,du,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and (a) follows. If $A$ is a prefix $\{1,\ldots,k\}\text{,}$ then $S_{A}=[z_{0},z_{k}]=E$ and the two integrals coincide, which is (b); a nested tuple has a prefix membership vector at every $x\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A10.SS6.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;On the uniform grid $z_{r}=r/K$ under the squared loss, the increments are $(r/K-y)^{2}-((r-1)/K-y)^{2}=(2r-1)/K^{2}-2y/K\text{,}$ and the lemma specializes to &lt;a href="#Thmtheorem37" title="Lemma 37 (Surrogate Dominance and Nested Tightness). ‣ F.2.1 Surrogate Dominance and Nested Tightness ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;37&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A10.SS7" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-planar-engine-across-the-loss-class"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;J.7 &lt;/span&gt;The Planar Engine Across the Loss Class&lt;/h3&gt;
&lt;div id="A10.SS7.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The slicing theorem needs, for each loss of the &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; family, a horizon-free planar learner with the three-phase guarantee. This subsection assembles one from proved parts: the increment surrogate (&lt;a href="#Thmtheorem57" title="Lemma 57 (Increment Dominance). ‣ J.6 The Loss-Increment Surrogate ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;57&lt;/span&gt;&lt;/a&gt;), the rounding estimates of &lt;a href="#A10.SS2" title="J.2 The Universal Upper Bound ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Sections&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;J.2&lt;/span&gt;&lt;/a&gt; and &lt;a href="#A10.SS4" title="J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;J.4&lt;/span&gt;&lt;/a&gt;, and the wrapper framework of &lt;a href="#A6.SS3" title="F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;F.3&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem58" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Proposition 58&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Planar Engine for the Loss Family).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem58.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $\ell$ be a curved loss with parameters $(\eta,\beta,\alpha,\Lambda)$ or the entropic loss. There is a horizon-free deterministic learner for $[m]^{2}$ with $\mathrm{poly}(m,t)$ per-round time achieving, for all integers $m\geq 2$ and $T\geq 1$ and every sequence, $R_{T}\leq C_{\ell}\min\{T,\Psi_{[m]^{2}}(T)\}\text{,}$ with $C_{\ell}$ depending only on the loss parameters.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A10.SS7.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;The two engines, curved case.&lt;/em&gt; Fix $K$ and run both engines at rate $\eta$ on the uniform levels $G_{K}\text{.}$ In &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;, replace the update factor by $e^{-\eta\,\ell(g(j_{t}),y_{t})}\text{:}$ the forward-backward recursion of &lt;a href="#A6.SS1" title="F.1 Column-Independent Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;F.1&lt;/span&gt;&lt;/a&gt; multiplies per-cell factors into a chain-shaped partition function and is indifferent to which loss generates them. Column-wise comparator enlargement and the proof of &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; on each chain give, exactly as for the squared loss,&lt;/p&gt;
&lt;table id="A10.Ex265" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\tfrac{1}{\eta}\,m\log\tbinom{m+K}{K}+\tfrac{\beta T}{8K^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;In &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;, redefine the coefficient $c_{r,t}$ as the loss increment $\ell(r/K,y_{t})-\ell((r-1)/K,y_{t})\text{,}$ with update factor $e^{-\eta c_{r,t}}\text{:}$ the surrogate is additive across layers, so the Gibbs factorization and the per-round equivalence of &lt;a href="#A6.SS2" title="F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;F.2&lt;/span&gt;&lt;/a&gt; are unchanged, and each round still costs one call to &lt;a href="#Thmtheorem38" title="Lemma 38 (Upset Marginal DP). ‣ F.2.2 Upset Marginal DP ‣ F.2 Surrogate Threshold-Indexed Upper Bound ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;38&lt;/span&gt;&lt;/a&gt; per layer; the prediction $\hat{y}_{t}=\tfrac{1}{K}\sum_{r}p_{t,r}$ remains $\mathbb{E}_{\pi_{t}}[g_{G}(x_{t})]$ on the uniform levels. Exp-concavity and Jensen’s inequality give $\ell(\hat{y}_{t},y_{t})\leq-\tfrac{1}{\eta}\log\mathbb{E}_{\pi_{t}}[e^{-\eta\,\ell(g_{G}(x_{t}),y_{t})}]\text{;}$ &lt;a href="#Thmtheorem57" title="Lemma 57 (Increment Dominance). ‣ J.6 The Loss-Increment Surrogate ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;57&lt;/span&gt;&lt;/a&gt;(a) replaces the loss by the surrogate in the exponent; the layer-additive potential telescopes at cost $\tfrac{1}{\eta}K\log\binom{2m}{m}$ against any tuple; and choosing the nested level sets of $\hat{f}:=q\circ f^{*}$ turns the surrogate back into $\ell(\hat{f}(x_{t}),y_{t})$ by part (b). The rounding cost $L_{T}(\hat{f})-L_{T}(f^{*})\leq\beta T/(8K^{2})$ is the estimate in the proof of &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;. Hence&lt;/p&gt;
&lt;table id="A10.Ex266" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\tfrac{1}{\eta}\,K\log\tbinom{2m}{m}+\tfrac{\beta T}{8K^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A10.SS7.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;The entropic loss.&lt;/em&gt; Replace $G_{K}$ by the arcsine levels $Z_{K}$ of &lt;a href="#Thmtheorem54" title="Lemma 54 (Arcsine Quantizer). ‣ J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;54&lt;/span&gt;&lt;/a&gt; and run both engines at rate $1\text{,}$ which the exp-concavity computation of &lt;a href="#A10.SS4" title="J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;J.4&lt;/span&gt;&lt;/a&gt; permits; on the nonuniform levels, &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; predicts the level-weighted marginal average $\hat{y}_{t}:=z_{0}+\sum_{r}(z_{r}-z_{r-1})\,p_{t,r}=\mathbb{E}_{\pi_{t}}[g_{G}(x_{t})]\text{,}$ while &lt;a href="#alg1" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; already predicts a posterior mean. The two counts depend only on the number of levels, so they are unchanged, $\binom{m+K}{K}$ non-decreasing chain maps and $\binom{2m}{m}^{K}$ tuples; the increments $\ell_{\log}(z_{r},y)-\ell_{\log}(z_{r-1},y)$ are finite on $Z_{K}\subset(0,1)$ and &lt;a href="#Thmtheorem57" title="Lemma 57 (Increment Dominance). ‣ J.6 The Loss-Increment Surrogate ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;57&lt;/span&gt;&lt;/a&gt; applies on $[z_{0},z_{K}]\text{;}$ and the rounding cost is $\sum_{c}w_{B_{c}}\,\mathrm{kl}(c\,\|\,q_{K}(c))\leq 14T/K^{2}$ by &lt;a href="#Thmtheorem53" title="Lemma 53 (Bregman Block Identity). ‣ J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemmas&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;53&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmtheorem54" title="Lemma 54 (Arcsine Quantizer). ‣ J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;54&lt;/span&gt;&lt;/a&gt;. The two engine bounds hold with $(\tfrac{1}{\eta},\tfrac{\beta}{8})$ replaced by $(1,14)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS7.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Envelope.&lt;/em&gt; For a known horizon the learner compares three explicit quantities and runs the best strategy: the two optimized engine bounds, written $\Psi^{\ell}_{\mathrm{col}}(T)$ and $\Psi^{\ell}_{\mathrm{surr}}(T)\text{,}$ and a linear term $\Lambda_{\ell}T\text{.}$ In the curved case $\Lambda_{\ell}:=\Lambda\text{,}$ the bound $R_{\tau}\leq\Lambda\tau$ holding for either engine at every prefix since the loss is bounded; in the entropic case $\Lambda_{\ell}:=\log 2\text{,}$ realized by a third strategy, the constant prediction $\tfrac{1}{2}\text{,}$ whose loss is $\log 2$ every round. The envelope&lt;/p&gt;
&lt;table id="A10.Ex267" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Phi_{\ell}(T)\;:=\;\min\bigl\{\Lambda_{\ell}\,T,\;\Psi^{\ell}_{\mathrm{col}}(T),\;\Psi^{\ell}_{\mathrm{surr}}(T)\bigr\}\;\asymp_{\ell}\;\Phi(T),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;the squared-loss envelope of &lt;a href="#S5.SS3" title="5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.3&lt;/span&gt;&lt;/a&gt;: each engine bound is an infimum $\inf_{K}\{a\,A_{K}+b\,T/K^{2}\}$ over its own entropy sequence $A_{K}\text{,}$ with $(a,b)=(\tfrac{1}{\eta},\tfrac{\beta}{8})$ or $(1,14)$ in place of the squared-loss $(2,\tfrac{1}{4})\text{,}$ so the homogeneity comparison of &lt;a href="#S2.SS3" title="2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt; applies engine by engine, and the linear terms differ by the constant $\Lambda_{\ell}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A10.SS7.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Horizon-freeness.&lt;/em&gt; $\Phi_{\ell}$ is, like $\Phi\text{,}$ the minimum of a linear function and two infima of affine families of $T\text{,}$ so properties (P1) through (P4) of &lt;a href="#Thmtheorem41" title="Lemma 41 (Properties of Φ). ‣ F.3.1 Combined Upper Bound ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;41&lt;/span&gt;&lt;/a&gt; hold with the same proofs, and concavity bounds its increments by $\Phi_{\ell}(1)\text{,}$ itself at most $\Lambda_{\ell}\text{.}$ Each strategy satisfies the base regret hypothesis at every prefix, its bound being affine and nondecreasing in the round count. The wrapper of &lt;a href="#Thmtheorem42" title="Lemma 42 (Generic Φ-Wrapper Regret). ‣ Setup. ‣ F.3.2 Generic Φ-Wrapper Framework ‣ F.3 Combined Upper Bound and Horizon-Free Wrapper ‣ Appendix F Algorithm Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;42&lt;/span&gt;&lt;/a&gt;, run with epoch budgets $\Lambda_{\ell}\,2^{k-1}\text{,}$ then gives&lt;/p&gt;
&lt;table id="A10.Ex268" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;4\,\Phi_{\ell}(T)+2\Lambda_{\ell},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;since the lemma’s proof uses the loss only through the base hypothesis and the epoch subadditivity of the comparator minimum, and rescaling every budget by $\Lambda_{\ell}$ rescales its conclusion. Finally $\Phi_{\ell}\asymp_{\ell}\Phi\asymp\min\{T,\Psi_{[m]^{2}}(T)\}\text{,}$ the second comparison because $\Psi_{\mathrm{col}},\Psi_{\mathrm{surr}}\geq\Psi_{[m]^{2}}$ pointwise while (&lt;a href="#S5.E7" title="Equation 7 ‣ 5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;) matches &lt;a href="#Thmtheorem63" title="Lemma 63 (Envelope Evaluation). ‣ K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;63&lt;/span&gt;&lt;/a&gt; at $d=2\text{;}$ and $\min\{T,\Psi_{[m]^{2}}(T)\}\geq 1$ for $T\geq 1$ absorbs the additive $2\Lambda_{\ell}$ into $C_{\ell}\text{.}$ The epoch lengths obey the same inversion bound as in the proof of &lt;a href="#Thmtheorem6" title="Theorem 6 (Horizon-Free Polynomial-Time Rate-Optimal Algorithm). ‣ Rate-doubling wrapper. ‣ 5.3 Combined Strategy and Horizon-Free Wrapper ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;, since $\Phi_{\ell}\asymp_{\ell}\Phi\text{,}$ so the per-round time is $\mathrm{poly}(m,t)\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A11" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="structured-posets-proofs"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix K &lt;/span&gt;Structured Posets: Proofs&lt;/h2&gt;
&lt;div id="A11.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This appendix proves the structural results of &lt;a href="#S3" title="3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; and the slicing theorem of &lt;a href="#S5" title="5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;: the two lower-bound mechanisms in the generality their proofs support (&lt;a href="#A11.SS1" title="K.1 The Two Mechanisms in General Form ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;K.1&lt;/span&gt;&lt;/a&gt;), the grid entropy law (&lt;a href="#A11.SS2" title="K.2 Grid Entropy ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;K.2&lt;/span&gt;&lt;/a&gt;), the Main Theorem and the Three-Phase Law (&lt;a href="#A11.SS3" title="K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;K.3&lt;/span&gt;&lt;/a&gt;), the slicing learner (&lt;a href="#A11.SS4" title="K.4 The Slicing Learner ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;K.4&lt;/span&gt;&lt;/a&gt;), rectangles (&lt;a href="#A11.SS5" title="K.5 Rectangles ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;K.5&lt;/span&gt;&lt;/a&gt;), and height-two posets (&lt;a href="#A11.SS6" title="K.6 Height-Two Posets ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;K.6&lt;/span&gt;&lt;/a&gt;). All lower bounds are stated and proved for the squared loss; &lt;a href="#Thmtheorem52" title="Lemma 52 (Loss Substitution). ‣ J.3 Loss Substitutions in the Lower Bounds ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;52&lt;/span&gt;&lt;/a&gt; in &lt;a href="#A10" title="Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;J&lt;/span&gt;&lt;/a&gt; is the single substitution that extends every one of them across the loss class of &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A11.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-two-mechanisms-in-general-form"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;K.1 &lt;/span&gt;The Two Mechanisms in General Form&lt;/h3&gt;
&lt;div id="A11.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The mechanisms of &lt;a href="#S3.SS1" title="3.1 Two Mechanisms ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt; are stated here as standalone lower bounds. Each reduces the geometry a family of posets must supply to a single item: consecutive rank levels of large size for the first, a separated core for the second. Their proofs run the posterior estimates of &lt;a href="#A5" title="Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;E&lt;/span&gt;&lt;/a&gt; on the new geometry, and only the geometry is new.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem59" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 59&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Rank-Level Lower Bound).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem59.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $\mathcal{P}$ be a nonempty finite poset and let $\mathrm{rk}:\mathcal{P}\to\mathbb{Z}$ satisfy $\mathrm{rk}(u)&amp;lt;\mathrm{rk}(v)$ whenever $u\prec v\text{,}$ with level sets $A_{s}:=\mathrm{rk}^{-1}(s)\text{.}$ Suppose the levels $s_{1}&amp;lt;\cdots&amp;lt;s_{K}$ satisfy $|A_{s_{r}}|\geq N_{0}$ for each $r\text{.}$ Then for every $T\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A11.Ex269" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}(\mathcal{P})\;\geq\;\frac{1-\sqrt{2/3}}{16}\,\min\Bigl\{N_{0}K,\;\frac{T}{K^{2}}\Bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A11.SS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Construction.&lt;/em&gt; Sample independent fair bits $\theta_{r,x}$ for $r\in[K]$ and $x\in A_{s_{r}}\text{,}$ and set&lt;/p&gt;
&lt;table id="A11.Ex270" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$U_{r}\;:=\;\bigl\{y\in\mathcal{P}:\mathrm{rk}(y)&amp;gt;s_{r}\bigr\}\cup\bigl\{x\in A_{s_{r}}:\theta_{r,x}=1\bigr\},\qquad f_{\theta}\;:=\;\tfrac{1}{4}+\tfrac{1}{2K}\sum_{r=1}^{K}\mathbf{1}\!\left[\cdot\in U_{r}\right].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Each $U_{r}$ is an upset: a point strictly above a member of $U_{r}$ has rank strictly larger than $s_{r}\text{.}$ The inclusions $U_{1}\supseteq\cdots\supseteq U_{K}$ hold irrespective of the bits, since $\{\mathrm{rk}&amp;gt;s_{r+1}\}$ and $A_{s_{r+1}}$ are both contained in $\{\mathrm{rk}&amp;gt;s_{r}\}\text{.}$ Hence every realization of $\theta$ yields an isotonic $f_{\theta}$ with values in $[\tfrac{1}{4},\tfrac{3}{4}]\text{.}$ A point $x\in A_{s_{r}}$ lies in every layer $U_{r^{\prime}}$ with $r^{\prime}&amp;lt;r\text{,}$ in no layer with $r^{\prime}&amp;gt;r\text{,}$ and in $U_{r}$ precisely when $\theta_{r,x}=1\text{,}$ so&lt;/p&gt;
&lt;table id="A11.Ex271" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$f_{\theta}(x)\;=\;\tfrac{1}{4}+\tfrac{r-1}{2K}+\tfrac{\theta_{r,x}}{2K}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;depends on that single bit: Complete Isolation in the sense of &lt;a href="#Thmtheorem24" title="Lemma 24 (Complete Isolation). ‣ E.1.3 Complete Isolation ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;24&lt;/span&gt;&lt;/a&gt;, with rank levels in place of staircase cutoffs.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Adversary.&lt;/em&gt; Write $\delta:=1/(2K)\text{,}$ let the probes be the $N:=\sum_{r}|A_{s_{r}}|\geq N_{0}K$ points of the chosen levels, and set $q:=K^{2}$ and $L:=\min\{T,Nq\}\text{.}$ The adversary queries the probes one after another, each for $q$ consecutive rounds, stopping once $L$ rounds are spent, with labels $Y_{t}\sim\mathrm{Ber}(f_{\theta}(x_{t}))$ drawn independently; the remaining $T-L$ rounds query one fixed point with labels drawn from its true mean. The strategy is oblivious.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Estimate.&lt;/em&gt; Steps A and B of the proof of &lt;a href="#Thmtheorem26" title="Lemma 26 (Ribbon-Path Lower Bound). ‣ E.1.5 Proof of Lemma 26 ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;26&lt;/span&gt;&lt;/a&gt; apply verbatim: since every realization of $\theta$ is isotonic, $\mathbb{E}[R_{T}]\geq\sum_{t\leq L}\mathbb{E}[(\hat{y}_{t}-f_{\theta}(x_{t}))^{2}]\text{,}$ and the joint law of bits and labels factorizes across probes, so the episodes are mutually independent two-point Bernoulli problems with gap $\delta\text{.}$ Within an episode of length $\ell_{j}\leq q\text{,}$ writing $p_{\Theta}$ for the probed value and $\pi_{s}$ for the posterior of its bit after $s$ labels, the per-step conditional-variance bound and the martingale monotonicity of the posterior (Steps C.1 and C.2 there) give&lt;/p&gt;
&lt;table id="A11.Ex272" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{s=1}^{\ell_{j}}\mathbb{E}\bigl[(\hat{y}_{s}-p_{\Theta})^{2}\bigr]\;\geq\;\ell_{j}\,\delta^{2}\,\mathbb{E}\bigl[\pi_{\ell_{j}}(1-\pi_{\ell_{j}})\bigr],$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and &lt;a href="#Thmtheorem25" title="Lemma 25 (𝜒²–TV Posterior-Variance Link). ‣ E.1.4 Posterior-Variance Link ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;25&lt;/span&gt;&lt;/a&gt; lower-bounds the posterior-variance factor by $(1-\mathrm{TV})/4\text{,}$ with $\mathrm{TV}$ the total variation between the two $\ell_{j}$-fold Bernoulli product laws. Both Bernoulli means lie in $[\tfrac{1}{4},\tfrac{3}{4}]\text{,}$ so their variance parameter is at least $\tfrac{3}{16}\text{,}$ whence $\mathrm{kl}\leq\chi^{2}\leq\tfrac{16}{3}\delta^{2}$ per observation &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[Tsybakov, &lt;a href="#bib.bib14" title="Introduction to nonparametric estimation" class="ltx_ref"&gt;2009&lt;/a&gt;]&lt;/cite&gt;; with $\ell_{j}\leq q$ observations and $q\delta^{2}=\tfrac{1}{4}\text{,}$ Pinsker’s inequality gives&lt;/p&gt;
&lt;table id="A11.Ex273" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathrm{TV}\;\leq\;\sqrt{\tfrac{16}{3}\,q\delta^{2}\big/2}\;=\;\sqrt{2/3},\qquad\text{so}\qquad\mathbb{E}\bigl[\pi_{\ell_{j}}(1-\pi_{\ell_{j}})\bigr]\;\geq\;\frac{1-\sqrt{2/3}}{4}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Summing over episodes, $\sum_{j}\ell_{j}=L$ and $L\delta^{2}=\min\{T,Nq\}/(4K^{2})\text{,}$ so&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A13.EGx4"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A11.Ex274"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A11.Ex275"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle\mathbb{E}[R_{T}]\;\geq\;\frac{1-\sqrt{2/3}}{4}\cdot\frac{\min\{T,Nq\}}{4K^{2}}\; &amp;amp; \displaystyle=\;\frac{1-\sqrt{2/3}}{16}\,\min\Bigl\{\frac{T}{K^{2}},\;N\Bigr\} \\
&amp;amp; \displaystyle\geq\;\frac{1-\sqrt{2/3}}{16}\,\min\Bigl\{N_{0}K,\;\frac{T}{K^{2}}\Bigr\}.
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;Yao’s principle converts the Bayesian bound into the minimax claim.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem60" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 60&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Separated-Core Lower Bound).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem60.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $\mathcal{P}$ be a nonempty finite poset with $n:=|\mathcal{P}|\text{,}$ and let $b:\mathcal{P}\to[\tfrac{1}{3},\tfrac{2}{3}]$ satisfy $b_{v}-b_{u}\geq 4\varepsilon$ whenever $u\prec v\text{,}$ for some $0&amp;lt;\varepsilon\leq\tfrac{1}{12}\text{.}$ Then for every $T\geq n\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A11.Ex276" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}(\mathcal{P})\;\geq\;\frac{3}{16}\,n\log\Bigl(1+\frac{4T\varepsilon^{2}}{15\,n}\Bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A11.SS1.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The argument of &lt;a href="#A5.SS2" title="E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;E.2&lt;/span&gt;&lt;/a&gt; transfers once its three construction properties are re-verified. Sample $\Theta_{u}\sim\pi_{\varepsilon}$ independently across $u\in\mathcal{P}\text{,}$ where $\pi_{\varepsilon}$ is the prior of &lt;a href="#Thmtheorem28" title="Lemma 28 (Prior Fisher Information). ‣ E.2.3 Prior Fisher Information ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;28&lt;/span&gt;&lt;/a&gt;, and play $P_{u}:=b_{u}+\Theta_{u}\text{.}$ For $u\prec v\text{,}$ $P_{v}-P_{u}\geq 4\varepsilon-2\varepsilon&amp;gt;0\text{,}$ so every realization is isotonic; the values satisfy $P_{u}\in[\tfrac{1}{3}-\varepsilon,\tfrac{2}{3}+\varepsilon]\subseteq[\tfrac{1}{4},\tfrac{3}{4}]$ by $\varepsilon\leq\tfrac{1}{12}\text{;}$ and consequently the Bernoulli Fisher information $1/[P_{u}(1-P_{u})]$ is at most $\tfrac{16}{3}\text{,}$ as in &lt;a href="#Thmtheorem27" title="Lemma 27 (Construction Validity). ‣ E.2.2 Construction Validity ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;27&lt;/span&gt;&lt;/a&gt;. The adversary queries each point of $\mathcal{P}$ for $q:=\lfloor T/n\rfloor$ consecutive rounds with labels $Y_{t}\sim\mathrm{Ber}(P_{x_{t}})\text{,}$ the remaining rounds querying one fixed point.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS1.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Steps A through D of the proof of &lt;a href="#Thmtheorem31" title="Lemma 31 (Interior-Cube Lower Bound). ‣ E.2.6 Proof of Lemma 31 ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;31&lt;/span&gt;&lt;/a&gt; now apply verbatim: the regret dominates the cumulative estimation error; the posterior of $\Theta_{u}$ given any mid-round history depends only on the observations at $u\text{,}$ by &lt;a href="#Thmtheorem29" title="Lemma 29 (Posterior Factorization). ‣ Setup. ‣ E.2.4 Posterior Factorization ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;29&lt;/span&gt;&lt;/a&gt;, whose setting is an arbitrary finite index set with a product prior; and the van Trees inequality (&lt;a href="#Thmtheorem30" title="Fact 30 (Van Trees Inequality). ‣ E.2.5 Van Trees Inequality ‣ E.2 Interior-Cube Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Fact&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;30&lt;/span&gt;&lt;/a&gt;), with per-observation Fisher information at most $\tfrac{16}{3}$ and prior information $J(\pi_{\varepsilon})=10/\varepsilon^{2}\text{,}$ yields&lt;/p&gt;
&lt;table id="A11.Ex277" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[R_{T}]\;\geq\;n\sum_{k=0}^{q-1}\frac{1}{16k/3+10/\varepsilon^{2}}\;\geq\;\frac{3}{16}\,n\log\Bigl(1+\frac{8q\varepsilon^{2}}{15}\Bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;the second inequality by comparing the sum with $\int_{0}^{q}dt/(16t/3+10/\varepsilon^{2})\text{.}$ Since $T\geq n\text{:}$ if $T&amp;lt;2n$ then $q=1\geq T/(2n)\text{,}$ and otherwise $q\geq T/n-1\geq T/(2n)\text{;}$ so $8q\varepsilon^{2}/15\geq 4T\varepsilon^{2}/(15n)\text{,}$ and Yao’s principle completes the proof.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A11.SS1.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The hypothesis of &lt;a href="#Thmtheorem60" title="Lemma 60 (Separated-Core Lower Bound). ‣ K.1 The Two Mechanisms in General Form ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;60&lt;/span&gt;&lt;/a&gt; is vacuous on an antichain, and in particular on the one-point poset, where the lemma already yields $R_{T}^{*}\geq\tfrac{3}{16}\log(1+T/540)$ with $b\equiv\tfrac{1}{2}$ and $\varepsilon=\tfrac{1}{12}\text{:}$ the logarithmic lower bound that &lt;a href="#S4" title="4 The Lipschitz Boundary ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; contrasts with the square-root law of the absolute loss.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A11.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="grid-entropy"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;K.2 &lt;/span&gt;Grid Entropy&lt;/h3&gt;
&lt;div id="A11.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Throughout this subsection and the next, $\mathcal{P}=[m]^{d}$ with $d\geq 2$ fixed, $\mathrm{rk}(x)=\sum_{i=1}^{d}(x_{i}-1)\in\{0,\ldots,d(m-1)\}\text{,}$ and $A_{s}$ are the rank levels, as in &lt;a href="#S3.SS2" title="3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.2&lt;/span&gt;&lt;/a&gt;. Since $x\prec y$ forces $\mathrm{rk}(x)&amp;lt;\mathrm{rk}(y)\text{,}$ the valuation is strictly monotone and &lt;a href="#Thmtheorem59" title="Lemma 59 (Rank-Level Lower Bound). ‣ K.1 The Two Mechanisms in General Form ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;59&lt;/span&gt;&lt;/a&gt; applies to any choice of levels. The next lemma supplies the levels.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem61" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 61&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Central Rank Levels).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem61.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For all $d\geq 1$ and $m\geq 2\text{:}$ $|A_{s}|\leq m^{d-1}$ for every $s\text{,}$ and $|A_{s}|\geq m^{d-1}/(2d)$ for at least $\lceil m/2\rceil$ consecutive values of $s\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A11.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For the upper bound, the coordinates $x_{2},\ldots,x_{d}$ of a point of $A_{s}$ determine $x_{1}\text{.}$ For the lower bound, $(|A_{s}|)_{s}$ is the coefficient sequence of $(1+t+\cdots+t^{m-1})^{d}\text{,}$ and we first record that a product of polynomials with symmetric unimodal nonnegative coefficient sequences is again of this kind. A symmetric unimodal nonnegative sequence $(c_{s})$ with center $\mu$ decomposes as&lt;/p&gt;
&lt;table id="A11.Ex278" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$c_{s}\;=\;\sum_{j}\lambda_{j}\,\mathbf{1}\!\left[s\in I_{j}\right],\qquad\lambda_{j}\geq 0,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;with $I_{1}\supseteq I_{2}\supseteq\cdots$ intervals centered at $\mu\text{,}$ obtained by peeling off successive differences of the increasing half; the product of two centered interval polynomials has as coefficients the convolution of two centered intervals, a trapezoid, symmetric and unimodal about the sum of the centers; and both properties survive nonnegative combinations with a common center. By induction, $(|A_{s}|)_{s}$ is symmetric and unimodal about $d(m-1)/2\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Now let $S:=\{s:|A_{s}|\geq m^{d-1}/(2d)\}\text{,}$ an interval of consecutive values containing the center, by unimodality. The levels outside $S$ number at most $d(m-1)+1\leq dm$ and each contains fewer than $m^{d-1}/(2d)$ points, so together they contain fewer than $m^{d}/2$ of the $m^{d}$ points of the grid; the levels in $S$ therefore contain more than $m^{d}/2$ points, and since each level contains at most $m^{d-1}$ of them, $|S|&amp;gt;m/2\text{,}$ hence $|S|\geq\lceil m/2\rceil\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem62" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 62&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Grid Entropy).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem62.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For every fixed $d\geq 2\text{,}$ uniformly over $m\geq 2$ and $K\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A11.Ex279" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H_{[m]^{d}}(K)\;=\;\begin{cases}\Theta_{d}\bigl(m^{d-1}K\bigr),&amp;amp;1\leq K\leq m,\\[2.84526pt] \Theta_{d}\bigl(m^{d}\bigl[1+\log\tfrac{K}{m}\bigr]\bigr),&amp;amp;K\geq m.\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A11.SS2.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Coarse regime, upper bound.&lt;/em&gt; An isotonic map $g:[m]^{d}\to\{0,\ldots,K\}$ is determined by its threshold upsets $U_{r}:=\{g\geq r\}\text{,}$ $r\in[K]\text{,}$ so $\Omega([m]^{d},K{+}1)\leq|\mathcal{U}([m]^{d})|^{K}\text{,}$ where $\mathcal{U}$ denotes the family of upsets; upsets biject by complementation with order ideals, the down-closed sets, whose family we write $\mathcal{J}\text{.}$ An ideal of $[m]^{d}=[m]^{d-1}\times[m]$ is a decreasing $m$-tuple of ideals of $[m]^{d-1}\text{,}$ its slices, so $|\mathcal{J}([m]^{d})|\leq|\mathcal{J}([m]^{d-1})|^{m}\text{;}$ iterating down to $d=2\text{,}$ where ideals of $[m]^{2}$ biject with monotone lattice paths, $|\mathcal{J}([m]^{2})|=\binom{2m}{m}\text{,}$ gives&lt;/p&gt;
&lt;table id="A11.Ex280" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log|\mathcal{U}([m]^{d})|\;\leq\;m^{d-2}\log\tbinom{2m}{m}\;\leq\;(2\log 2)\,m^{d-1},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;hence $H_{[m]^{d}}(K)\leq(2\log 2)\,m^{d-1}K\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS2.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Coarse regime, lower bound.&lt;/em&gt; Fix $K\leq\lceil m/2\rceil$ and choose $K$ of the central levels of &lt;a href="#Thmtheorem61" title="Lemma 61 (Central Rank Levels). ‣ K.2 Grid Entropy ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;61&lt;/span&gt;&lt;/a&gt;, $s_{1}&amp;lt;\cdots&amp;lt;s_{K}\text{.}$ For arbitrary subsets $S_{r}\subseteq A_{s_{r}}\text{,}$ the sets $U_{r}:=\{\mathrm{rk}&amp;gt;s_{r}\}\cup S_{r}$ are nested upsets, exactly as in the proof of &lt;a href="#Thmtheorem59" title="Lemma 59 (Rank-Level Lower Bound). ‣ K.1 The Two Mechanisms in General Form ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;59&lt;/span&gt;&lt;/a&gt;, and the isotonic map $g:=\sum_{r}\mathbf{1}\!\left[\cdot\in U_{r}\right]$ recovers the subsets via $S_{r}=\{x\in A_{s_{r}}:g(x)=r\}\text{.}$ Distinct choices give distinct maps, so&lt;/p&gt;
&lt;table id="A11.Ex281" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H_{[m]^{d}}(K)\;\geq\;\log 2\sum_{r=1}^{K}|A_{s_{r}}|\;\geq\;\frac{\log 2}{2d}\,m^{d-1}K.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;For $\lceil m/2\rceil&amp;lt;K\leq m\text{,}$ monotonicity in $K$ gives $H_{[m]^{d}}(K)\geq H_{[m]^{d}}(\lceil m/2\rceil)\geq\tfrac{\log 2}{4d}\,m^{d-1}K\text{,}$ using $\lceil m/2\rceil\geq K/2\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS2.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Fine regime, upper bound.&lt;/em&gt; Let $L:=\lceil K/m\rceil\text{.}$ Every isotonic $g$ valued in $\{0,\ldots,K\}$ factors as $g=L\lfloor g/L\rfloor+(g\bmod L)\text{:}$ the map $\lfloor g/L\rfloor$ is isotonic with values in $\{0,\ldots,\lfloor K/L\rfloor\}\subseteq\{0,\ldots,m\}\text{,}$ and the remainder is an arbitrary map into $\{0,\ldots,L-1\}\text{.}$ The factorization is injective, so&lt;/p&gt;
&lt;table id="A11.Ex282" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H_{[m]^{d}}(K)\;\leq\;H_{[m]^{d}}(m)+m^{d}\log L\;=\;\Theta_{d}\bigl(m^{d}\bigl[1+\log\tfrac{K}{m}\bigr]\bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;using $H_{[m]^{d}}(m)=\Theta_{d}(m^{d})$ from the coarse regime.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS2.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Fine regime, lower bound.&lt;/em&gt; Suppose first $K\geq 4d^{2}m$ and put $q:=\lfloor(K{+}1)/(d(m-1)+1)\rfloor\text{.}$ For $z\in\{0,\ldots,q-1\}^{[m]^{d}}$ define $g_{z}(x):=q\,\mathrm{rk}(x)+z_{x}\text{;}$ a strict relation raises the rank by at least one, so $g_{z}(y)-g_{z}(x)\geq q-(q-1)=1$ and $g_{z}$ is isotonic, with maximum value $q(d(m-1)+1)-1\leq K\text{.}$ The $q^{m^{d}}$ maps are distinct ($z_{x}=g_{z}(x)\bmod q$), so $H_{[m]^{d}}(K)\geq m^{d}\log q\text{;}$ and $q\geq K/(2dm)$ with $K/m\geq(2d)^{2}$ give $\log q\geq\log(K/m)-\log(2d)\geq\tfrac{1}{2}\log(K/m)\geq\tfrac{1}{4}\bigl[1+\log(K/m)\bigr]\text{.}$ For $m\leq K&amp;lt;4d^{2}m\text{,}$ monotonicity gives $H_{[m]^{d}}(K)\geq H_{[m]^{d}}(m)=\Theta_{d}(m^{d})\text{,}$ while $1+\log(K/m)\leq 1+\log(4d^{2})=O_{d}(1)\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A11.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-grid-rate"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;K.3 &lt;/span&gt;The Grid Rate&lt;/h3&gt;
&lt;div id="A11.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We prove &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; in four steps: evaluate the envelope (&lt;a href="#Thmtheorem63" title="Lemma 63 (Envelope Evaluation). ‣ K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;63&lt;/span&gt;&lt;/a&gt;), instantiate the two mechanisms, collapse the resulting family of bounds (&lt;a href="#Thmtheorem64" title="Lemma 64 (Envelope Collapse). ‣ K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;64&lt;/span&gt;&lt;/a&gt;), and merge. The first step also proves &lt;a href="#Thmtheorem3" title="Corollary 3 (Three-Phase Scaling Law). ‣ 3.3 The Three Phases and the Phase Criterion ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem63" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 63&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Envelope Evaluation).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem63.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For every fixed $d\geq 2$ there are constants $0&amp;lt;c_{d}\leq C_{d}$ such that for all $m\geq 2$ and $T\geq 1\text{,}$ $\min\{T,\Psi_{[m]^{d}}(T)\}$ lies between $c_{d}$ and $C_{d}$ times&lt;/span&gt;&lt;/p&gt;
&lt;table id="A11.Ex283" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$E(T)\;:=\;\begin{cases}T,&amp;amp;T\leq m^{d-1},\\ m^{2(d-1)/3}\,T^{1/3},&amp;amp;m^{d-1}\leq T\leq m^{d+2},\\ m^{d}\,\bigl[1+\log(T/m^{d+2})\bigr],&amp;amp;T\geq m^{d+2}.\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A11.SS3.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Write $H:=H_{[m]^{d}}\text{,}$ and fix constants $a_{d}\leq b_{d}$ from &lt;a href="#Thmtheorem62" title="Lemma 62 (Grid Entropy). ‣ K.2 Grid Entropy ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;62&lt;/span&gt;&lt;/a&gt; so that $H(K)\geq a_{d}\,m^{d-1}K$ for $K\leq m\text{,}$ $H(K)\geq a_{d}\,m^{d}[1+\log(K/m)]$ for $K\geq m\text{,}$ and $H(K)\leq 3b_{d}\,m^{d-1}K$ for all $K\leq 2m\text{,}$ the last since on $m\leq K\leq 2m$ the fine form is at most $b_{d}\,m^{d}(1+\log 2)\leq 3b_{d}\,m^{d-1}K\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS3.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Upper bound.&lt;/em&gt; For $T\leq m^{d-1}\text{,}$ $\min\{T,\Psi\}\leq T=E(T)\text{.}$ For $m^{d-1}\leq T\leq m^{d+2}\text{,}$ take $K:=\lceil(T/m^{d-1})^{1/3}\rceil\leq 2m\text{;}$ then&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A13.EGx5"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A11.Ex284"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A11.Ex285"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle\Psi(T)\;\leq\;2H(K)+\frac{T}{4K^{2}}\; &amp;amp; \displaystyle\leq\;6b_{d}\,m^{d-1}\bigl((T/m^{d-1})^{1/3}+1\bigr)+\frac{T}{4}\,(T/m^{d-1})^{-2/3} \\
&amp;amp; \displaystyle\leq\;C\,m^{2(d-1)/3}T^{1/3},
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;using $m^{d-1}\leq m^{2(d-1)/3}T^{1/3}$ in this range. For $T\geq m^{d+2}\text{,}$ take $K:=\lceil(T/m^{d})^{1/2}\rceil\geq m\text{;}$ then $\log(K/m)\leq\log 2+\tfrac{1}{2}\log(T/m^{d+2})$ and $T/(4K^{2})\leq m^{d}/4\text{,}$ so $\Psi(T)\leq C_{d}\,m^{d}[1+\log(T/m^{d+2})]\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS3.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Lower bound.&lt;/em&gt; For $T\leq m^{d-1}\text{,}$ every $K$ gives $2H(K)\geq 2H(1)\geq 2a_{d}m^{d-1}\geq 2a_{d}T\text{,}$ so $\min\{T,\Psi\}\geq\min\{1,2a_{d}\}\,T\text{.}$ For $m^{d-1}\leq T\leq m^{d+2}$ and any $K\text{:}$ if $K\leq m\text{,}$ then, by $u+v\geq u^{2/3}v^{1/3}\text{,}$&lt;/p&gt;
&lt;table id="A11.Ex286" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$2H(K)+\frac{T}{4K^{2}}\;\geq\;(2a_{d}\,m^{d-1}K)^{2/3}\Bigl(\frac{T}{4K^{2}}\Bigr)^{1/3}\;=\;\frac{(2a_{d})^{2/3}}{4^{1/3}}\,m^{2(d-1)/3}T^{1/3};$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;if $K\geq m\text{,}$ then $2H(K)\geq 2a_{d}m^{d}\geq 2a_{d}\,m^{2(d-1)/3}T^{1/3}\text{,}$ since $T\leq m^{d+2}\text{.}$ In this range $E(T)\leq T\text{,}$ so $\min\{T,\Psi\}\geq c_{d}E(T)\text{.}$ For $T\geq m^{d+2}\text{,}$ write $x:=T/m^{d+2}\geq 1$ and $\kappa:=K/m\text{.}$ If $K\leq m\text{,}$ then $T/(4K^{2})\geq T/(4m^{2})=m^{d}x/4\geq\tfrac{1}{4}m^{d}[1+\log x]\text{,}$ by $x\geq 1+\log x\text{.}$ If $K\geq m\text{,}$ then either $1+\log\kappa\geq\tfrac{1}{3}(1+\log x)$ and the entropy term suffices, or $\kappa\leq x^{1/3}$ and&lt;/p&gt;
&lt;table id="A11.Ex287" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{T}{4K^{2}}\;=\;\frac{m^{d}x}{4\kappa^{2}}\;\geq\;\frac{m^{d}x^{1/3}}{4}\;\geq\;\frac{m^{d}}{12}\,(1+\log x),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;using $x^{1/3}\geq\tfrac{1}{3}(1+\log x)$ for $x\geq 1\text{,}$ which holds since $x\mapsto x^{1/3}-\tfrac{1}{3}(1+\log x)$ increases on $[1,\infty)$ from the value $\tfrac{2}{3}\text{.}$ Finally $E(T)=m^{d}[1+\log x]\leq m^{d}x\leq T\text{,}$ so the minimum with $T$ costs nothing.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A11.SS3.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Instantiating the two mechanisms is now immediate. &lt;a href="#Thmtheorem61" title="Lemma 61 (Central Rank Levels). ‣ K.2 Grid Entropy ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;61&lt;/span&gt;&lt;/a&gt; supplies, for every $K\leq\lceil m/2\rceil\text{,}$ that many consecutive central levels of size at least $m^{d-1}/(2d)\text{,}$ so &lt;a href="#Thmtheorem59" title="Lemma 59 (Rank-Level Lower Bound). ‣ K.1 The Two Mechanisms in General Form ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;59&lt;/span&gt;&lt;/a&gt; gives&lt;/p&gt;
&lt;table id="A11.E116" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}([m]^{d})\;\geq\;\frac{1-\sqrt{2/3}}{16}\,\min\Bigl\{\frac{m^{d-1}K}{2d},\;\frac{T}{K^{2}}\Bigr\},\qquad 1\leq K\leq\lceil m/2\rceil.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(115)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The rank function is a separated core: $b_{x}:=\tfrac{1}{3}+\mathrm{rk}(x)/(3d(m-1))$ takes values in $[\tfrac{1}{3},\tfrac{2}{3}]$ and rises by at least $1/(3d(m-1))=4\varepsilon\text{,}$ $\varepsilon:=1/(12d(m-1))\text{,}$ across every strict relation, so &lt;a href="#Thmtheorem60" title="Lemma 60 (Separated-Core Lower Bound). ‣ K.1 The Two Mechanisms in General Form ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;60&lt;/span&gt;&lt;/a&gt; with $n=m^{d}$ and $(m-1)^{2}\leq m^{2}$ gives, for $T\geq m^{d}\text{,}$&lt;/p&gt;
&lt;table id="A11.E117" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}([m]^{d})\;\geq\;\frac{3}{16}\,m^{d}\log\Bigl(1+\frac{T}{540\,d^{2}\,m^{d+2}}\Bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(116)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A11.SS3.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The merging step rests on a three-line reduction of the envelope to the family of single-scale bounds; it is stated for every finite poset because &lt;a href="#A11.SS5" title="K.5 Rectangles ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Sections&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;K.5&lt;/span&gt;&lt;/a&gt; and &lt;a href="#A11.SS6" title="K.6 Height-Two Posets ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;K.6&lt;/span&gt;&lt;/a&gt; reuse it.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem64" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 64&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Envelope Collapse).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem64.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For every finite nonempty poset $\mathcal{P}$ and every $T\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A11.Ex288" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\min\{T,\,\Psi_{\mathcal{P}}(T)\}\;\leq\;3\sup_{K\geq 1}\,\min\Bigl\{H_{\mathcal{P}}(K),\;\frac{T}{K^{2}}\Bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A11.SS3.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Write $B$ for the supremum. If $H_{\mathcal{P}}(1)&amp;gt;T\text{,}$ then $B\geq\min\{H_{\mathcal{P}}(1),T\}=T\geq\min\{T,\Psi_{\mathcal{P}}(T)\}\text{.}$ Otherwise, since $H_{\mathcal{P}}(K)\geq\log(K{+}1)\to\infty$ while $T/K^{2}\to 0\text{,}$ there is a largest $k$ with $H_{\mathcal{P}}(k)\leq T/k^{2}\text{.}$ Then $B\geq H_{\mathcal{P}}(k)\text{,}$ and maximality gives $H_{\mathcal{P}}(k{+}1)&amp;gt;T/(k{+}1)^{2}\text{,}$ so $B\geq T/(k{+}1)^{2}\geq T/(4k^{2})\text{.}$ Hence&lt;/p&gt;
&lt;table id="A11.Ex289" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\min\{T,\Psi_{\mathcal{P}}(T)\}\;\leq\;\Psi_{\mathcal{P}}(T)\;\leq\;2H_{\mathcal{P}}(k)+\frac{T}{4k^{2}}\;\leq\;3B.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A11.SS3.p8" class="ltx_para"&gt;
&lt;div id="restatement-Thmtheorem2-Thmtheorem2" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 2&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Main Theorem).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="restatement-Thmtheorem2-Thmtheorem2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Fix an integer $d\geq 2\text{,}$ and let $\ell$ be a curved loss with parameters $(\eta,\beta,\alpha,\Lambda)$ or the entropic loss. For all integers $m\geq 2$ and $T\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="restatement-Thmtheorem2-S3.Ex8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}\bigl([m]^{d},\ell\bigr)\;=\;\Theta\bigl(\min\bigl\{T,\;\Psi_{[m]^{d}}(T)\bigr\}\bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;with implied constants depending only on $d$ and the loss parameters.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A11.SS3.p9" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Upper bound.&lt;/em&gt; For a curved loss, &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; and the homogeneity comparison following it give $R_{T}^{*}([m]^{d},\ell)\leq\max\{\tfrac{1}{2\eta},\tfrac{\beta}{2}\}\,\Psi_{[m]^{d}}(T)\text{,}$ and boundedness gives $R_{T}^{*}\leq\Lambda T\text{.}$ For the entropic loss, &lt;a href="#Thmtheorem55" title="Theorem 55 (Entropic Upper Bound). ‣ J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;55&lt;/span&gt;&lt;/a&gt; with the same comparison gives $R_{T}^{*}\leq 56\,\Psi_{[m]^{d}}(T)\text{,}$ comparing $(1,14)=(\tfrac{1}{2}\cdot 2,\,56\cdot\tfrac{1}{4})$ componentwise, and the constant prediction $\tfrac{1}{2}$ gives $R_{T}^{*}\leq T\log 2\text{.}$ In both cases $R_{T}^{*}([m]^{d},\ell)\lesssim\min\{T,\Psi_{[m]^{d}}(T)\}$ with the stated constant dependence.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS3.p10" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Lower bound, squared loss.&lt;/em&gt; Suppose first $T\leq 540\,d^{2}m^{d+2}\text{,}$ and set $K_{0}:=\lceil m/2\rceil\text{.}$ For $K&amp;gt;K_{0}\text{,}$&lt;/p&gt;
&lt;table id="A11.Ex290" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\min\{H(K),\,T/K^{2}\}\;\leq\;\frac{T}{K^{2}}\;\leq\;\frac{4T}{m^{2}},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;while the value at $K_{0}$ satisfies $\min\{m^{d-1}K_{0},T/K_{0}^{2}\}\geq\min\{m^{d}/2,\,T/m^{2}\}\text{;}$ and $4T/m^{2}\leq C_{d}\min\{m^{d}/2,T/m^{2}\}\text{,}$ since either $T/m^{2}\leq m^{d}/2\text{,}$ or $T\leq 540d^{2}m^{d+2}$ makes $4T/m^{2}\leq 2160\,d^{2}\,m^{d}\text{.}$ Together with $H(K)\leq 3b_{d}\,m^{d-1}K$ on $K\leq K_{0}$ (proof of &lt;a href="#Thmtheorem63" title="Lemma 63 (Envelope Evaluation). ‣ K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;63&lt;/span&gt;&lt;/a&gt;), the supremum in &lt;a href="#Thmtheorem64" title="Lemma 64 (Envelope Collapse). ‣ K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;64&lt;/span&gt;&lt;/a&gt; is realized, up to a $d$-dependent factor, on the range of (&lt;a href="#A11.E116" title="Equation 115 ‣ K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;115&lt;/span&gt;&lt;/a&gt;):&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A13.EGx6"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A11.Ex291"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A11.Ex292"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle\min\{T,\Psi_{[m]^{d}}(T)\}\;\leq\;3\sup_{K\geq 1}\min\{H(K),T/K^{2}\}\; &amp;amp; \displaystyle\lesssim_{d}\;\sup_{1\leq K\leq K_{0}}\min\Bigl\{m^{d-1}K,\frac{T}{K^{2}}\Bigr\} \\
&amp;amp; \displaystyle\lesssim_{d}\;R_{T}^{*}([m]^{d}),
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;the last comparison by (&lt;a href="#A11.E116" title="Equation 115 ‣ K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;115&lt;/span&gt;&lt;/a&gt;). Suppose instead $T&amp;gt;540\,d^{2}m^{d+2}\text{,}$ and write $x:=T/m^{d+2}$ and $C:=540d^{2}\text{.}$ Since the logarithm is concave, $\log(1+x/C)=\log\bigl((1-\tfrac{1}{C})\cdot 1+\tfrac{1}{C}(1+x)\bigr)\geq\tfrac{1}{C}\log(1+x)\text{,}$ and $\log(1+x)\geq\tfrac{1}{2}(1+\log x)$ for $x\geq e\text{;}$ both apply, since $x&amp;gt;C&amp;gt;e\text{.}$ So (&lt;a href="#A11.E117" title="Equation 116 ‣ K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;116&lt;/span&gt;&lt;/a&gt;), valid because $T&amp;gt;m^{d}\text{,}$ gives $R_{T}^{*}([m]^{d})\geq\tfrac{3}{32C}\,m^{d}\,[1+\log(T/m^{d+2})]\text{,}$ and &lt;a href="#Thmtheorem63" title="Lemma 63 (Envelope Evaluation). ‣ K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;63&lt;/span&gt;&lt;/a&gt; bounds $\min\{T,\Psi\}$ by $C_{d}$ times the same quantity.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS3.p11" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;General losses.&lt;/em&gt; &lt;a href="#Thmtheorem52" title="Lemma 52 (Loss Substitution). ‣ J.3 Loss Substitutions in the Lower Bounds ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;52&lt;/span&gt;&lt;/a&gt; multiplies the right-hand sides of (&lt;a href="#A11.E116" title="Equation 115 ‣ K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;115&lt;/span&gt;&lt;/a&gt;) and (&lt;a href="#A11.E117" title="Equation 116 ‣ K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;116&lt;/span&gt;&lt;/a&gt;) by $\alpha\text{,}$ and shows that the entropic loss satisfies (&lt;a href="#S2.E1" title="Equation 1 ‣ 2.1 Setup ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;) with $\alpha=2\text{;}$ the merging above is otherwise unchanged.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of &lt;a href="#Thmtheorem3" title="Corollary 3 (Three-Phase Scaling Law). ‣ 3.3 The Three Phases and the Phase Criterion ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;.&lt;/h6&gt;
&lt;div id="A11.SS3.p12" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Combine &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; with &lt;a href="#Thmtheorem63" title="Lemma 63 (Envelope Evaluation). ‣ K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;63&lt;/span&gt;&lt;/a&gt;.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A11.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-slicing-learner"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;K.4 &lt;/span&gt;The Slicing Learner&lt;/h3&gt;
&lt;div id="A11.SS4.p1" class="ltx_para"&gt;
&lt;div id="restatement-Thmtheorem7-Thmtheorem7" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 7&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Slicing).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="restatement-Thmtheorem7-Thmtheorem7.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Fix an integer $d\geq 2$ and let $\ell$ be a loss of the &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; family. There is a horizon-free deterministic learner for $[m]^{d}$ with $\mathrm{poly}(m,t)$ per-round time achieving, for all integers $m\geq 2$ and $T\geq 1$ and every sequence,&lt;/span&gt;&lt;/p&gt;
&lt;table id="restatement-Thmtheorem7-S5.Ex10" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;C_{d,\ell}\,\min\bigl\{T,\;\Psi_{[m]^{d}}(T)\bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;with $C_{d,\ell}$ depending only on $d$ and the loss parameters.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A11.SS4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The proof has three steps: a concave majorant for the planar guarantee, a slicewise decomposition of the regret, and a Jensen recombination; the loss enters only through the first.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;A concave planar envelope.&lt;/em&gt; Define&lt;/p&gt;
&lt;table id="A11.Ex293" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$q_{m}(t)\;:=\;\begin{cases}t,&amp;amp;0\leq t\leq m,\\ m^{2/3}\,t^{1/3},&amp;amp;m\leq t\leq m^{4},\\ m^{2}\bigl(1+\tfrac{1}{3}\log(t/m^{4})\bigr),&amp;amp;t\geq m^{4}.\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The three pieces agree at $t=m$ and $t=m^{4}\text{,}$ and the right derivative is nonincreasing: it equals $1$ on $[0,m)\text{,}$ falls from $\tfrac{1}{3}$ to $1/(3m^{2})$ across $(m,m^{4})\text{,}$ and continues to decrease as $m^{2}/(3t)$ beyond. Hence $q_{m}$ is continuous, nondecreasing, and concave, with $q_{m}(0)=0\text{;}$ the coefficient $\tfrac{1}{3}$ on the logarithm keeps the derivative continuous at $t=m^{4}\text{,}$ at the price of a factor of three: $m^{2}[1+\log(t/m^{4})]\leq 3\,q_{m}(t)\text{.}$ For every loss of the family, &lt;a href="#Thmtheorem58" title="Proposition 58 (Planar Engine for the Loss Family). ‣ J.7 The Planar Engine Across the Loss Class ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;58&lt;/span&gt;&lt;/a&gt; supplies a horizon-free planar learner whose regret on any $N$-round sequence is at most $C_{\ell}\min\{N,\Psi_{[m]^{2}}(N)\}\text{,}$ hence at most $C_{\ell}^{\prime}\,q_{m}(N)\text{:}$ &lt;a href="#Thmtheorem63" title="Lemma 63 (Envelope Evaluation). ‣ K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;63&lt;/span&gt;&lt;/a&gt; at $d=2$ evaluates the minimum, and each case of $E$ there is at most $3\,q_{m}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS4.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Decomposition.&lt;/em&gt; Write $x=(z,i,j)$ with $z\in[m]^{d-2}$ and $(i,j)\in[m]^{2}\text{,}$ and let $Q_{z}:=\{z\}\times[m]^{2}\text{,}$ an order-isomorphic copy of the plane; the learner runs an independent planar instance on each of the $S:=m^{d-2}$ slices, advancing only the instance indexed by $z_{t}\text{,}$ and $R_{z}$ denotes the regret that instance incurs on its own rounds against $\mathcal{F}_{Q_{z}}^{\uparrow}\text{.}$ Every $f\in\mathcal{F}_{[m]^{d}}^{\uparrow}$ restricts to an isotonic function on each slice, so&lt;/p&gt;
&lt;table id="A11.Ex294" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\min_{f\in\mathcal{F}_{[m]^{d}}^{\uparrow}}\,\sum_{t=1}^{T}\ell\bigl(f(x_{t}),y_{t}\bigr)\;\geq\;\sum_{z}\,\min_{g\in\mathcal{F}_{Q_{z}}^{\uparrow}}\,\sum_{t\,:\,z_{t}=z}\ell\bigl(g(x_{t}),y_{t}\bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and subtracting this from the learner’s cumulative loss, the sum of the per-slice losses, gives&lt;/p&gt;
&lt;table id="A11.Ex295" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\sum_{z}R_{z}\;\leq\;C_{\ell}^{\prime}\sum_{z}q_{m}(T_{z}),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;the second inequality being the planar guarantee applied to the $T_{z}:=|\{t:z_{t}=z\}|$ rounds of slice $z\text{,}$ the slices left unqueried contributing $R_{z}=0=q_{m}(0)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS4.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Recombination.&lt;/em&gt; Concavity and Jensen’s inequality give $\sum_{z}q_{m}(T_{z})\leq S\,q_{m}(T/S)\text{,}$ and the substitution $S=m^{d-2}$ reproduces the three phases: for $T\leq Sm=m^{d-1}\text{,}$ $S\,q_{m}(T/S)=T\text{;}$ for $m^{d-1}\leq T\leq Sm^{4}=m^{d+2}\text{,}$ $S\,q_{m}(T/S)=S^{2/3}m^{2/3}T^{1/3}=m^{2(d-1)/3}\,T^{1/3}\text{;}$ and for $T\geq m^{d+2}\text{,}$ $S\,q_{m}(T/S)=m^{d}(1+\tfrac{1}{3}\log(T/m^{d+2}))\text{.}$ Each case is at most the corresponding case of $E(T)$ in &lt;a href="#Thmtheorem63" title="Lemma 63 (Envelope Evaluation). ‣ K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;63&lt;/span&gt;&lt;/a&gt;, where $c_{d}\,E(T)\leq\min\{T,\Psi_{[m]^{d}}(T)\}\text{,}$ and the regret bound follows with $C_{d,\ell}:=C_{\ell}^{\prime}c_{d}^{-1}\text{.}$ Only the queried slice advances, and each instance runs in $\mathrm{poly}(m,t)$ per round, so the per-round time is $\mathrm{poly}(m,t)\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A11.SS4.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The argument uses no property of the loss beyond the slicewise decomposition of regret, so it transfers to any loss for which a rate-optimal planar learner is available.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A11.SS5" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="rectangles"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;K.5 &lt;/span&gt;Rectangles&lt;/h3&gt;
&lt;div id="A11.SS5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;MacMahon’s box formula &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[MacMahon, &lt;a href="#bib.bib7" title="Combinatory analysis" class="ltx_ref"&gt;1916&lt;/a&gt;]&lt;/cite&gt; counts the order-preserving maps of a rectangle in closed form,&lt;/p&gt;
&lt;table id="A11.Ex296" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Omega([a]\times[b],\,K{+}1)\;=\;\prod_{i=1}^{a}\prod_{j=1}^{b}\frac{K+i+j-1}{i+j-1},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and the count is symmetric in $(a,b,K)\text{,}$ being the number of plane partitions in an $a\times b\times K$ box; &lt;a href="#Thmtheorem4" title="Theorem 4 (MacMahon’s Formula (MacMahon, 1916)). ‣ 3.3 The Three Phases and the Phase Criterion ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; is the case $a=b\text{.}$ Throughout this subsection $1\leq a\leq b\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem65" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 65&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Rectangle Entropy).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem65.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $x\leq y\leq z$ be the sorted values of $\{a,b,K\}\text{.}$ Then, with absolute constants,&lt;/span&gt;&lt;/p&gt;
&lt;table id="A11.Ex297" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H_{[a]\times[b]}(K)\;=\;\Theta\bigl(xy\,[1+\log(z/y)]\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A11.SS5.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;By the box symmetry, $\Omega([a]\times[b],K{+}1)=\Omega([x]\times[z],y{+}1)$ counts the isotonic maps $g:[x]\times[z]\to\{0,\ldots,y\}\text{.}$ For the upper bound, restrict $g$ to its $x$ rows: each row is a nondecreasing $\{0,\ldots,y\}$-valued sequence of length $z\text{,}$ so, dropping the constraints between rows,&lt;/p&gt;
&lt;table id="A11.Ex298" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H\;\leq\;x\log\tbinom{z+y}{y}\;\leq\;2\,xy\,[1+\log(z/y)],$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;using $\binom{z+y}{y}\leq(e(z+y)/y)^{y}$ and $y\leq z\text{.}$ For the lower bound, take logarithms in the product formula for $\Omega([x]\times[z],y{+}1)\text{:}$&lt;/p&gt;
&lt;table id="A11.Ex299" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H\;=\;\sum_{i=1}^{x}\sum_{j=1}^{z}\log\Bigl(1+\frac{y}{i+j-1}\Bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Fix a row $i\leq x\text{;}$ recall $x\leq y\text{.}$ For $j\leq y$ we have $i+j-1&amp;lt;2y\text{,}$ so each of these $y$ terms is at least $\log\tfrac{3}{2}\text{.}$ For $y&amp;lt;j\leq z$ we have $y/(i+j-1)\leq 1$ and $i+j-1&amp;lt;2j\text{,}$ so $\log(1+u)\geq u\log 2$ on $[0,1]$ gives&lt;/p&gt;
&lt;table id="A11.Ex300" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{j=y+1}^{z}\log\Bigl(1+\frac{y}{i+j-1}\Bigr)\;\geq\;\frac{y\log 2}{2}\sum_{j=y+1}^{z}\frac{1}{j}\;\geq\;\frac{y\log 2}{2}\log\frac{z+1}{y+1}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;If $z\geq 4y\text{,}$ then $\log\tfrac{z+1}{y+1}\geq\log\tfrac{z}{2y}\geq\tfrac{1}{2}\log\tfrac{z}{y}\text{;}$ if $z&amp;lt;4y\text{,}$ then $1+\log(z/y)\leq 1+\log 4$ and the first group of terms alone contributes $y\log\tfrac{3}{2}\text{.}$ In either case the row contributes at least $c\,y[1+\log(z/y)]$ with an absolute $c&amp;gt;0\text{,}$ and summing over the $x$ rows completes the proof.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem66" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Proposition 66&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Rectangles).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem66.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $1\leq a\leq b$ and $T\geq 1$ be integers.&lt;/span&gt;&lt;/p&gt;
&lt;ol id="A11.I1" class="ltx_enumerate"&gt;
&lt;li id="A11.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(a)&lt;/span&gt;
&lt;div id="A11.I1.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For every &lt;/span&gt;$K\geq 1$&lt;span class="ltx_text ltx_font_italic"&gt;, with &lt;/span&gt;$x\leq y\leq z$&lt;span class="ltx_text ltx_font_italic"&gt; the sorted values of &lt;/span&gt;$\{a,b,K\}$&lt;span class="ltx_text ltx_font_italic"&gt;, &lt;/span&gt;$H_{[a]\times[b]}(K)=\Theta(xy\,[1+\log(z/y)])$&lt;span class="ltx_text ltx_font_italic"&gt;. Consequently, with &lt;/span&gt;$\tau_{0}:=a(1+\log\tfrac{b}{a})$&lt;span class="ltx_text ltx_font_italic"&gt;, &lt;/span&gt;$\tau_{1}:=a^{4}(1+\log\tfrac{b}{a})$&lt;span class="ltx_text ltx_font_italic"&gt;, and &lt;/span&gt;$\tau_{2}:=ab^{3}$&lt;span class="ltx_text ltx_font_italic"&gt;,&lt;/span&gt;&lt;/p&gt;
&lt;table id="A11.Ex301" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\min\bigl\{T,\Psi_{[a]\times[b]}(T)\bigr\}\;=\;\begin{cases}\Theta(T),&amp;amp;T\lesssim\tau_{0},\\[1.0pt] \Theta\bigl(\bigl(a[1+\log\tfrac{b}{a}]\bigr)^{2/3}\,T^{1/3}\bigr),&amp;amp;\tau_{0}\lesssim T\lesssim\tau_{1},\\[1.0pt] \Theta\bigl(a^{2/3}\,T^{1/3}\,[1+\log(\tau_{2}/T)]^{2/3}\bigr),&amp;amp;\tau_{1}\lesssim T\lesssim\tau_{2},\\[1.0pt] \Theta\bigl(ab\,[1+\log(T/\tau_{2})]\bigr),&amp;amp;T\gtrsim\tau_{2}.\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A11.I1.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(b)&lt;/span&gt;
&lt;div id="A11.I1.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For every loss &lt;/span&gt;$\ell$&lt;span class="ltx_text ltx_font_italic"&gt; as in &lt;/span&gt;&lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref ltx_font_italic"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;&lt;span class="ltx_text ltx_font_italic"&gt;, &lt;/span&gt;$R_{T}^{*}([a]\times[b],\ell)=\Theta\bigl(\min\{T,\Psi_{[a]\times[b]}(T)\}\bigr)$&lt;span class="ltx_text ltx_font_italic"&gt;, with implied constants depending only on the aspect ratio &lt;/span&gt;$b/a$&lt;span class="ltx_text ltx_font_italic"&gt; and the loss parameters.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A11.SS5.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The two degenerations bracket the family: at $a=b$ the crossover collapses ($\tau_{1}=\tau_{2}$) and the display reduces to the three phases of the square, while at $a=1$ the second sector collapses ($\tau_{0}=\tau_{1}$) and the display reduces to the chain’s law, crossover included.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A11.SS5.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;(a).&lt;/em&gt; By &lt;a href="#Thmtheorem65" title="Lemma 65 (Rectangle Entropy). ‣ K.5 Rectangles ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;65&lt;/span&gt;&lt;/a&gt;, $H(K):=H_{[a]\times[b]}(K)$ satisfies, up to absolute constants,&lt;/p&gt;
&lt;table id="A11.Ex302" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H(K)\;\asymp\;\begin{cases}aK\,[1+\log(b/a)],&amp;amp;K\leq a,\\ aK\,[1+\log(b/K)],&amp;amp;a\leq K\leq b,\\ ab\,[1+\log(K/b)],&amp;amp;K\geq b.\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;We evaluate $\min\{T,\Psi\}\text{,}$ $\Psi:=\Psi_{[a]\times[b]}\text{,}$ against the four displayed sectors; all implied constants below are absolute.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS5.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;On the crossover sector write $\lambda_{T}:=1+\log(\tau_{2}/T)\text{,}$ so that $T=\tau_{2}\,e^{1-\lambda_{T}}$ and $a^{2/3}T^{1/3}=ab\,e^{(1-\lambda_{T})/3}\text{;}$ the sector runs over $1\leq\lambda_{T}\leq 1+\log(\tau_{2}/\tau_{1})\text{,}$ whence $\lambda_{T}\leq 3\,[1+\log(b/a)]\text{.}$ The estimates below use the product bound $u+v\geq u^{2/3}v^{1/3}$ on power branches and the two-branch logarithmic comparison of &lt;a href="#Thmtheorem63" title="Lemma 63 (Envelope Evaluation). ‣ K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;63&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS5.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Upper bounds.&lt;/em&gt; For $T\leq\tau_{0}\text{,}$ $\min\{T,\Psi\}\leq T\text{.}$ For $\tau_{0}\leq T\leq\tau_{1}\text{,}$ the choice $K:=\lceil(T/(a[1+\log\tfrac{b}{a}]))^{1/3}\rceil$ lies in $[1,2a]\text{,}$ where $H(K)\lesssim aK[1+\log(b/a)]$ (on $a\leq K\leq 2a$ the middle form is at most this), and balancing gives $\Psi\lesssim(a[1+\log\tfrac{b}{a}])^{2/3}T^{1/3}\text{.}$ For $\tau_{1}\leq T\leq\tau_{2}\text{,}$ take $K:=\max\{a,\,\lceil(T/(a\lambda_{T}))^{1/3}\rceil\}\text{.}$ If the maximum is $a\text{,}$ then $T\leq a^{4}\lambda_{T}$ and $\Psi\leq 2H(a)+T/(4a^{2})\lesssim\tau_{1}/a^{2}+T/a^{2}\lesssim T/a^{2}\leq a^{2/3}T^{1/3}\lambda_{T}^{2/3}\text{,}$ the last step being $T\leq a^{4}\lambda_{T}$ again. Otherwise $K\leq b+1\leq 2b\text{,}$ since $T/(a\lambda_{T})\leq b^{3}\text{,}$ and $H(K)\lesssim aK\lambda_{T}$ on $[a,2b]\text{:}$ for $K\leq b$ this follows from $b/K\leq(ab^{3}\lambda_{T}/T)^{1/3}\text{,}$ which gives $1+\log(b/K)\leq 1+\tfrac{1}{3}(\lambda_{T}-1)+\tfrac{1}{3}\log\lambda_{T}\leq 2\lambda_{T}\text{,}$ and for $b&amp;lt;K\leq 2b$ the deep form is $\lesssim ab\leq aK\lambda_{T}\text{.}$ Balancing gives $\Psi\lesssim a^{2/3}T^{1/3}\lambda_{T}^{2/3}\text{.}$ For $T\geq\tau_{2}\text{,}$ the choice $K:=\lceil(T/(ab))^{1/2}\rceil\geq b$ gives $1+\log(K/b)\lesssim 1+\log(T/\tau_{2})$ and $T/K^{2}\leq ab\text{,}$ so $\Psi\lesssim ab[1+\log(T/\tau_{2})]\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS5.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Lower bounds.&lt;/em&gt; For $T\leq\tau_{0}\text{:}$ $\Psi\geq 2H(1)\gtrsim a[1+\log(b/a)]=\tau_{0}\geq T\text{,}$ so $\min\{T,\Psi\}\gtrsim T\text{.}$ On $\tau_{0}\leq T\leq\tau_{1}\text{:}$ the branch $K\leq a$ gives $2H(K)+T/(4K^{2})\gtrsim(aK[1+\log\tfrac{b}{a}])^{2/3}(T/K^{2})^{1/3}=(a[1+\log\tfrac{b}{a}])^{2/3}T^{1/3}\text{,}$ and the branches $K\geq a$ give $2H(K)\geq 2H(a)\gtrsim a^{2}[1+\log\tfrac{b}{a}]\geq(a[1+\log\tfrac{b}{a}])^{2/3}T^{1/3}\text{,}$ by $T\leq\tau_{1}\text{.}$ On $\tau_{1}\leq T\leq\tau_{2}\text{,}$ the target is $a^{2/3}T^{1/3}\lambda_{T}^{2/3}=ab\,e^{(1-\lambda_{T})/3}\lambda_{T}^{2/3}\text{,}$ which is at most $1.2\,ab\text{,}$ the function $u\mapsto e^{(1-u)/3}u^{2/3}$ being maximized at $u=2\text{.}$ The branch $K\leq a$ gives $T/(4K^{2})\geq T/(4a^{2})\geq\tfrac{1}{4}\,a^{2/3}T^{1/3}\lambda_{T}^{2/3}\,(T/(a^{4}\lambda_{T}))^{2/3}\gtrsim a^{2/3}T^{1/3}\lambda_{T}^{2/3}\text{,}$ since $T\geq\tau_{1}\geq a^{4}\lambda_{T}/3\text{.}$ The branch $K\geq b$ gives $2H(K)\geq 2H(b)\gtrsim ab\text{,}$ which dominates the target. On the branch $a\leq K\leq b\text{,}$ write $\lambda(K):=1+\log(b/K)\text{.}$ If $\lambda(K)\geq\lambda_{T}/6\text{,}$ then $2H(K)+T/(4K^{2})\gtrsim(aK\lambda(K))^{2/3}(T/K^{2})^{1/3}=a^{2/3}T^{1/3}\lambda(K)^{2/3}\gtrsim a^{2/3}T^{1/3}\lambda_{T}^{2/3}\text{.}$ If $\lambda(K)&amp;lt;\lambda_{T}/6\text{,}$ then $K&amp;gt;b\,e^{1-\lambda_{T}/6}\text{,}$ so&lt;/p&gt;
&lt;table id="A11.Ex303" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$2H(K)\;\gtrsim\;aK\;\geq\;ab\,e^{1-\lambda_{T}/6}\;\gtrsim\;ab\,e^{(1-\lambda_{T})/3}\,\lambda_{T}^{2/3},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;the last step because $e^{u/6}\geq 0.7\,u^{2/3}$ for all $u\geq 1\text{.}$ On $T\geq\tau_{2}\text{:}$ the branches $K\leq b$ give $T/(4K^{2})\geq T/(4b^{2})=\tfrac{1}{4}\,ab\,(T/\tau_{2})\geq\tfrac{1}{4}\,ab\,[1+\log(T/\tau_{2})]\text{,}$ and the branch $K\geq b$ repeats the deep-regime two-branch comparison of &lt;a href="#Thmtheorem63" title="Lemma 63 (Envelope Evaluation). ‣ K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;63&lt;/span&gt;&lt;/a&gt; with $ab\text{,}$ $T/\tau_{2}\text{,}$ and $K/b$ in place of $m^{d}\text{,}$ $T/m^{d+2}\text{,}$ and $K/m\text{.}$ Finally, the minimum with $T$ preserves each order. In the second sector, $(a[1{+}\log\tfrac{b}{a}])^{2/3}T^{1/3}\leq T$ amounts to $T\geq\tau_{0}\text{;}$ in the fourth, $ab[1+\log(T/\tau_{2})]\leq ab\,(T/\tau_{2})\leq T\text{;}$ and in the third, $a^{2/3}T^{1/3}\lambda_{T}^{2/3}=(a\lambda_{T}/T)^{2/3}\,T\leq 3^{2/3}\,T\text{,}$ by $T\geq\tau_{1}\geq a^{4}\lambda_{T}/3\text{,}$ so the truncation costs at most that absolute factor. This proves (a).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS5.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;(b).&lt;/em&gt; Fix the aspect ratio $\rho:=b/a\text{;}$ all constants below depend on $\rho$ only. The upper bound is &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; or &lt;a href="#Thmtheorem55" title="Theorem 55 (Entropic Upper Bound). ‣ J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;55&lt;/span&gt;&lt;/a&gt; with part (a), together with $R_{T}\leq\Lambda T\text{.}$ For the lower bound under the squared loss, note first that $\mathrm{rk}(i,j):=i+j-2$ has level sizes $|A_{s}|=\min\{s+1,\,a,\,a+b-1-s\}\text{,}$ so $|A_{s}|\geq\lceil a/2\rceil$ for the $a+b+1-2\lceil a/2\rceil\geq b$ consecutive values $s\in[\lceil a/2\rceil-1,\,a+b-1-\lceil a/2\rceil]\text{.}$ &lt;a href="#Thmtheorem59" title="Lemma 59 (Rank-Level Lower Bound). ‣ K.1 The Two Mechanisms in General Form ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;59&lt;/span&gt;&lt;/a&gt; therefore gives&lt;/p&gt;
&lt;table id="A11.Ex304" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}([a]\times[b])\;\geq\;\frac{1-\sqrt{2/3}}{16}\,\min\Bigl\{\frac{aK}{2},\;\frac{T}{K^{2}}\Bigr\},\qquad 1\leq K\leq b.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;If $a+b\geq 3\text{,}$ the map $x\mapsto\tfrac{1}{3}+\mathrm{rk}(x)/(3(a+b-2))$ is a separated core with $\varepsilon:=1/(12(a+b-2))\text{,}$ and &lt;a href="#Thmtheorem60" title="Lemma 60 (Separated-Core Lower Bound). ‣ K.1 The Two Mechanisms in General Form ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;60&lt;/span&gt;&lt;/a&gt; with $n=ab$ and $(a+b-2)^{2}\leq 4b^{2}$ gives, for $T\geq ab\text{,}$&lt;/p&gt;
&lt;table id="A11.Ex305" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}([a]\times[b])\;\geq\;\frac{3}{16}\,ab\log\Bigl(1+\frac{T}{2160\,ab^{3}}\Bigr);$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;if $a=b=1\text{,}$ the same lemma with the constant core $\tfrac{1}{2}$ and $\varepsilon=\tfrac{1}{12}$ gives $R_{T}^{*}\geq\tfrac{3}{16}\log(1+T/540)\text{,}$ which is the displayed bound up to absolute constants.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS5.p9" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The merging follows the proof of &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;. Suppose $T\leq 2160\,ab^{3}\text{.}$ At a fixed ratio, $H(K)\lesssim_{\rho}aK$ for all $K\leq b\text{,}$ since $1+\log(b/K)\leq 1+\log\rho$ there. For $K&amp;gt;b\text{,}$ $\min\{H(K),T/K^{2}\}\leq T/b^{2}\lesssim_{\rho}\min\{ab,\,T/b^{2}\}\text{,}$ in both cases of the minimum because $T\leq 2160\,ab^{3}\text{.}$ &lt;a href="#Thmtheorem64" title="Lemma 64 (Envelope Collapse). ‣ K.3 The Grid Rate ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;64&lt;/span&gt;&lt;/a&gt; therefore bounds $\min\{T,\Psi\}$ by $C_{\rho}\sup_{K\leq b}\min\{aK,T/K^{2}\}\text{,}$ and the rank-level bound matches the supremum. Suppose instead $T&amp;gt;2160\,ab^{3}\text{.}$ Part (a) gives $\min\{T,\Psi\}\asymp_{\rho}ab\,[1+\log(T/\tau_{2})]\text{,}$ and the core bound matches it by the concavity comparison of logarithms in the proof of &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;. For general losses, &lt;a href="#Thmtheorem52" title="Lemma 52 (Loss Substitution). ‣ J.3 Loss Substitutions in the Lower Bounds ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;52&lt;/span&gt;&lt;/a&gt; multiplies both bounds by $\alpha$ and covers the entropic loss with $\alpha=2\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A11.SS5.p10" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;At a general aspect ratio the constructions above still match the fourth sector in full, and in the second and third sectors the rank-level bound $\sup_{K\leq b}\min\{aK/2,\,T/K^{2}\}\asymp a^{2/3}T^{1/3}$ falls short of the envelope of part (a) by the factors $[1+\log(b/a)]^{2/3}$ and $[1+\log(\tau_{2}/T)]^{2/3}\text{.}$ The fixed-ratio hypothesis of part (b) makes both factors constants. The same phenomenon appears on the chain, the case $a=1\text{,}$ where reaching the logarithmic factor takes the bisection construction of &lt;a href="#A9" title="Appendix I Chain Complete Minimax ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;I&lt;/span&gt;&lt;/a&gt; in place of a single family of levels.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A11.SS6" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="height-two-posets"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;K.6 &lt;/span&gt;Height-Two Posets&lt;/h3&gt;
&lt;div id="A11.SS6.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The following proposition is the statement invoked in &lt;a href="#S3.SS3" title="3.3 The Three Phases and the Phase Criterion ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem67" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Proposition 67&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Height-Two Posets).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem67.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $\mathcal{P}$ be a nonempty finite poset of height at most two, $n:=|\mathcal{P}|\text{.}$ Then $H_{\mathcal{P}}(K)=\Theta(n\log(K{+}1))\text{,}$ and for every loss $\ell$ as in &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; and every $T\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A11.Ex306" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}(\mathcal{P},\ell)\;=\;\Theta\bigl(n\log(1+T/n)\bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;with implied constants depending only on the loss parameters.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A11.SS6.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Entropy.&lt;/em&gt; Let $A$ be the set of minimal elements and $B:=\mathcal{P}\setminus A\text{.}$ Both are antichains: a two-element chain inside $B$ would extend, below its bottom element, to a three-element chain. Moreover every strict relation runs from $A$ to $B\text{.}$ One of the two antichains has at least $n/2$ elements, and any map $g$ on it extends isotonically to all of $\mathcal{P}\text{:}$ from $A$ by $v\mapsto\max(\{g(u):u\prec v\}\cup\{0\})\text{,}$ and from $B$ by $u\mapsto\min(\{g(v):u\prec v\}\cup\{1\})\text{.}$ Hence $\Omega(\mathcal{P},K{+}1)\geq(K{+}1)^{n/2}\text{,}$ while $(K{+}1)^{n}$ is a trivial upper bound, so $H_{\mathcal{P}}(K)=\Theta(n\log(K{+}1))\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS6.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Envelope.&lt;/em&gt; We claim $\min\{T,\Psi_{\mathcal{P}}(T)\}=\Theta(n\log(1+T/n))\text{.}$ From above, if $T\leq n$ then $\min\{T,\Psi\}\leq T\leq\tfrac{1}{\log 2}\,n\log(1+T/n)\text{,}$ by concavity of $\log(1+\cdot)\text{;}$ if $T\geq n\text{,}$ the choice $K:=\lceil(T/n)^{1/2}\rceil$ gives $\Psi\leq 2H(K)+T/(4K^{2})\lesssim n\log(1+T/n)\text{.}$ From below, write $x:=T/n\text{,}$ so that every $K$ satisfies&lt;/p&gt;
&lt;table id="A11.Ex307" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$2H(K)+\frac{T}{4K^{2}}\;\gtrsim\;n\log(K{+}1)\,+\,\frac{nx}{4K^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;If $\log(K{+}1)\geq\tfrac{1}{4}\log(1+x)\text{,}$ the first term alone is $\gtrsim n\log(1+x)\text{.}$ Otherwise $(K{+}1)^{2}\leq\sqrt{1+x}\text{,}$ and the second term is at least&lt;/p&gt;
&lt;table id="A11.Ex308" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{nx}{4\sqrt{1+x}}\;\geq\;\frac{n}{8}\sqrt{1+x}\;\geq\;c\,n\log(1+x),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;using $x\geq(1+x)/2$ for $x\geq 1$ and $\sqrt{u}\geq\tfrac{e}{2}\log u$ for $u\geq 1\text{;}$ the case $x\leq 1$ follows from $2H(1)\gtrsim n\gtrsim n\log(1+x)\text{.}$ Finally $n\log(1+T/n)\leq T$ always, so the minimum with $T$ preserves the order.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS6.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Lower bound.&lt;/em&gt; For $T\geq n\text{:}$ the map $b$ with $b\equiv\tfrac{1}{3}$ on $A$ and $b\equiv\tfrac{2}{3}$ on $B$ is a separated core with $\varepsilon=\tfrac{1}{12}\text{,}$ since every strict relation runs from $A$ to $B\text{,}$ and &lt;a href="#Thmtheorem60" title="Lemma 60 (Separated-Core Lower Bound). ‣ K.1 The Two Mechanisms in General Form ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;60&lt;/span&gt;&lt;/a&gt; gives&lt;/p&gt;
&lt;table id="A11.Ex309" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}(\mathcal{P})\;\geq\;\frac{3}{16}\,n\log\Bigl(1+\frac{T}{540\,n}\Bigr)\;\geq\;\frac{3}{16\cdot 540}\,n\log(1+T/n),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;by the concavity comparison of logarithms in the proof of &lt;a href="#Thmtheorem2" title="Theorem 2 (Main Theorem). ‣ 3.2 The Main Theorem ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;, valid for every $x\geq 0\text{.}$ For $T\leq n\text{:}$ the larger of the two antichains, $W\text{,}$ has $|W|\geq n/2\text{,}$ and every $\{\tfrac{1}{4},\tfrac{3}{4}\}$-valued map on $W$ extends isotonically by the displayed formulas (with the default values $\tfrac{1}{4}$ and $\tfrac{3}{4}$ in place of $0$ and $1$), so &lt;a href="#Thmtheorem52" title="Lemma 52 (Loss Substitution). ‣ J.3 Loss Substitutions in the Lower Bounds ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;52&lt;/span&gt;&lt;/a&gt;(c) gives $R_{T}^{*}(\mathcal{P},\ell)\geq\tfrac{\alpha}{16}\min\{T,n/2\}\geq\tfrac{\alpha}{32}\,T\gtrsim\alpha\,n\log(1+T/n)\text{.}$ For $T\geq n$ and a general loss of the family, &lt;a href="#Thmtheorem52" title="Lemma 52 (Loss Substitution). ‣ J.3 Loss Substitutions in the Lower Bounds ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;52&lt;/span&gt;&lt;/a&gt;(b) multiplies the core bound by $\alpha\text{,}$ and $\alpha=2$ covers the entropic loss.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A11.SS6.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Upper bound.&lt;/em&gt; &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; or &lt;a href="#Thmtheorem55" title="Theorem 55 (Entropic Upper Bound). ‣ J.4 The Entropic Loss ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;55&lt;/span&gt;&lt;/a&gt; with the entropy and envelope computations above, together with $R_{T}\leq\Lambda T\text{,}$ gives $R_{T}^{*}(\mathcal{P},\ell)\lesssim\min\{T,\Psi_{\mathcal{P}}(T)\}\asymp n\log(1+T/n)\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A11.SS6.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Follow-the-Leader already attains this rate under the squared loss, as asserted in &lt;a href="#S3.SS3" title="3.3 The Three Phases and the Phase Criterion ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt;. By &lt;a href="#Thmtheorem45" title="Theorem 45 (FTL Upper Bound on General Posets). ‣ Setup. ‣ Appendix H Follow-The-Leader on General Posets ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;45&lt;/span&gt;&lt;/a&gt;, $R_{T}^{\mathrm{FTL}}\leq 2\sum_{x}H(N_{T}(x))$ with $H(k)$ the $k$-th harmonic number; writing $q:=|\{x:N_{T}(x)\geq 1\}|\leq\min\{n,T\}$ and using $H(k)\leq 1+\log k$ together with Jensen’s inequality for the concave $\log(1+\cdot)\text{,}$&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A13.EGx7"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A11.Ex310"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A11.Ex311"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle R_{T}^{\mathrm{FTL}}\;\leq\;2q\,\bigl(1+\log(1+T/q)\bigr)\; &amp;amp; \displaystyle\leq\;2\min\{n,T\}\,\bigl(1+\log(1+T/\min\{n,T\})\bigr) \\
&amp;amp; \displaystyle=\;O\bigl(n\log(1+T/n)\bigr),
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;the middle inequality because $q\mapsto q(1+\log(1+T/q))$ is nondecreasing.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A12" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="metric-entropy-and-the-nonparametric-position"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix L &lt;/span&gt;Metric Entropy and the Nonparametric Position&lt;/h2&gt;
&lt;div id="A12.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This appendix proves the entropy sandwich and its specializations (&lt;a href="#A12.SS1" title="L.1 The Entropy Sandwich ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;L.1&lt;/span&gt;&lt;/a&gt;), the identity between sequential and metric covering numbers (&lt;a href="#A12.SS2" title="L.2 Sequential Covering Numbers ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;L.2&lt;/span&gt;&lt;/a&gt;), and the comparison with the generic upper-bound machinery (&lt;a href="#A12.SS3" title="L.3 One Scale Versus Chaining ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;L.3&lt;/span&gt;&lt;/a&gt;); it then details why the generic lower-bound route needs the class-specific ingredient of &lt;a href="#S3.SS1" title="3.1 Two Mechanisms ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt; (&lt;a href="#A12.SS4" title="L.4 The Generic Lower-Bound Route ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;L.4&lt;/span&gt;&lt;/a&gt;), and where the isotonic classes sit among the classical smoothness scales (&lt;a href="#A12.SS5" title="L.5 Embeddings and the Smoothness Ladder ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Sections&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;L.5&lt;/span&gt;&lt;/a&gt; and &lt;a href="#A12.SS6" title="L.6 BV and Besov ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;L.6&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A12.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-entropy-sandwich"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;L.1 &lt;/span&gt;The Entropy Sandwich&lt;/h3&gt;
&lt;div id="Thmtheorem68" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Proposition 68&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Entropy Equivalence).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem68.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $\mathcal{P}$ be a finite poset. For $0&amp;lt;\varepsilon&amp;lt;\tfrac{1}{2}\text{,}$ set $K_{+}:=\lceil\tfrac{1}{2\varepsilon}\rceil$ and $K_{-}:=K_{+}-1\geq 1\text{.}$ Then&lt;/span&gt;&lt;/p&gt;
&lt;table id="A12.Ex312" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H_{\mathcal{P}}(K_{-})\;\leq\;\log N_{\infty}\bigl(\varepsilon,\mathcal{F}_{\mathcal{P}}^{\uparrow}\bigr)\;\leq\;H_{\mathcal{P}}(K_{+}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A12.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For the upper bound, take as cover the isotonic $G_{K_{+}}$-valued functions, of which there are $\Omega(\mathcal{P},K_{+}{+}1)\text{:}$ nearest-grid rounding $q$ onto $G_{K_{+}}$ is nondecreasing, so $q\circ f$ is a member for every $f\in\mathcal{F}_{\mathcal{P}}^{\uparrow}\text{,}$ and $\|q\circ f-f\|_{\infty}\leq\tfrac{1}{2K_{+}}\leq\varepsilon\text{.}$ For the lower bound, two distinct isotonic $G_{K_{-}}$-valued functions differ at some point by at least $1/K_{-}\text{,}$ and $K_{-}&amp;lt;\tfrac{1}{2\varepsilon}$ gives $1/K_{-}&amp;gt;2\varepsilon\text{;}$ a ball of radius $\varepsilon$ has diameter $2\varepsilon$ and therefore contains at most one of them, so every $\varepsilon$-cover, proper or not, has at least $\Omega(\mathcal{P},K_{-}{+}1)$ members.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A12.SS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The grid specialization is displayed in &lt;a href="#S2.SS2" title="2.2 The Order Polynomial Is the Metric Entropy ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt;. On the chain, $\Omega([n],K{+}1)=\binom{n+K}{K}$ gives, by the standard binomial estimates, $H_{[n]}(K)=\Theta(K\log(en/K))$ for $K\leq n$ and $\Theta(n\log(eK/n))$ for $K\geq n\text{;}$ substituting $K_{\pm}\asymp 1/(2\varepsilon)\text{,}$&lt;/p&gt;
&lt;table id="A12.Ex313" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log N_{\infty}\bigl(\varepsilon,\mathcal{F}_{[n]}^{\uparrow}\bigr)\;=\;\Theta\bigl(\varepsilon^{-1}\log(en\varepsilon)\bigr),\qquad\varepsilon\gtrsim 1/n,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;the logarithmic correction asserted in &lt;a href="#S2.SS2" title="2.2 The Order Polynomial Is the Metric Entropy ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt;. This matches the covering entropy used on the chain by &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Kotłowski&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt; [&lt;a href="#bib.bib2" title="Online isotonic regression" class="ltx_ref"&gt;2016&lt;/a&gt;]&lt;/cite&gt;, and the logarithm is exactly what the coarse-scale grid entropy lacks.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A12.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="sequential-covering-numbers"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;L.2 &lt;/span&gt;Sequential Covering Numbers&lt;/h3&gt;
&lt;div id="A12.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Sequential covering numbers refine metric ones to the tree setting of adversarial prediction: given a $\mathcal{P}$-valued complete binary tree $\mathbf{x}$ of depth $h\text{,}$ a set $V$ of $\mathbb{R}$-valued trees is a sequential $\varepsilon$-cover if for every $f\in\mathcal{F}_{\mathcal{P}}^{\uparrow}$ and every path, some $v\in V$ tracks $f$ within $\varepsilon$ at every step along that path; $\mathcal{N}_{\infty}(\varepsilon,\mathcal{F}_{\mathcal{P}}^{\uparrow},h)$ is the largest, over $\mathbf{x}\text{,}$ of the smallest such $V$ &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[Rakhlin and Sridharan, &lt;a href="#bib.bib16" title="Online non-parametric regression" class="ltx_ref"&gt;2014&lt;/a&gt;]&lt;/cite&gt;. For isotonic classes the refinement collapses.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem69" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Proposition 69&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Sequential Equals Metric).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem69.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For every finite poset $\mathcal{P}\text{,}$ every $\varepsilon&amp;gt;0\text{,}$ and every $h\geq|\mathcal{P}|\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A12.Ex314" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{N}_{\infty}\bigl(\varepsilon,\mathcal{F}_{\mathcal{P}}^{\uparrow},h\bigr)\;=\;N_{\infty}\bigl(\varepsilon,\mathcal{F}_{\mathcal{P}}^{\uparrow}\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A12.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For the upper bound, let $\mathcal{N}$ be a sup-norm $\varepsilon$-cover and, for each $g\in\mathcal{N}\text{,}$ form the tree whose value at every node of $\mathbf{x}$ is $g$ evaluated at that node’s query point. Along any path, $|g(x_{t})-f(x_{t})|\leq\|g-f\|_{\infty}\leq\varepsilon$ whenever $g$ covers $f\text{,}$ so these $|\mathcal{N}|$ trees form a sequential cover of every $\mathbf{x}\text{.}$ For the lower bound, choose $\mathbf{x}$ whose first $|\mathcal{P}|$ levels are constant, each level querying the next point of a fixed enumeration of $\mathcal{P}\text{,}$ which $h\geq|\mathcal{P}|$ permits. Restricted to any one path, each covering tree is a vector in $\mathbb{R}^{\mathcal{P}}\text{,}$ and clipping its coordinates to $[0,1]$ does not increase its distance to any $f\in\mathcal{F}_{\mathcal{P}}^{\uparrow}\text{;}$ the covering property then states that every $f$ lies within sup-norm $\varepsilon$ of one of these clipped vectors, so any sequential cover of this $\mathbf{x}$ has at least $N_{\infty}(\varepsilon,\mathcal{F}_{\mathcal{P}}^{\uparrow})$ elements.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A12.SS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For horizons of at least $|\mathcal{P}|\text{,}$ the sequential side therefore operates on exactly the entropy of &lt;a href="#Thmtheorem68" title="Proposition 68 (Entropy Equivalence). ‣ L.1 The Entropy Sandwich ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;68&lt;/span&gt;&lt;/a&gt; and offers no refinement over it for this class.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A12.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="one-scale-versus-chaining"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;L.3 &lt;/span&gt;One Scale Versus Chaining&lt;/h3&gt;
&lt;div id="A12.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;With the entropy supplied, the generic single-scale recipe runs exponential weights over an $\varepsilon$-net and pays linearly for transferring the comparator: $|(\hat{f}(x)-y)^{2}-(f(x)-y)^{2}|\leq 2|\hat{f}(x)-f(x)|\text{,}$ so&lt;/p&gt;
&lt;table id="A12.Ex315" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\inf_{\varepsilon&amp;gt;0}\,\bigl\{2\log N_{\infty}(\varepsilon,\mathcal{F}_{\mathcal{P}}^{\uparrow})+2T\varepsilon\bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;On $[m]^{2}$ at coarse scales this is $\inf_{\varepsilon}\Theta(m/\varepsilon+T\varepsilon)=\Theta(\sqrt{mT})\text{,}$ the optimizer $\varepsilon^{*}\asymp\sqrt{m/T}$ staying above $1/m$ exactly for $T\lesssim m^{3}\text{;}$ the level-set route replaces the linear transfer term by the quadratic $T\varepsilon^{2}$ of &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; and reaches $m^{2/3}T^{1/3}\text{,}$ a polynomial factor $(T/m)^{1/6}$ below. Past $T\asymp m^{3}$ the optimizer enters the fine regime and the gap narrows, reaching a logarithmic factor at $T\asymp m^{4}\text{.}$ The coarse-scale comparison is sharper than a coincidence: $\sqrt{mT}$ is exactly the minimax rate of the absolute loss on $[m]^{2}$ at these horizons (&lt;a href="#S4" title="4 The Lipschitz Boundary ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;), a loss under which no first-order cancellation is available, so the generic bound is not loose in general; it is loose here by precisely the amount the level-set structure recovers.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A12.SS3.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Chaining is the generic device that upgrades the linear transfer term. For sup-norm entropy $\asymp C\varepsilon^{-p}$ with $p&amp;lt;2\text{,}$ the chaining algorithm of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Gaillard and Gerchinovitz [&lt;a href="#bib.bib23" title="A chaining algorithm for online nonparametric regression" class="ltx_ref"&gt;2015&lt;/a&gt;]&lt;/cite&gt; attains regret of order $C^{2/(p+2)}\,T^{p/(p+2)}\text{;}$ here $p=1$ and $C\asymp_{d}m^{d-1}\text{,}$ so chaining also reaches $m^{2(d-1)/3}T^{1/3}$ once &lt;a href="#Thmtheorem68" title="Proposition 68 (Entropy Equivalence). ‣ L.1 The Entropy Sandwich ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;68&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmtheorem62" title="Lemma 62 (Grid Entropy). ‣ K.2 Grid Entropy ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;62&lt;/span&gt;&lt;/a&gt; are supplied. The generic route ends there: the entropy estimate, the matching lower bounds, and a polynomial-time implementation are this paper’s, and at scale $\varepsilon=1/K$ with $K\lesssim m$ the covers involved have cardinality $e^{\Theta_{d}(m^{d-1}K)}\text{.}$ &lt;a href="#alg2" title="In Figure 2 ‣ Generalized experts and the surrogate. ‣ 5.2 Surrogate Threshold-Indexed Exponential Weights ‣ 5 Polynomial-Time Algorithms ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Algorithm&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; is the efficient substitute, and its efficiency comes from never materializing a cover: layers, surrogate, and the upset dynamic program replace enumeration by inference.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A12.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-generic-lower-bound-route"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;L.4 &lt;/span&gt;The Generic Lower-Bound Route&lt;/h3&gt;
&lt;div id="A12.SS4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This subsection details the comparison summarized in &lt;a href="#S3.SS1" title="3.1 Two Mechanisms ‣ 3 Matching Lower Bounds and the Characterization ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt;. Call a set of points $x_{1},\ldots,x_{D}\in\mathcal{P}$ &lt;em class="ltx_emph ltx_font_italic"&gt;$\beta$-shattered with witnesses&lt;/em&gt; $s_{1},\ldots,s_{D}$ if for every sign pattern $\sigma\in\{\pm 1\}^{D}$ some $f\in\mathcal{F}_{\mathcal{P}}^{\uparrow}$ has $\sigma_{i}(f(x_{i})-s_{i})\geq\beta/2$ for all $i\text{;}$ $\mathrm{fat}_{\beta}$ denotes the largest such $D\text{.}$ This is the static form of the shattering behind the sequential machinery; constant trees show that a statically shattered set is shattered in the tree sense as well, so static lower bounds transfer upward.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A12.SS4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The generic route to lower bounds &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[Rakhlin and Sridharan, &lt;a href="#bib.bib16" title="Online non-parametric regression" class="ltx_ref"&gt;2014&lt;/a&gt;, Theorem 3]&lt;/cite&gt; converts sequential fat-shattering into regret for entropy growth $p\in(0,2]\text{,}$ but the statement concerns a modified class: its proof adjoins to the class, for each shattered set, external functions that realize the shattering inequalities with equality, and the resulting bound holds for the augmented class. For a fixed target class this yields nothing, since the adjoined functions need not be isotonic. The class-specific ingredient the route asks for is a family, inside the class, realizing a shattering with equalities and with independent coordinates. The rank-level family of &lt;a href="#Thmtheorem59" title="Lemma 59 (Rank-Level Lower Bound). ‣ K.1 The Two Mechanisms in General Form ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;59&lt;/span&gt;&lt;/a&gt; is such a family, and it also settles the fat dimension at coarse scales: run the construction with $K:=\lfloor 1/(2\beta)\rfloor$ layers on central levels of size at least $m/4$ (&lt;a href="#Thmtheorem61" title="Lemma 61 (Central Rank Levels). ‣ K.2 Grid Entropy ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;61&lt;/span&gt;&lt;/a&gt;) and amplitude $\beta$ per layer, which its validity and isolation arguments do not constrain. The probed values $\tfrac{1}{4}+(r-1)\beta+\beta\theta$ then sit at exactly $\pm\beta/2$ around the witnesses $\tfrac{1}{4}+(r-\tfrac{1}{2})\beta\text{,}$ one independent bit per probe, so&lt;/p&gt;
&lt;table id="A12.Ex316" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathrm{fat}_{\beta}\bigl(\mathcal{F}_{[m]^{2}}^{\uparrow}\bigr)\;\geq\;\frac{m}{16\beta}\qquad\Bigl(\frac{1}{m}\leq\beta\leq\frac{1}{2}\Bigr);$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;in the other direction, the $2^{D}$ functions attached to a shattered set are pairwise $\beta$-separated in sup norm, so $\mathrm{fat}_{\beta}\leq\log_{2}N_{\infty}(\beta/3,\mathcal{F}_{\mathcal{P}}^{\uparrow})\text{.}$ Evaluated through &lt;a href="#Thmtheorem68" title="Proposition 68 (Entropy Equivalence). ‣ L.1 The Entropy Sandwich ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;68&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmtheorem62" title="Lemma 62 (Grid Entropy). ‣ K.2 Grid Entropy ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;62&lt;/span&gt;&lt;/a&gt;, the packing bound meets the display at coarse scales, giving $\mathrm{fat}_{\beta}=\Theta(m/\beta)$ for $\beta\gtrsim 1/m\text{,}$ and reads $\mathrm{fat}_{\beta}=O(m^{2}[1+\log\tfrac{1}{m\beta}])$ below.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A12.SS4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;With the coarse-scale law inserted, the generic computation returns the right order and the right window: optimizing the shattering bound over the scale gives $\beta^{*}\asymp(m/T)^{1/3}$ and a lower bound of order $m^{2/3}T^{1/3}\text{,}$ and its two feasibility conditions, $\beta^{*}\gtrsim 1/m$ and a horizon exceeding the fat dimension at $\beta^{*}\text{,}$ recover $T\lesssim m^{4}$ and $T\gtrsim m\text{.}$ All of this, however, is for the modified class; running the argument inside $\mathcal{F}_{\mathcal{P}}^{\uparrow}$ is what the equality family supplies, and once the family is in hand, the direct posterior argument of &lt;a href="#Thmtheorem59" title="Lemma 59 (Rank-Level Lower Bound). ‣ K.1 The Two Mechanisms in General Form ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;59&lt;/span&gt;&lt;/a&gt; is shorter and carries explicit constants. Two further points favor the direct route. On constants, the framework itself is not the obstacle: its authors note that “it is straightforward to allow constants in this definition” &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[Rakhlin and Sridharan, &lt;a href="#bib.bib16" title="Online non-parametric regression" class="ltx_ref"&gt;2014&lt;/a&gt;]&lt;/cite&gt;, and the augmentation behind the shattering-to-regret step preserves the order of the fat dimension; what is missing is only the class-specific estimate above. On logarithms, the generic conversion from entropy to fat dimension costs a factor logarithmic in the scale, and the generic rate statements carry unspecified logarithmic factors, so a conclusion of the form “Phase 1 carries no logarithmic correction” is out of reach along the black-box route; the direct construction gives the log-free fat bound and, with it, the sharp phase boundaries.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A12.SS4.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;At fine scales the situation reverses. The packing bound above reads $m^{2}[1+\log\tfrac{1}{m\beta}]\text{,}$ and matching it is a sequential affair: the candidate capacity comes from re-querying a coordinate along a bisection tree, and there the witnesses are met with inequalities, since after the first equality the cell’s value is pinned; an equality family at depth beyond one is therefore unavailable inside the class. The interior cube replaces it at that scale: a continuous prior needs no equalities, factorizes across cells, and yields the logarithmic law directly for $\mathcal{F}_{\mathcal{P}}^{\uparrow}$ (&lt;a href="#Thmtheorem60" title="Lemma 60 (Separated-Core Lower Bound). ‣ K.1 The Two Mechanisms in General Form ‣ Appendix K Structured Posets: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;60&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A12.SS5" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="embeddings-and-the-smoothness-ladder"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;L.5 &lt;/span&gt;Embeddings and the Smoothness Ladder&lt;/h3&gt;
&lt;div id="A12.SS5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The comparison with smoothness classes is made literal by extension operators. For integer $s\geq 1\text{,}$ write $|F|_{B^{s}}$ for the Hölder–Zygmund seminorm $\sup_{t&amp;gt;0}t^{-s}\omega_{s+1}(F,t)$ on $[0,1]^{2}\text{,}$ where $\omega_{k}$ is the $k$-th modulus of smoothness in sup norm; $B^{1}$ contains the Lipschitz functions.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem70" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Proposition 70&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Smoothness Ladder).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem70.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Identify $[m]^{2}$ with the grid $\{0,h,\ldots,1\}^{2}\text{,}$ $h:=1/(m-1)\text{,}$ and fix an integer $s\geq 1$ with $m&amp;gt;s+2\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;ol id="A12.I1" class="ltx_enumerate"&gt;
&lt;li id="A12.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(a)&lt;/span&gt;
&lt;div id="A12.I1.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Every &lt;/span&gt;$f\in\mathcal{F}_{[m]^{2}}^{\uparrow}$&lt;span class="ltx_text ltx_font_italic"&gt; extends to a coordinatewise nondecreasing &lt;/span&gt;$F:[0,1]^{2}\to[0,1]$&lt;span class="ltx_text ltx_font_italic"&gt; with Lipschitz constant &lt;/span&gt;$m-1$&lt;span class="ltx_text ltx_font_italic"&gt; with respect to &lt;/span&gt;$\ell^{\infty}$&lt;span class="ltx_text ltx_font_italic"&gt;, and no extension of the staircase indicator &lt;/span&gt;$\mathbf{1}\!\left[i+j\geq m+2\right]$&lt;span class="ltx_text ltx_font_italic"&gt; has a smaller one.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="A12.I1.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;(b)&lt;/span&gt;
&lt;div id="A12.I1.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Every &lt;/span&gt;$f\in\mathcal{F}_{[m]^{2}}^{\uparrow}$&lt;span class="ltx_text ltx_font_italic"&gt; extends to a coordinatewise nondecreasing &lt;/span&gt;$F:[0,1]^{2}\to[0,1]$&lt;span class="ltx_text ltx_font_italic"&gt; with exact grid values and &lt;/span&gt;$|F|_{B^{s}}=O_{s}(m^{s})$&lt;span class="ltx_text ltx_font_italic"&gt;, and every extension of the staircase has &lt;/span&gt;$|F|_{B^{s}}\geq c_{s}\,m^{s}$&lt;span class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A12.SS5.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;(a).&lt;/em&gt; Split each grid cell along its main diagonal and interpolate affinely on the two triangles. The two triangles of a cell agree on the diagonal, and adjacent cells agree on shared edges, so $F$ is continuous; its gradient on each triangle is a pair of scaled differences of $f\text{,}$ nonnegative by isotonicity, with $\ell^{1}$-norm equal to the diagonal increment of the cell divided by $h\text{,}$ at most $1/h=m-1\text{;}$ and a bound on $\|\nabla F\|_{1}$ is a Lipschitz constant for the $\ell^{\infty}$ metric. For the staircase, two grid points at $\ell^{\infty}$-distance $h$ carry values $0$ and $1\text{,}$ so every extension has Lipschitz constant at least $1/h\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A12.SS5.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;(b).&lt;/em&gt; For the lower bound, choose $s+2$ consecutive grid points on a horizontal line crossing the boundary of the staircase so that their values are $0,\ldots,0,1\text{;}$ the $(s{+}1)$-st difference of any extension along this line at spacing $h$ is then $\pm 1\text{,}$ so $\omega_{s+1}(F,h)\geq 1$ and $|F|_{B^{s}}\geq h^{-s}\geq c_{s}m^{s}\text{.}$ For the upper bound, compose each coordinate of the interpolant of (a) with a nondecreasing ramp $[0,1]\to[0,1]$ that fixes every grid coordinate, is constant on its $h/3$-neighborhood, and has slope at most $3\text{;}$ extend the result to $\mathbb{R}^{2}$ by its boundary values in each coordinate; and convolve with a nonnegative smooth probability kernel supported in the $\ell^{\infty}$-ball of radius $h/6\text{.}$ Convolution with such a kernel preserves coordinatewise monotonicity and the range $[0,1]\text{,}$ and the grid values are exact, because each convolution window lies inside a patch where the composition is constant in each variable near the grid point. Each $k$-th derivative is $O(m\cdot h^{1-k})$ for $k\leq s+1\text{,}$ so the modulus of smoothness obeys&lt;/p&gt;
&lt;table id="A12.Ex317" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\omega_{s+1}(F,t)\;=\;O_{s}\bigl(\min\{1,\,(t/h)^{s+1}\}\cdot mh\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Both branches give $t^{-s}\omega_{s+1}(F,t)=O_{s}(m\,h^{1-s})\text{:}$ at $t\leq h$ through $t^{-s}(t/h)^{s+1}mh=t\,h^{-s}m\leq m\,h^{1-s}\text{,}$ and at $t\geq h$ through $t^{-s}mh\leq h^{-s}mh\text{.}$ Since $mh\leq 2\text{,}$ taking the supremum over $t&amp;gt;0$ gives $|F|_{B^{s}}=O_{s}(h^{-s})=O_{s}(m^{s})\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A12.SS5.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The ladder caps what any ambient-class guarantee can transfer. A ball of radius $R$ in $B^{s}$ on $[0,1]^{2}$ has minimax regret of order $\min\{T,\,R^{2/(s+1)}T^{1/(s+1)}\}$ up to logarithmic factors: packing the square with $(R/\beta)^{2/s}$ disjoint bumps of amplitude $\beta$ and seminorm $R\text{,}$ then running the two-point argument on their signs and optimizing over $\beta\leq 1\text{,}$ gives the lower bound, and chaining over the ball’s entropy $(R/\varepsilon)^{2/s}$ matches it. At $s=1$ this is the Lipschitz ball with $R\asymp m\text{,}$ and its order is what the guarantees of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Liautaud&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt; [&lt;a href="#bib.bib24" title="Minimax-optimal and locally-adaptive online nonparametric regression" class="ltx_ref"&gt;2025b&lt;/a&gt;]&lt;/cite&gt; and &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Liautaud&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt; [&lt;a href="#bib.bib25" title="Minimax adaptive online nonparametric regression over Besov spaces" class="ltx_ref"&gt;2025a&lt;/a&gt;]&lt;/cite&gt; yield on the embedded class: dimension two with smoothness one sits on the critical line of the former, and the latter gives the same order there, each up to logarithmic factors. For general $s\text{,}$ part (b) forces $R\asymp m^{s}\text{,}$ and the transferred guarantees read&lt;/p&gt;
&lt;table id="A12.Ex318" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\bigl(m^{s}\bigr)^{2/(s+1)}\,T^{1/(s+1)}\;=\;m^{2s/(s+1)}\,T^{1/(s+1)},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;polynomially above the isotonic rate $m^{2/3}T^{1/3}$ at every $s\text{:}$ over the window $m\lesssim T\lesssim m^{4}$ the ratio is minimized at an endpoint and is at least $m^{\min\{s,2\}/(s+1)}\text{.}$ Behind the uniformity in $s$ is an exact cancellation: the forced radius enters the ball’s entropy as $(m^{s})^{2/s}=m^{2}\text{,}$ so the gain in smoothness and the growth of the norm cancel, and the entropy prefactor stays $m^{2}$ at every $s\text{,}$ one factor of $m$ above the isotonic $m/\varepsilon\text{.}$ No guarantee valid uniformly over the ambient ball can beat the ball’s own minimax at its worst comparator, and that minimax itself lies polynomially above the isotonic rate once $T\gtrsim m^{2}\text{;}$ the isotonic rate belongs to the subclass.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A12.SS5.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;A one-dimensional reparametrization does not explain the entropy profile either. If $f=g_{f}\circ\iota$ held for all $f\in\mathcal{F}_{[m]^{2}}^{\uparrow}$ with a fixed $\iota:[m]^{2}\to[0,1]\text{,}$ then $\iota$ would be injective, since upset indicators separate any two distinct grid points; so two grid points would land within $1/(m^{2}-1)$ of each other, some $\{0,1\}$-valued isotonic $f$ would separate them, and $g_{f}$ would need Lipschitz constant at least $m^{2}-1\text{,}$ far above the coarse-scale norm $m$ that the entropy law reflects.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A12.SS6" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="bv-and-besov"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;L.6 &lt;/span&gt;BV and Besov&lt;/h3&gt;
&lt;div id="A12.SS6.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;In one dimension the monotone class sits inside the bounded-variation class, whose $L^{1}$ entropy obeys the classical $\varepsilon^{-1}$ law; the identification of BV with $B^{1}_{1,1}$ is not exact, a Heaviside jump lying in BV and outside $B^{1}_{1,1}\text{.}$ The $\varepsilon^{-1}$ law is moreover an $L^{1}$ law: the sup-norm entropy of the monotone class on a continuum is infinite already in one dimension, the indicators $\{\mathbf{1}\!\left[[a,1]\right]:a\in[0,1]\}$ forming an uncountable $1$-separated family, so the finiteness of $\log N_{\infty}$ in &lt;a href="#Thmtheorem68" title="Proposition 68 (Entropy Equivalence). ‣ L.1 The Entropy Sandwich ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;68&lt;/span&gt;&lt;/a&gt; is entirely an effect of the design resolution, which is what $m$ measures.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A12.SS6.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;In two dimensions the continuous analogue of $\mathcal{F}_{[m]^{2}}^{\uparrow}$ is the class of coordinatewise monotone surfaces, and it lies in no Besov ball $B^{s}_{p,q}([0,1]^{2})$ with $s&amp;gt;d/p\text{:}$ such balls embed into continuous functions, while monotone surfaces may jump across a monotone curve. The regime $s&amp;gt;d/p$ is where the adaptive online algorithms of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Liautaud&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt; [&lt;a href="#bib.bib24" title="Minimax-optimal and locally-adaptive online nonparametric regression" class="ltx_ref"&gt;2025b&lt;/a&gt;, &lt;a href="#bib.bib25" title="Minimax adaptive online nonparametric regression over Besov spaces" class="ltx_ref"&gt;a&lt;/a&gt;]&lt;/cite&gt; operate, so those results are comparison points for adaptivity and loss generality rather than drop-in competitors; the fixed-$m$ embeddings of &lt;a href="#A12.SS5" title="L.5 Embeddings and the Smoothness Ladder ‣ Appendix L Metric Entropy and the Nonparametric Position ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;L.5&lt;/span&gt;&lt;/a&gt; are the precise form the comparison does take, with norms that grow with the design.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A13" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="the-phase-1-constant"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix M &lt;/span&gt;The Phase-1 Constant&lt;/h2&gt;
&lt;div id="A13.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Throughout this appendix, $m\to\infty$ with $T/m\to\infty$ and $T/m^{4}\to 0\text{:}$ the interior of Phase 1 on the plane, under the squared loss. All limits are along such sequences of pairs $(m,T)\text{.}$ Composing the explicit constants proved elsewhere in the paper brackets the ratio $R_{T}^{*}([m]^{2})/(m^{2/3}T^{1/3})$ between $(1088\cdot 342)^{-1}\approx 2.7\times 10^{-6}\text{,}$ from &lt;a href="#Thmtheorem26" title="Lemma 26 (Ribbon-Path Lower Bound). ‣ E.1.5 Proof of Lemma 26 ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemmas&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;26&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmtheorem19" title="Lemma 19 (Bridge Lemma). ‣ D.1 Statement ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;19&lt;/span&gt;&lt;/a&gt;, and $3(\log 2)^{2/3}\approx 2.35\text{,}$ from (&lt;a href="#S2.E2" title="Equation 2 ‣ Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;) with &lt;a href="#Thmtheorem17" title="Theorem 17 (Asymptotic of Ψ). ‣ C.7 Asymptotic of Ψ ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;17&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmtheorem16" title="Lemma 16 (Properties of 𝜓). ‣ C.6 Properties of 𝜓 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;16&lt;/span&gt;&lt;/a&gt;. Both ends carry the packaging cost of statements uniform in $(m,T)\text{,}$ and this appendix moves them, with no new mechanism, to&lt;/p&gt;
&lt;table id="A13.Ex319" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$7^{-7/3}\;\approx\;0.0107\qquad\text{and}\qquad\Bigl(\frac{3\log 2}{4}\Bigr)^{2/3}\;\approx\;0.6465,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;a bracket of ratio $61\text{.}$ The upper end sharpens the aggregation and the rounding of &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;; the lower end optimizes the two free parameters of the ribbon path and states the conclusion as a Phase-1 asymptotic, which removes the envelope packaging.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A13.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-upper-end"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;M.1 &lt;/span&gt;The Upper End&lt;/h3&gt;
&lt;div id="Thmtheorem71" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 71&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Upper Constant).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem71.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;As $m\to\infty$ with $T/m\to\infty$ and $T/m^{4}\to 0\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A13.Ex320" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\limsup\ \frac{R_{T}^{*}([m]^{2})}{m^{2/3}\,T^{1/3}}\;\leq\;\Bigl(\frac{3\log 2}{4}\Bigr)^{2/3}\;=\;0.64653\ldots$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A13.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The argument sharpens &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; at each of its two steps.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A13.SS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Mixability.&lt;/em&gt; The squared loss on $[0,1]$ is $2$-mixable: the Aggregating Algorithm over $N$ experts admits regret at most $\tfrac{1}{2}\log N$ &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;[Vovk, &lt;a href="#bib.bib15" title="A game of prediction with expert advice" class="ltx_ref"&gt;1998&lt;/a&gt;]&lt;/cite&gt;, halving the exp-concave constant $2\log N\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A13.SS1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Shifted grids.&lt;/em&gt; For $j=0,\ldots,M-1$ let&lt;/p&gt;
&lt;table id="A13.Ex321" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$S_{j}\;:=\;\Bigl(\tfrac{1}{K}\bigl(\mathbb{Z}+\tfrac{j}{M}\bigr)\cap[0,1]\Bigr)\cup\{0,1\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;a set of at most $K+2$ levels, and let $\mathcal{F}_{S_{j}}$ be the isotonic $S_{j}$-valued functions, so $|\mathcal{F}_{S_{j}}|\leq\Omega([m]^{2},K{+}2)\text{.}$ The learner runs the Aggregating Algorithm over $\bigcup_{j}\mathcal{F}_{S_{j}}\text{,}$ a class of cardinality at most $M\,\Omega([m]^{2},K{+}2)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A13.SS1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Averaging the shifts.&lt;/em&gt; Fix the hindsight fit $f^{*}$ and round it level-wise to the nearest point of $S_{j}\text{.}$ &lt;a href="#Thmtheorem8" title="Lemma 8 (Block Residual). ‣ Recall. ‣ Appendix B Block Residual Property ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt; annihilates the first-order rounding term for every $j\text{,}$ exactly as in the proof of &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;, leaving the cost $\sum_{c}w_{B_{c}}\,\mathrm{dist}(c,S_{j})^{2}\text{.}$ Now $\mathrm{dist}(c,S_{j})\leq\tfrac{1}{K}\,\mathrm{dist}(Kc-\tfrac{j}{M},\mathbb{Z})\text{,}$ since the nearest point of the shifted lattice either lies in $[0,1]$ or is beaten by the endpoint $0$ or $1\text{,}$ which $S_{j}$ contains; and the function $v\mapsto\mathrm{dist}(v,\mathbb{Z})^{2}$ is $1$-periodic and $1$-Lipschitz with mean $\tfrac{1}{12}\text{,}$ so its average over the $M$ equally spaced phases is at most $\tfrac{1}{12}+\tfrac{1}{M}\text{,}$ uniformly in $c\text{.}$ Averaging the total rounding cost over $j\text{,}$ some shift $j^{*}$ has cost at most $(\tfrac{1}{12}+\tfrac{1}{M})T/K^{2}\text{,}$ and the Aggregating Algorithm is compared with the best member of $\mathcal{F}_{S_{j^{*}}}\text{:}$&lt;/p&gt;
&lt;table id="A13.Ex322" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}\;\leq\;\frac{1}{2}\log\Omega([m]^{2},K{+}2)+\frac{\log M}{2}+\Bigl(\frac{1}{12}+\frac{1}{M}\Bigr)\frac{T}{K^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Balancing.&lt;/em&gt; Take $M=K\text{.}$ By &lt;a href="#Thmtheorem14" title="Lemma 14 (Log-Order-Polynomial Asymptotic). ‣ C.5 Main-Text Form ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;14&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmtheorem11" title="Lemma 11 (Properties of 𝜑). ‣ C.2 Properties of 𝜑 ‣ Appendix C Asymptotic Analysis ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;(d), whenever $K\to\infty$ with $K=o(m)\text{,}$&lt;/p&gt;
&lt;table id="A13.Ex323" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tfrac{1}{2}\log\Omega([m]^{2},K{+}2)\;=\;\tfrac{1}{2}\,m^{2}\,\varphi\Bigl(\tfrac{K+1}{m}\Bigr)+O(\log m)\;\leq\;(\log 2)\,mK\,(1+o(1)),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and $\log K=o(mK)\text{,}$ so $R_{T}\leq[(\log 2)\,mK+\tfrac{T}{12K^{2}}]\,(1+o(1))$ for every such $K\text{.}$ Choose $K$ as the positive integer nearest the unconstrained minimizer of the bracket, which is of order $(T/m)^{1/3}\text{,}$ hence diverges and is $o(m)$ in the stated regime, and at which the bracket attains its infimum up to a factor $1+o(1)\text{.}$ By $\inf_{K&amp;gt;0}\{aK+bK^{-2}\}=3\cdot 2^{-2/3}a^{2/3}b^{1/3}$ with $a=(\log 2)m$ and $b=T/12\text{,}$&lt;/p&gt;
&lt;table id="A13.Ex324" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R_{T}^{*}([m]^{2})\;\leq\;3\cdot 2^{-2/3}\,\bigl((\log 2)\,m\bigr)^{2/3}\Bigl(\frac{T}{12}\Bigr)^{1/3}(1+o(1)),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and the constant simplifies to $(3\log 2/4)^{2/3}\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A13.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-lower-end"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;M.2 &lt;/span&gt;The Lower End&lt;/h3&gt;
&lt;div id="Thmtheorem72" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 72&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Lower Constant).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem72.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;As $m\to\infty$ with $T/m\to\infty$ and $T/m^{4}\to 0\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A13.Ex325" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\liminf\ \frac{R_{T}^{*}([m]^{2})}{m^{2/3}\,T^{1/3}}\;\geq\;7^{-7/3}\;=\;0.01066\ldots$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A13.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The adversary is the ribbon path of &lt;a href="#A5.SS1.SSS1" title="E.1.1 Construction ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;E.1.1&lt;/span&gt;&lt;/a&gt; with its two frozen parameters, the amplitude and the episode length, left free; the validity and isolation statements of &lt;a href="#Thmtheorem23" title="Lemma 23 (Construction Validity). ‣ E.1.2 Construction Validity ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;23&lt;/span&gt;&lt;/a&gt;(a)(b) and &lt;a href="#Thmtheorem24" title="Lemma 24 (Complete Isolation). ‣ E.1.3 Complete Isolation ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;24&lt;/span&gt;&lt;/a&gt; concern the cutoffs alone and are unaffected.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A13.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Construction.&lt;/em&gt; Fix $W\in(0,1)\text{,}$ let $\delta:=W/K\text{,}$ keep the cutoffs $c_{r}^{\theta}\text{,}$ the upsets $U_{r}^{\theta}\text{,}$ the bits $\theta_{r,b}$ indexed by $[K]\times[\ell]$ with $\ell:=\lfloor m/2\rfloor\text{,}$ and the probes $\mathrm{Rib}_{r,b}\text{,}$ and play&lt;/p&gt;
&lt;table id="A13.Ex326" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$f_{\theta}\;:=\;\frac{1-W}{2}\,+\,\delta\sum_{r=1}^{K}\mathbf{1}\!\left[\cdot\in U_{r}^{\theta}\right].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;By &lt;a href="#Thmtheorem23" title="Lemma 23 (Construction Validity). ‣ E.1.2 Construction Validity ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;23&lt;/span&gt;&lt;/a&gt;(a)(b) each realization is a nonnegative combination of upset indicators plus a constant, hence isotonic, with values in $[\tfrac{1-W}{2},\tfrac{1+W}{2}]\subset[0,1]\text{;}$ by the indicator identity of &lt;a href="#Thmtheorem24" title="Lemma 24 (Complete Isolation). ‣ E.1.3 Complete Isolation ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;24&lt;/span&gt;&lt;/a&gt;, the value at $\mathrm{Rib}_{r,b}$ is $\tfrac{1-W}{2}+(r-1)\delta+\delta\,\theta_{r,b}\text{,}$ decided by that single bit. The adversary queries each of the $N:=K\ell$ probes for $q:=\lfloor T/N\rfloor$ consecutive rounds with independent Bernoulli labels, the remaining rounds querying a fixed point at its true mean.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A13.SS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Estimate.&lt;/em&gt; Steps A through C of the proof of &lt;a href="#Thmtheorem26" title="Lemma 26 (Ribbon-Path Lower Bound). ‣ E.1.5 Proof of Lemma 26 ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;26&lt;/span&gt;&lt;/a&gt; apply with the new parameters. Every probe is an independent two-point Bernoulli problem with gap $\delta\text{;}$ both means lie in $[\tfrac{1-W}{2},\tfrac{1+W}{2}]\text{,}$ so their variance parameter is at least $\tfrac{1-W^{2}}{4}\text{,}$ whence $\mathrm{kl}\leq\chi^{2}\leq\tfrac{4\delta^{2}}{1-W^{2}}$ per observation, and, writing $u:=q\delta^{2}\text{,}$ Pinsker’s inequality bounds the total variation of the two $q$-fold product laws by $\sqrt{2u/(1-W^{2})}\text{.}$ Combining with &lt;a href="#Thmtheorem25" title="Lemma 25 (𝜒²–TV Posterior-Variance Link). ‣ E.1.4 Posterior-Variance Link ‣ E.1 Ribbon-Path Lower Bound ‣ Appendix E Lower Bound Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;25&lt;/span&gt;&lt;/a&gt; and the martingale monotonicity, and summing over the $N$ probes,&lt;/p&gt;
&lt;table id="A13.Ex327" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[R_{T}]\;\geq\;Nq\,\delta^{2}\cdot\frac{1-\sqrt{2u/(1-W^{2})}}{4}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A13.SS2.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Optimization.&lt;/em&gt; Fix targets $v_{0}:=\tfrac{16}{49}\text{,}$ $W:=1/\sqrt{3}\text{,}$ and $u_{0}:=v_{0}(1-W^{2})/2=\tfrac{16}{147}\text{,}$ and set $K:=\lceil(TW^{2}/(\ell u_{0}))^{1/3}\rceil\text{.}$ In the stated regime $K\asymp(T/m)^{1/3}$ diverges and is $o(m)\text{,}$ so $K\leq\lfloor m/8\rfloor$ eventually; $q=\lfloor T/(K\ell)\rfloor\asymp(T/m)^{2/3}$ diverges; $N=K\ell=o(T)\text{,}$ so $Nq=T(1-o(1))\text{;}$ and $u=q\delta^{2}=u_{0}(1+o(1))\text{,}$ so $2u/(1-W^{2})=v_{0}(1+o(1))\text{.}$ Substituting these, together with $K^{2}=(TW^{2}/(\ell u_{0}))^{2/3}(1+o(1))$ and $\ell=\tfrac{m}{2}(1-o(1))\text{,}$ into the estimate,&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A13.EGx8"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A13.Ex328"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A13.Ex329"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle\frac{\mathbb{E}[R_{T}]}{m^{2/3}T^{1/3}}\; &amp;amp; \displaystyle\geq\;\bigl(1-o(1)\bigr)\,\frac{1-\sqrt{v_{0}}}{4}\Bigl(\frac{u_{0}}{2}\Bigr)^{2/3}W^{2/3} \\
&amp;amp; \displaystyle=\;\bigl(1-o(1)\bigr)\,\frac{v_{0}^{2/3}(1-\sqrt{v_{0}})\,\bigl[W(1-W^{2})\bigr]^{2/3}}{4^{5/3}},
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;after substituting $u_{0}=v_{0}(1-W^{2})/2\text{.}$ The two chosen targets are the separate maximizers: $s\mapsto s^{4/3}(1-s)$ is maximized at $s=\tfrac{4}{7}\text{,}$ which is $\sqrt{v_{0}}\text{,}$ with value $(\tfrac{4}{7})^{4/3}\tfrac{3}{7}\text{;}$ and $W(1-W^{2})$ is maximized at $W=1/\sqrt{3}\text{,}$ giving $[W(1-W^{2})]^{2/3}=2^{2/3}/3\text{.}$ The product evaluates to&lt;/p&gt;
&lt;table id="A13.Ex330" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{1}{4^{5/3}}\cdot\Bigl(\frac{4}{7}\Bigr)^{4/3}\cdot\frac{3}{7}\cdot\frac{2^{2/3}}{3}\;=\;\frac{2^{2/3}}{4^{1/3}\,7^{7/3}}\;=\;7^{-7/3},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and Yao’s principle converts the Bayesian bound into the minimax claim.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem73" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Remark 73&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; (Random Shift).&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem73.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Stationarity is convenient rather than necessary for the rate. Let $U\sim\mathrm{Unif}[0,1)$ and $Q_{K,U}(p):=\lfloor Kp+U\rfloor/K\text{.}$ Every realization is a non-decreasing $G_{K}$-valued rounding, and for each $p$ the randomized image has mean $p$ and support in an interval of length $1/K\text{,}$ so $\beta$-smoothness gives $\mathbb{E}_{U}\,\ell(Q_{K,U}(p),y)-\ell(p,y)\leq\beta/(8K^{2})\text{;}$ some fixed shift therefore matches the bound of &lt;a href="#Thmtheorem1" title="Theorem 1 (Universal Upper Bound). ‣ 2.3 Level-Set Stationarity and the Upper Bound ‣ 2 The Complexity Formula and the Universal Upper Bound ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; without &lt;a href="#Thmtheorem50" title="Lemma 50 (Level-Set Stationarity). ‣ J.1 Level-Set Stationarity ‣ Appendix J Convex Losses: Proofs ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;50&lt;/span&gt;&lt;/a&gt;. What stationarity buys is the constant: nearest rounding on a shifted grid has mean squared offset $\tfrac{1}{12K^{2}}$ rather than $\tfrac{1}{4K^{2}}\text{,}$ at the price of a first-order term that only the stationarity identity removes.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A13.SS2.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The two ends move for different reasons. The upper end drops from $2.35$ to $0.6465$ through mixability and grid shifting alone (&lt;a href="#Thmtheorem73" title="Remark 73 (Random Shift). ‣ M.2 The Lower End ‣ Appendix M The Phase-1 Constant ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Remark&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;73&lt;/span&gt;&lt;/a&gt;). The lower end rises from $2.7\times 10^{-6}$ to $0.0107$ through the joint optimization of amplitude and episode length, together with the passage from an all-$(m,T)$ envelope to a phase-wise asymptotic, which bypasses &lt;a href="#Thmtheorem19" title="Lemma 19 (Bridge Lemma). ‣ D.1 Statement ‣ Appendix D Bridge Lemma ‣ The Minimax Rate of Online Isotonic Regression on Product Orders" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;19&lt;/span&gt;&lt;/a&gt;: its constant is packaging, not mechanism.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A13.SS2.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;A fair mixture of the ribbon-path and interior-cube adversaries is a single Yao distribution that delivers both lower bounds within a factor of two; the mechanisms it mixes stay distinct. In Phase 1 the optimal resolution satisfies $K=o(m)\text{,}$ the order constraints are active along $K$ nested frontiers, and the unknowns are $\Theta(mK)$ discrete bits; in Phase 2 the optimal resolution exceeds $m\text{,}$ the constraints are locally inactive around a strictly increasing surface, and the unknowns are $m^{2}$ continuous cell values, which the van Trees inequality prices directly. The transition at $T\sim m^{4}$ is where the price changes hands.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;&lt;div class="ltx_rdf" about="" property="dcterms:creator" content="Sichen Wang"&gt;&lt;/div&gt;
&lt;div class="ltx_rdf" about="" property="dcterms:title" content="The Minimax Rate of Online Isotonic Regression on Product Orders"&gt;&lt;/div&gt;
&lt;/article&gt;</description></item><item><title>On Completion Times under Memoryless Catastrophe</title><link>https://sichen-wang.github.io/publications/memoryless-catastrophe/</link><pubDate>Tue, 15 Sep 2026 00:00:00 +0000</pubDate><guid>https://sichen-wang.github.io/publications/memoryless-catastrophe/</guid><description>&lt;article class="ltx_document ltx_authors_1line"&gt;
&lt;section id="S1" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="introduction"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;1 &lt;/span&gt;Introduction&lt;/h2&gt;
&lt;section id="S1.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="motivation"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;1.1 &lt;/span&gt;Motivation&lt;/h3&gt;
&lt;div id="S1.SS1.p1" class="ltx_para"&gt;
&lt;p id="S1.SS1.p1.1" class="ltx_p"&gt;Stochastic processes subject to catastrophe undergo the total loss of accumulated progress at random intervals, necessitating a complete restart from the initial state. This abstraction of a base task disrupted by total resets arises across several disciplines:&lt;/p&gt;
&lt;ul id="S1.I1" class="ltx_itemize"&gt;
&lt;li id="S1.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S1.I1.i1.p1" class="ltx_para"&gt;
&lt;p id="S1.I1.i1.p1.1" class="ltx_p"&gt;Randomized algorithms restarted upon timeout, where &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib29" title="" class="ltx_ref"&gt;29&lt;/a&gt;]&lt;/cite&gt; showed that a universal restart strategy is near-optimal up to a logarithmic factor;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S1.I1.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S1.I1.i2.p1" class="ltx_para"&gt;
&lt;p id="S1.I1.i2.p1.1" class="ltx_p"&gt;&lt;em id="S1.I1.i2.p1.1.1" class="ltx_emph ltx_font_italic"&gt;Queueing systems&lt;/em&gt; flushed by disasters, initiated by the disaster models of &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib5" title="" class="ltx_ref"&gt;5&lt;/a&gt;]&lt;/cite&gt; and developed through the negative-customer framework of &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib20" title="" class="ltx_ref"&gt;20&lt;/a&gt;]&lt;/cite&gt;;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S1.I1.i3" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S1.I1.i3.p1" class="ltx_para"&gt;
&lt;p id="S1.I1.i3.p1.1" class="ltx_p"&gt;&lt;em id="S1.I1.i3.p1.1.1" class="ltx_emph ltx_font_italic"&gt;Diffusive search&lt;/em&gt; under stochastic resetting, where &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib15" title="" class="ltx_ref"&gt;16&lt;/a&gt;]&lt;/cite&gt; demonstrated that Poisson resetting of a Brownian particle produces a nonequilibrium steady state with finite mean first-passage time—launching a now-extensive literature surveyed in &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib16" title="" class="ltx_ref"&gt;15&lt;/a&gt;]&lt;/cite&gt;.&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div id="S1.SS1.p2" class="ltx_para"&gt;
&lt;p id="S1.SS1.p2.1" class="ltx_p"&gt;For such a process that must complete a task, its completion time, denoted by $T\text{,}$ depends on two ingredients: the base task (how long without catastrophe?) and the catastrophe mechanism (when does reset strike?). Much of the existing literature studies the first ingredient—optimizing restart timing for a given task &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib37" title="" class="ltx_ref"&gt;37&lt;/a&gt;, &lt;a href="#bib.bib33" title="" class="ltx_ref"&gt;33&lt;/a&gt;, &lt;a href="#bib.bib8" title="" class="ltx_ref"&gt;8&lt;/a&gt;]&lt;/cite&gt;. We ask a complementary question about the second:&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS1.p3" class="ltx_para"&gt;
&lt;blockquote id="S1.SS1.p3.1" class="ltx_quote"&gt;
&lt;p id="S1.SS1.p3.1.1" class="ltx_p"&gt;&lt;em id="S1.SS1.p3.1.1.1" class="ltx_emph ltx_font_italic"&gt;What algebraic structure does the catastrophe mechanism impose on the probability generating function of $T\text{,}$ and what are the consequences for moments, limit laws, and convergence rates?&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div id="S1.SS1.p4" class="ltx_para"&gt;
&lt;p id="S1.SS1.p4.1" class="ltx_p"&gt;The question has a clear theoretical lineage. The probability generating function (PGF) formula for completion under geometric restart was derived independently by &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib4" title="" class="ltx_ref"&gt;4&lt;/a&gt;]&lt;/cite&gt; and &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib19" title="" class="ltx_ref"&gt;19&lt;/a&gt;]&lt;/cite&gt;. Both observed the striking fact that $E[T]$ depends on the base process only through a single PGF evaluation—Flynn and Pilyugin called this “wonderful.” This is, in retrospect, the $k=1$ shadow of a deeper phenomenon. Meanwhile, in branching process theory, &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib1" title="" class="ltx_ref"&gt;1&lt;/a&gt;]&lt;/cite&gt; and &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib38" title="" class="ltx_ref"&gt;38&lt;/a&gt;]&lt;/cite&gt; exploited the fact that geometric compounding inherently produces linear fractional (Möbius) PGFs; in the catastrophe/restart context, this connection has not been made. Our work identifies the algebraic mechanism underlying these observations—&lt;em id="S1.SS1.p4.1.1" class="ltx_emph ltx_font_italic"&gt;affine PGF structure&lt;/em&gt;—and develops it into a systematic theory: a derivative reduction principle, a characterization theorem, an exponential limit with explicit Laplace expansion, sharp two-sided convergence rates, and a continuous-time counterpart that sharpens the characterization to full Poisson resetting.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S1.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="setup-and-the-pgf-formula"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;1.2 &lt;/span&gt;Setup and the PGF Formula&lt;/h3&gt;
&lt;div id="S1.SS2.p1" class="ltx_para"&gt;
&lt;p id="S1.SS2.p1.1" class="ltx_p"&gt;Throughout, $T_{0}$ is a positive-integer-valued, almost surely finite random variable (the base completion time). Catastrophe occurs independently at each step with probability $q\in(0,1)\text{.}$
For an integer-valued random variable $X\text{,}$ write $G_{X}$ for its probability generating function.
We set&lt;/p&gt;
&lt;table id="S1.Ex1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$s=1-q,\qquad g=G_{T_{0}},\qquad p=g(s),\qquad D_{k}=g^{(k)}(s).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1.SS2.p1.2" class="ltx_p"&gt;We write $\operatorname{Exp}(\lambda)$ for the exponential distribution with rate $\lambda&amp;gt;0$ (density $\lambda e^{-\lambda x}\text{,}$ $x\geq 0\text{;}$ mean $1/\lambda$). In particular, $\operatorname{Exp}(1)$ denotes the standard exponential (mean $1$). The attempt decomposition&lt;/p&gt;
&lt;table id="S1.E1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$T=\sum_{i=1}^{N}A_{i}+B,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(1)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1.SS2.p1.3" class="ltx_p"&gt;with $N\sim\mathrm{Geom}_{0}(p)$ counting failed attempts, $A_{i}$ i.i.d. failed-attempt lengths, and $B$ the successful-attempt length, is classical (see §&lt;a href="#S2.SS1" title="2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt; for a self-contained derivation).
The success probability $p=g(s)\text{,}$ a single PGF evaluation, is the simplest instance of what we call &lt;em id="S1.SS2.p1.3.1" class="ltx_emph ltx_font_italic"&gt;proportional single-point sufficiency&lt;/em&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS2.p2" class="ltx_para"&gt;
&lt;p id="S1.SS2.p2.1" class="ltx_p"&gt;The PGF of $T$ then takes the form (Theorem &lt;a href="#S2.Thmtheorem2" title="Theorem 2.2 (PGF formula). ‣ 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt;)&lt;/p&gt;
&lt;table id="S1.E2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$G_{T}(w)\;=\;\frac{g(u)(1-u)}{1-w+qw\,g(u)},\qquad u=ws.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(2)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1.SS2.p2.2" class="ltx_p"&gt;This formula was obtained independently by &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib19" title="" class="ltx_ref"&gt;19&lt;/a&gt;]&lt;/cite&gt; and &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib4" title="" class="ltx_ref"&gt;4&lt;/a&gt;]&lt;/cite&gt;. Our contribution begins with the observation that (&lt;a href="#S1.E2" title="In 1.2 Setup and the PGF Formula ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;) is &lt;em id="S1.SS2.p2.2.1" class="ltx_emph ltx_font_italic"&gt;affine in $g(u)$&lt;/em&gt;:&lt;/p&gt;
&lt;table id="S1.E3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\underbrace{(1-u)}_{\alpha_{N}(w)}\cdot g(u)+\underbrace{0}_{\beta_{N}(w)}\quad\Big/\quad\underbrace{qw}_{\alpha_{D}(w)}\cdot g(u)+\underbrace{(1-w)}_{\beta_{D}(w)},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(3)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1.SS2.p2.3" class="ltx_p"&gt;where the argument $u=ws$ is &lt;em id="S1.SS2.p2.3.1" class="ltx_emph ltx_font_italic"&gt;linear&lt;/em&gt; in $w\text{.}$ Since $\beta_{N}(1)=0=\beta_{D}(1)\text{,}$ the probability axiom $G_{T}(1)=1$ forces&lt;/p&gt;
&lt;table id="S1.E4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\alpha_{N}(1)=\alpha_{D}(1)=q.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(4)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S1.SS2.p3" class="ltx_para"&gt;
&lt;p id="S1.SS2.p3.1" class="ltx_p"&gt;This coefficient equality is the organizing algebraic mechanism behind the derivative reduction principle and the subsequent approximation theory.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S1.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="main-results"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;1.3 &lt;/span&gt;Main Results&lt;/h3&gt;
&lt;div id="S1.SS3.p1" class="ltx_para"&gt;
&lt;p id="S1.SS3.p1.1" class="ltx_p"&gt;We state our principal results in order: the coefficient equality (&lt;a href="#S1.E4" title="In 1.2 Setup and the PGF Formula ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;) drives the derivative reduction principle (Theorem &lt;a href="#S1.Thmtheorem1" title="Theorem 1.1 (Derivative reduction principle). ‣ 1.3 Main Results ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1.1&lt;/span&gt;&lt;/a&gt;), which in turn underpins the Laplace expansion (Theorem &lt;a href="#S1.Thmtheorem3" title="Theorem 1.3 (Laplace expansion). ‣ 1.3 Main Results ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1.3&lt;/span&gt;&lt;/a&gt;) and the sharp rate (Theorem &lt;a href="#S1.Thmtheorem4" title="Theorem 1.4 (Sharp Kolmogorov bound). ‣ 1.3 Main Results ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1.4&lt;/span&gt;&lt;/a&gt;). The characterization (Theorem &lt;a href="#S1.Thmtheorem2" title="Theorem 1.2 (Characterization). ‣ 1.3 Main Results ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1.2&lt;/span&gt;&lt;/a&gt;) closes the loop by showing that affine structure is not merely sufficient but also &lt;em id="S1.SS3.p1.1.1" class="ltx_emph ltx_font_italic"&gt;necessary&lt;/em&gt; within the class of age-based catastrophe mechanisms.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS3.p2" class="ltx_para ltx_noindent"&gt;
&lt;p id="S1.SS3.p2.1" class="ltx_p"&gt;&lt;span id="S1.SS3.p2.1.1" class="ltx_text ltx_font_bold"&gt;I. Derivative reduction principle.&lt;/span&gt;
The coefficient equality (&lt;a href="#S1.E4" title="In 1.2 Setup and the PGF Formula ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;) propagates through the Leibniz rule to produce an exact cancellation at every moment level.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.Thmtheorem1" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S1.Thmtheorem1.2" class="ltx_text ltx_font_bold"&gt;Theorem 1.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S1.Thmtheorem1.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Derivative reduction principle)&lt;span id="S1.Thmtheorem1.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S1.Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p id="S1.Thmtheorem1.p1.1" class="ltx_p"&gt;&lt;span id="S1.Thmtheorem1.p1.1.1" class="ltx_text ltx_font_italic"&gt;Define $\Delta_{k}=N^{(k)}(1)-D^{(k)}(1)\text{,}$ where $N$ and $D$ are the numerator and denominator of (&lt;a href="#S1.E2" title="In 1.2 Setup and the PGF Formula ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;). Then&lt;/span&gt;&lt;/p&gt;
&lt;table id="S1.Ex2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Delta_{k}=\begin{cases}1-p,&amp;amp;k=1,\\ -k\,s^{k-1}\,D_{k-1},&amp;amp;k\geq 2.\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1.Thmtheorem1.p1.2" class="ltx_p"&gt;&lt;span id="S1.Thmtheorem1.p1.2.1" class="ltx_text ltx_font_italic"&gt;In particular, $\Delta_{k}$ does not contain $D_{k}=g^{(k)}(s)\text{.}$ Consequently, the $k$-th factorial moment of $T$ depends on the $(k{-}1)$-jet $\{g(s),g^{\prime}(s),\ldots,g^{(k-1)}(s)\}\text{,}$ never on $g^{(k)}(s)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S1.SS3.p3" class="ltx_para"&gt;
&lt;p id="S1.SS3.p3.1" class="ltx_p"&gt;For details, see Theorem &lt;a href="#S2.Thmtheorem6" title="Theorem 2.6 (Derivative reduction principle). ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.6&lt;/span&gt;&lt;/a&gt; and its proof. The theorem reveals a &lt;em id="S1.SS3.p3.1.1" class="ltx_emph ltx_font_italic"&gt;strict complexity staircase&lt;/em&gt;: each moment level requires exactly one new derivative of the base PGF. For base processes with unbounded support, the staircase is tight—no further reduction is possible (Proposition &lt;a href="#S2.Thmtheorem10" title="Proposition 2.10 (Tightness of the staircase). ‣ 2.3 Moment Recursion and the Complexity Staircase ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.10&lt;/span&gt;&lt;/a&gt;). In the coupon collector application (§&lt;a href="#S6" title="6 Application: Coupon Collector with Reset ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;), this staircase is realized by the finite harmonic sums $H^{(k-1)}=\sum_{j=m+1}^{n+m}j^{-(k-1)}\text{,}$ so that the $k$-th moment introduces one new harmonic statistic that cannot be eliminated from the present recursion using lower-order data.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS3.p4" class="ltx_para"&gt;
&lt;p id="S1.SS3.p4.1" class="ltx_p"&gt;The cancellation rests on affine dependence on $g(u)\text{,}$ a linear shift $u=ws\text{,}$ and coefficient matching at the normalization point; see Lemma &lt;a href="#S2.Thmtheorem7" title="Lemma 2.7 (Affine-ratio recursion). ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.7&lt;/span&gt;&lt;/a&gt;. This raises a natural question: is their conjunction &lt;em id="S1.SS3.p4.1.1" class="ltx_emph ltx_font_italic"&gt;characteristic&lt;/em&gt; of some identifiable class of catastrophe mechanisms?&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS3.p5" class="ltx_para ltx_noindent"&gt;
&lt;p id="S1.SS3.p5.1" class="ltx_p"&gt;&lt;span id="S1.SS3.p5.1.1" class="ltx_text ltx_font_bold"&gt;II. Characterization of geometric-tail catastrophe.&lt;/span&gt;
The answer is yes. Consider a general age-based catastrophe mechanism with hazard sequence $(h_{t})_{t\geq 1}\text{,}$ $h_{t}\in(0,1)\text{,}$ and survival function $S(t)=\prod_{i=1}^{t}(1-h_{i})\text{.}$ We say the mechanism has &lt;em id="S1.SS3.p5.1.2" class="ltx_emph ltx_font_italic"&gt;geometric tail&lt;/em&gt; if there exist $a\in(0,1)$ and $q\in(0,1)$ such that $h_{1}=1-a$ and $h_{t}=q$ for all $t\geq 2\text{;}$ equivalently, $S(t)=a\,s^{t-1}$ for $t\geq 1\text{.}$ The special case $a=s$ recovers full memorylessness.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.Thmtheorem2" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S1.Thmtheorem2.2" class="ltx_text ltx_font_bold"&gt;Theorem 1.2&lt;/span&gt;&lt;/span&gt;&lt;span id="S1.Thmtheorem2.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Characterization)&lt;span id="S1.Thmtheorem2.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S1.Thmtheorem2.p1" class="ltx_para"&gt;
&lt;p id="S1.Thmtheorem2.p1.1" class="ltx_p"&gt;&lt;span id="S1.Thmtheorem2.p1.1.1" class="ltx_text ltx_font_italic"&gt;Among age-based catastrophe mechanisms with hazard rates $h_{t}\in(0,1)\text{,}$ the following are equivalent:&lt;/span&gt;&lt;/p&gt;
&lt;ol id="S1.I2" class="ltx_enumerate"&gt;
&lt;li id="S1.I2.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;(A)&lt;/span&gt;
&lt;div id="S1.I2.i1.p1" class="ltx_para"&gt;
&lt;p id="S1.I2.i1.p1.1" class="ltx_p"&gt;&lt;span id="S1.I2.i1.p1.1.1" class="ltx_text ltx_font_italic"&gt;Geometric-tail catastrophe: &lt;/span&gt;$S(t)=a\,s^{t-1}$&lt;span id="S1.I2.i1.p1.1.2" class="ltx_text ltx_font_italic"&gt; for &lt;/span&gt;$t\geq 1$&lt;span id="S1.I2.i1.p1.1.3" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S1.I2.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;(B)&lt;/span&gt;
&lt;div id="S1.I2.i2.p1" class="ltx_para"&gt;
&lt;p id="S1.I2.i2.p1.1" class="ltx_p"&gt;&lt;span id="S1.I2.i2.p1.1.1" class="ltx_text ltx_font_italic"&gt;Uniform affine PGF structure (Definition &lt;/span&gt;&lt;a href="#S2.Thmtheorem4" title="Definition 2.4 (Uniform affine PGF structure). ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref ltx_font_italic"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.4&lt;/span&gt;&lt;/a&gt;&lt;span id="S1.I2.i2.p1.1.2" class="ltx_text ltx_font_italic"&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S1.I2.i3" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;(C)&lt;/span&gt;
&lt;div id="S1.I2.i3.p1" class="ltx_para"&gt;
&lt;p id="S1.I2.i3.p1.1" class="ltx_p"&gt;&lt;span id="S1.I2.i3.p1.1.1" class="ltx_text ltx_font_italic"&gt;Derivative reduction: there exists &lt;/span&gt;$z_{0}\in(0,1)$&lt;span id="S1.I2.i3.p1.1.2" class="ltx_text ltx_font_italic"&gt; such that for every &lt;/span&gt;$k\geq 1$&lt;span id="S1.I2.i3.p1.1.3" class="ltx_text ltx_font_italic"&gt; and every finitely-supported &lt;/span&gt;$T_{0}$&lt;span id="S1.I2.i3.p1.1.4" class="ltx_text ltx_font_italic"&gt;, the &lt;/span&gt;$k$&lt;span id="S1.I2.i3.p1.1.5" class="ltx_text ltx_font_italic"&gt;-th factorial moment of &lt;/span&gt;$T$&lt;span id="S1.I2.i3.p1.1.6" class="ltx_text ltx_font_italic"&gt; depends on &lt;/span&gt;$T_{0}$&lt;span id="S1.I2.i3.p1.1.7" class="ltx_text ltx_font_italic"&gt; only through &lt;/span&gt;$\{g^{(j)}(z_{0})\}_{j=0}^{k-1}$&lt;span id="S1.I2.i3.p1.1.8" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S1.I2.i4" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;(D)&lt;/span&gt;
&lt;div id="S1.I2.i4.p1" class="ltx_para"&gt;
&lt;p id="S1.I2.i4.p1.1" class="ltx_p"&gt;&lt;span id="S1.I2.i4.p1.1.1" class="ltx_text ltx_font_italic"&gt;Proportional single-point sufficiency: &lt;/span&gt;$p=\lambda\,g(z_{0})$&lt;span id="S1.I2.i4.p1.1.2" class="ltx_text ltx_font_italic"&gt; for some &lt;/span&gt;$z_{0}\in(0,1)$&lt;span id="S1.I2.i4.p1.1.3" class="ltx_text ltx_font_italic"&gt;, &lt;/span&gt;$\lambda&amp;gt;0$&lt;span id="S1.I2.i4.p1.1.4" class="ltx_text ltx_font_italic"&gt;, and all finitely-supported &lt;/span&gt;$T_{0}$&lt;span id="S1.I2.i4.p1.1.5" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p id="S1.Thmtheorem2.p1.2" class="ltx_p"&gt;&lt;span id="S1.Thmtheorem2.p1.2.1" class="ltx_text ltx_font_italic"&gt;Full memorylessness ($h_{t}\equiv q$) is further equivalent to $\lambda=1$ (Corollary &lt;a href="#S3.Thmtheorem8" title="Corollary 3.8 (Full memorylessness). ‣ 3.4 From Geometric Tail to Full Memorylessness ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.8&lt;/span&gt;&lt;/a&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S1.SS3.p6" class="ltx_para"&gt;
&lt;p id="S1.SS3.p6.1" class="ltx_p"&gt;For details, see Theorem &lt;a href="#S3.Thmtheorem6" title="Theorem 3.6 (Characterization). ‣ 3.3 The Characterization Theorem ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.6&lt;/span&gt;&lt;/a&gt;. The hardest implication (C)$\Rightarrow$(A) uses only the $k=1$ case and proceeds by a Möbius rigidity argument (§&lt;a href="#S3.SS3" title="3.3 The Characterization Theorem ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt;). The gap between geometric-tail and full memorylessness is exactly one degree of freedom—the first-step hazard $h_{1}\text{.}$ In continuous time, this gap closes entirely (Theorem &lt;a href="#S5.Thmtheorem7" title="Theorem 5.7 (Continuous-time characterization). ‣ 5.4 Characterization: Affine Laplace Structure Is Poisson ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.7&lt;/span&gt;&lt;/a&gt;); see &lt;span id="S1.SS3.p6.1.1" class="ltx_text ltx_font_bold"&gt;VI&lt;/span&gt; below.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS3.p7" class="ltx_para ltx_noindent"&gt;
&lt;p id="S1.SS3.p7.1" class="ltx_p"&gt;&lt;span id="S1.SS3.p7.1.1" class="ltx_text ltx_font_bold"&gt;III. Exponential limit and the Laplace expansion.&lt;/span&gt;
The attempt decomposition (&lt;a href="#S1.E1" title="In 1.2 Setup and the PGF Formula ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;) expresses $T$ as a geometric sum plus a perturbation. Rényi’s classical theorem &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib36" title="" class="ltx_ref"&gt;36&lt;/a&gt;]&lt;/cite&gt; asserts that normalized geometric sums converge to the exponential distribution. The coefficient equality (&lt;a href="#S1.E4" title="In 1.2 Setup and the PGF Formula ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;) sharpens this into a quantitative expansion.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.Thmtheorem3" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S1.Thmtheorem3.2" class="ltx_text ltx_font_bold"&gt;Theorem 1.3&lt;/span&gt;&lt;/span&gt;&lt;span id="S1.Thmtheorem3.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Laplace expansion)&lt;span id="S1.Thmtheorem3.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S1.Thmtheorem3.p1" class="ltx_para"&gt;
&lt;p id="S1.Thmtheorem3.p1.1" class="ltx_p"&gt;&lt;span id="S1.Thmtheorem3.p1.1.1" class="ltx_text ltx_font_italic"&gt;Fix $q\in(0,1)\text{.}$ Let $W=T/E[T]$ and define&lt;/span&gt;&lt;/p&gt;
&lt;table id="S1.Ex3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\alpha=\frac{s(p-qD_{1})}{1-p},\qquad\beta=\frac{1-qp-qsD_{1}}{1-p}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1.Thmtheorem3.p1.2" class="ltx_p"&gt;&lt;span id="S1.Thmtheorem3.p1.2.1" class="ltx_text ltx_font_italic"&gt;Then $1+\alpha-\beta=0$ as an algebraic identity. For $p$ sufficiently small and $\theta&amp;gt;0$ satisfying $\theta pq/(1-p)\leq\epsilon_{0}\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S1.Ex4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$E[e^{-\theta W}]-\frac{1}{1+\theta}\;=\;\frac{\alpha\,\theta^{2}}{(1+\theta)^{2}}\;+\;O\!\left(\frac{|\alpha|^{2}\,\theta^{3}}{(1+\theta)^{3}}\right)\;+\;O\!\left(\frac{p\,\theta^{2}}{1+\theta}\right),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1.Thmtheorem3.p1.3" class="ltx_p"&gt;&lt;span id="S1.Thmtheorem3.p1.3.1" class="ltx_text ltx_font_italic"&gt;with implicit constants depending only on $q\text{.}$ In particular, $T/E[T]\xrightarrow{d}\mathrm{Exp}(1)$ as $p\to 0\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S1.SS3.p8" class="ltx_para"&gt;
&lt;p id="S1.SS3.p8.1" class="ltx_p"&gt;See Theorem &lt;a href="#S4.Thmtheorem4" title="Theorem 4.4 (Laplace expansion). ‣ 4.2 The Laplace Expansion ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.4&lt;/span&gt;&lt;/a&gt; for details. The identity $1+\alpha-\beta=0$ ensures that the first-order term in $\theta$ vanishes exactly—an algebraic consequence of the coefficient match (&lt;a href="#S1.E4" title="In 1.2 Setup and the PGF Formula ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;), not an asymptotic cancellation. The parameter $\alpha$ measures the deviation of the successful attempt from a geometric target (§&lt;a href="#S4.SS1" title="4.1 The Perturbation Parameter ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.1&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS3.p9" class="ltx_para ltx_noindent"&gt;
&lt;p id="S1.SS3.p9.1" class="ltx_p"&gt;&lt;span id="S1.SS3.p9.1.1" class="ltx_text ltx_font_bold"&gt;IV. Sharp two-sided Kolmogorov bound.&lt;/span&gt;
Converting the Laplace expansion to Kolmogorov distance via the smoothing inequality yields $d_{K}=O(|\alpha|\log(1/|\alpha|))$—a logarithmic artifact. The following theorem eliminates this loss.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.Thmtheorem4" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S1.Thmtheorem4.2" class="ltx_text ltx_font_bold"&gt;Theorem 1.4&lt;/span&gt;&lt;/span&gt;&lt;span id="S1.Thmtheorem4.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Sharp Kolmogorov bound)&lt;span id="S1.Thmtheorem4.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S1.Thmtheorem4.p1" class="ltx_para"&gt;
&lt;p id="S1.Thmtheorem4.p1.1" class="ltx_p"&gt;&lt;span id="S1.Thmtheorem4.p1.1.1" class="ltx_text ltx_font_italic"&gt;There exist constants $c_{A},C_{A},\delta_{A}&amp;gt;0$ depending only on $q$ such that, for $p+|\alpha|\leq\delta_{A}\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S1.Ex5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$c_{A}\,(p+|\alpha|)\;\leq\;d_{K}\!\left(\frac{T}{E[T]},\,\mathrm{Exp}(1)\right)\;\leq\;C_{A}\,(p+|\alpha|).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S1.SS3.p10" class="ltx_para"&gt;
&lt;p id="S1.SS3.p10.1" class="ltx_p"&gt;See Theorem &lt;a href="#S4.Thmtheorem15" title="Theorem 4.15 (Two-sided bound). ‣ 4.4 The Sharp Two-Sided Bound ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.15&lt;/span&gt;&lt;/a&gt; for details. The template $p+|\alpha|$ reflects two independent error sources: a &lt;em id="S1.SS3.p10.1.1" class="ltx_emph ltx_font_italic"&gt;lattice error&lt;/em&gt; $\Theta(p)$ from the integrality of the attempt count, and a &lt;em id="S1.SS3.p10.1.2" class="ltx_emph ltx_font_italic"&gt;perturbation error&lt;/em&gt; $\Theta(|\alpha|)$ from the successful attempt’s length mismatch. The $p$-term is irreducible, as shown by Proposition &lt;a href="#S4.Thmtheorem16" title="Proposition 4.16 (Counterexample: 𝑝 cannot be dropped). ‣ 4.4 The Sharp Two-Sided Bound ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.16&lt;/span&gt;&lt;/a&gt;; the
$|\alpha|$-term is forced by the Laplace-transform lower bound and is dominant in the CCP regime. The upper bound rests on a Bridge Theorem (Theorem &lt;a href="#S4.Thmtheorem13" title="Theorem 4.13 (Bridge Theorem). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.13&lt;/span&gt;&lt;/a&gt;) that decomposes the approximation via Brown’s quantitative Rényi theorem (&lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib6" title="" class="ltx_ref"&gt;6&lt;/a&gt;]&lt;/cite&gt;); the lower bound combines a lattice argument with evaluation of the Laplace expansion.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS3.p11" class="ltx_para ltx_noindent"&gt;
&lt;p id="S1.SS3.p11.1" class="ltx_p"&gt;&lt;span id="S1.SS3.p11.1.1" class="ltx_text ltx_font_bold"&gt;V. CCP specialization and phase transition.&lt;/span&gt;
We instantiate the theory to the coupon collector problem with $m$ reset coupons among $n+m$ types (§&lt;a href="#S6" title="6 Application: Coupon Collector with Reset ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;). The specialization yields:&lt;/p&gt;
&lt;ul id="S1.I3" class="ltx_itemize"&gt;
&lt;li id="S1.I3.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S1.I3.i1.p1" class="ltx_para"&gt;
&lt;p id="S1.I3.i1.p1.1" class="ltx_p"&gt;Closed-form expressions for $E[T]$ and $\operatorname{Var}(T)\text{,}$ together with an explicit harmonic realization of the DRP staircase for higher moments (§&lt;a href="#S6.SS3" title="6.3 Moments ‣ 6 Application: Coupon Collector with Reset ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6.3&lt;/span&gt;&lt;/a&gt;);&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S1.I3.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S1.I3.i2.p1" class="ltx_para"&gt;
&lt;p id="S1.I3.i2.p1.1" class="ltx_p"&gt;The CCP-specific bound $d_{K}\in[1-o(1),\,2+o(1)]\cdot|\alpha|$ with $|\alpha|\sim m!\,m\ln n/n^{m}$ (Theorem &lt;a href="#S6.Thmtheorem4" title="Theorem 6.4 (CCP sharp bound). ‣ 6.4 Phase Transition and Sharp Kolmogorov Bound ‣ 6 Application: Coupon Collector with Reset ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6.4&lt;/span&gt;&lt;/a&gt;), closing the logarithmic gap left by the smoothing approach;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S1.I3.i3" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S1.I3.i3.p1" class="ltx_para"&gt;
&lt;p id="S1.I3.i3.p1.1" class="ltx_p"&gt;A &lt;em id="S1.I3.i3.p1.1.1" class="ltx_emph ltx_font_italic"&gt;discontinuous Gumbel-to-Exponential phase transition&lt;/em&gt; at $m=0\to m\geq 1\text{:}$ one reset coupon suffices to replace extreme-value waiting ($(T_{0}-n\ln n)/n\xrightarrow{d}\text{Gumbel}$) by geometric waiting ($T/E[T]\to$ Exponential).&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div id="S1.SS3.p12" class="ltx_para ltx_noindent"&gt;
&lt;p id="S1.SS3.p12.1" class="ltx_p"&gt;&lt;span id="S1.SS3.p12.1.1" class="ltx_text ltx_font_bold"&gt;VI. Continuous-time sharpening.&lt;/span&gt;
Replacing PGFs by Laplace transforms and the multiplicative shift $u=ws$ by an additive shift $\sigma=\lambda+r\text{,}$ the entire discrete theory carries over to continuous time (§&lt;a href="#S5" title="5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;), with one qualitative sharpening and one quantitative simplification.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS3.p13" class="ltx_para"&gt;
&lt;p id="S1.SS3.p13.1" class="ltx_p"&gt;The &lt;em id="S1.SS3.p13.1.1" class="ltx_emph ltx_font_italic"&gt;sharpening&lt;/em&gt;: the geometric-tail gap of Theorem &lt;a href="#S1.Thmtheorem2" title="Theorem 1.2 (Characterization). ‣ 1.3 Main Results ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1.2&lt;/span&gt;&lt;/a&gt; closes. Among continuous-time age-based catastrophe mechanisms, affine Laplace structure characterizes &lt;em id="S1.SS3.p13.1.2" class="ltx_emph ltx_font_italic"&gt;full&lt;/em&gt; Poisson resetting—constant hazard everywhere, with no residual first-step degree of freedom (Theorem &lt;a href="#S5.Thmtheorem7" title="Theorem 5.7 (Continuous-time characterization). ‣ 5.4 Characterization: Affine Laplace Structure Is Poisson ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.7&lt;/span&gt;&lt;/a&gt;). The mechanism is twofold: point masses $T_{0}=\delta_{x}$ with continuous $x$ determine the function $\psi$ on all of $(0,1)\text{,}$ and the relation $F=\rho\,S+c$ is &lt;em id="S1.SS3.p13.1.3" class="ltx_emph ltx_font_italic"&gt;differentiated&lt;/em&gt; rather than &lt;em id="S1.SS3.p13.1.4" class="ltx_emph ltx_font_italic"&gt;differenced&lt;/em&gt;, constraining the hazard rate at every point.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS3.p14" class="ltx_para"&gt;
&lt;p id="S1.SS3.p14.1" class="ltx_p"&gt;The &lt;em id="S1.SS3.p14.1.1" class="ltx_emph ltx_font_italic"&gt;simplification&lt;/em&gt; is conditional rather than unconditional: In continuous time, the lattice error disappears. In the regime $|\alpha|\gg p\text{,}$ the sharp template reduces to $|\alpha|\text{;}$ when $\alpha$ is small, a residual $O(p)$ term may remain. In the Brownian first-passage model of &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib15" title="" class="ltx_ref"&gt;16&lt;/a&gt;]&lt;/cite&gt;, this yields $d_{\mathrm{K}}\!\left(\frac{T}{E[T]},\,\operatorname{Exp}(1)\right)\in[1-o(1),\,2+o(1)]\cdot|\alpha|$ (§&lt;a href="#S5.SS6" title="5.6 Worked Example: Brownian First Passage ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.6&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S1.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="architecture-of-the-paper"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;1.4 &lt;/span&gt;Architecture of the Paper&lt;/h3&gt;
&lt;div id="S1.SS4.p1" class="ltx_para"&gt;
&lt;p id="S1.SS4.p1.1" class="ltx_p"&gt;The paper is organized as follows. §&lt;a href="#S2" title="2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; derives the PGF formula, identifies the affine structure, and establishes the coefficient equality. §&lt;a href="#S2.SS2" title="2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt; proves the derivative reduction principle and the moment recursion. §&lt;a href="#S3" title="3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; establishes the characterization theorem via a Möbius rigidity argument. §&lt;a href="#S4" title="4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; develops the exponential approximation: the Laplace expansion, the Bridge Theorem, and the sharp two-sided Kolmogorov bound $d_{K}\asymp p+|\alpha|\text{,}$ including a counterexample showing that neither term is redundant. §&lt;a href="#S5" title="5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; presents the continuous-time counterpart—replacing PGFs by Laplace transforms and the multiplicative shift by an additive one—and shows that the geometric-tail gap closes: affine Laplace structure characterizes full Poisson resetting. §&lt;a href="#S6" title="6 Application: Coupon Collector with Reset ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt; and §&lt;a href="#S7" title="7 Application: Multi-Phase Task with Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt; instantiate the theory to two structurally contrasting applications: the coupon collector with reset coupons, which produces a harmonic moment staircase and a Gumbel-to-Exponential phase transition, and a multi-phase task under catastrophe, which produces an algebraic staircase and a Gaussian-to-exponential transition with exponentially fast convergence. §&lt;a href="#S8" title="8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt; discusses related work, and §&lt;a href="#S9" title="9 Further Directions ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;9&lt;/span&gt;&lt;/a&gt; outlines further directions.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S2" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="completion-time-under-memoryless-catastrophe"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;2 &lt;/span&gt;Completion Time under Memoryless Catastrophe&lt;/h2&gt;
&lt;section id="S2.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="model-and-pgf-formula"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;2.1 &lt;/span&gt;Model and PGF Formula&lt;/h3&gt;
&lt;div id="S2.SS1.p1" class="ltx_para"&gt;
&lt;p id="S2.SS1.p1.1" class="ltx_p"&gt;Let $T_{0}$ be a positive-integer-valued, almost surely finite random variable, called the &lt;em id="S2.SS1.p1.1.1" class="ltx_emph ltx_font_italic"&gt;base completion time&lt;/em&gt;, with $\pi_{j}=P(T_{0}=j)$ for $j\geq 1$ and PGF $g(z)=G_{T_{0}}(z)=\sum_{k\geq 0}P(T_{0}=k)\,z^{k}$ for $|z|\leq 1\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmtheorem1" class="ltx_theorem ltx_theorem_definition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmtheorem1.2" class="ltx_text ltx_font_bold"&gt;Definition 2.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmtheorem1.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Memoryless catastrophe)&lt;span id="S2.Thmtheorem1.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmtheorem1.p1.1" class="ltx_p"&gt;Fix $q\in(0,1)$ and set $s=1-q\text{.}$ At each step, independently of everything else, a catastrophe occurs with probability $q\text{.}$ If the process survives (probability $s$), the base task may advance; if a catastrophe occurs and the base task has not yet completed, all accumulated progress is destroyed and the process restarts from scratch. The process terminates at the first step where it survives the catastrophe and the base task completes.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS1.p2" class="ltx_para"&gt;
&lt;p id="S2.SS1.p2.1" class="ltx_p"&gt;A maximal run of steps uninterrupted by catastrophe is called an &lt;em id="S2.SS1.p2.1.1" class="ltx_emph ltx_font_italic"&gt;attempt&lt;/em&gt;. Each attempt begins from the empty state and either &lt;em id="S2.SS1.p2.1.2" class="ltx_emph ltx_font_italic"&gt;succeeds&lt;/em&gt; (the base task completes) or &lt;em id="S2.SS1.p2.1.3" class="ltx_emph ltx_font_italic"&gt;fails&lt;/em&gt; (terminated by catastrophe). Since the base task completes at step $t$ with no prior catastrophe with probability $s^{t}\,\pi_{t}$ (independence), the success probability is&lt;/p&gt;
&lt;table id="S2.E5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$p\;=\;\sum_{t\geq 1}s^{t}\,\pi_{t}\;=\;g(s)\;\in\;(0,1).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(5)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.SS1.p2.2" class="ltx_p"&gt;Successive attempts are independent (each restarts from the empty state), so the number of failed attempts before the first success is $N\sim\mathrm{Geom}_{0}(p)\text{.}$&lt;span id="footnote1" class="ltx_note ltx_role_footnote"&gt;&lt;sup class="ltx_note_mark"&gt;1&lt;/sup&gt;&lt;span class="ltx_note_outer"&gt;&lt;span class="ltx_note_content"&gt;&lt;sup class="ltx_note_mark"&gt;1&lt;/sup&gt;
&lt;span class="ltx_tag ltx_tag_note"&gt;1&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; We write $\mathrm{Geom}_{0}(p)$ for the distribution on $\{0,1,2,\ldots\}$ with $P(N=k)=(1-p)^{k}p$ (failure count), and $\mathrm{Geom}_{1}(p)=\mathrm{Geom}_{0}(p)+1$ for the trial count.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id="S2.SS1.p3" class="ltx_para"&gt;
&lt;p id="S2.SS1.p3.1" class="ltx_p"&gt;Denote by $A$ the length of a generic failed attempt, by $B$ the length of the successful attempt, and let $A_{1},A_{2},\ldots$ be i.i.d. copies of $A\text{.}$ The total completion time decomposes as&lt;/p&gt;
&lt;table id="S2.E6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$T\;=\;\sum_{i=1}^{N}A_{i}\;+\;B,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(6)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.SS1.p3.2" class="ltx_p"&gt;where $N\text{,}$ $(A_{i})_{i\geq 1}\text{,}$ and $B$ are mutually independent. Standard conditioning (Bayes’ rule on the success/failure event) yields the PGFs&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="S2.EGx1"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S2.E7"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S2.E8"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle G_{B}(w) &amp;amp; \displaystyle=\frac{g(ws)}{p}, \\[4pt]
\displaystyle G_{A}(w) &amp;amp; \displaystyle=\frac{qw\bigl(1-g(ws)\bigr)}{(1-p)(1-ws)},
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no paper-eqgroup-no-rows"&gt;&lt;span class="paper-eqgroup-number"&gt;(7)&lt;/span&gt;&lt;span class="paper-eqgroup-number"&gt;(8)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p id="S2.SS1.p3.3" class="ltx_p"&gt;where (&lt;a href="#S2.E8" title="In 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt;) uses the identity $\sum_{j\geq 0}z^{j}P(T_{0}&amp;gt;j)=(1-g(z))/(1-z)\text{.}$ Combining these with the geometric-sum PGF $E[G_{A}(w)^{N}]=p/(1-(1-p)G_{A}(w))$ gives the following.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmtheorem2" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmtheorem2.2" class="ltx_text ltx_font_bold"&gt;Theorem 2.2&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmtheorem2.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(PGF formula)&lt;span id="S2.Thmtheorem2.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmtheorem2.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmtheorem2.p1.1" class="ltx_p"&gt;&lt;span id="S2.Thmtheorem2.p1.1.1" class="ltx_text ltx_font_italic"&gt;Under memoryless catastrophe with rate $q\text{,}$ the PGF of the completion time is&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.E9" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$G_{T}(w)\;=\;\frac{g(u)(1-u)}{1-w+qw\,g(u)},\qquad u=ws.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(9)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS1.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S2.SS1.p4" class="ltx_para"&gt;
&lt;p id="S2.SS1.p4.1" class="ltx_p"&gt;&lt;span id="S2.SS1.p4.1.1" class="ltx_text"&gt;By (&lt;a href="#S2.E6" title="In 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;) and mutual independence, $G_{T}=G_{B}\cdot E[G_{A}^{N}]\text{.}$ Substituting (&lt;a href="#S2.E7" title="In 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;) and (&lt;a href="#S2.E8" title="In 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt;):&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.Ex6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$G_{T}(w)=\frac{g(u)}{p}\cdot\frac{p}{1-\dfrac{qw(1-g(u))}{1-u}}=\frac{g(u)(1-u)}{(1-u)-qw(1-g(u))}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.SS1.p4.2" class="ltx_p"&gt;&lt;span id="S2.SS1.p4.2.1" class="ltx_text"&gt;The denominator simplifies: $(1-ws)-qw+qw\,g(u)=1-w(s+q)+qw\,g(u)=1-w+qw\,g(u)\text{,}$ using $s+q=1\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.Thmtheorem3" class="ltx_theorem ltx_theorem_corollary"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmtheorem3.2" class="ltx_text ltx_font_bold"&gt;Corollary 2.3&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmtheorem3.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Expected completion time)&lt;span id="S2.Thmtheorem3.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmtheorem3.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmtheorem3.p1.1" class="ltx_p"&gt;$\displaystyle E[T]=\frac{1-p}{qp}$&lt;span id="S2.Thmtheorem3.p1.1.1" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS1.3" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S2.SS1.p5" class="ltx_para"&gt;
&lt;p id="S2.SS1.p5.1" class="ltx_p"&gt;&lt;span id="S2.SS1.p5.1.1" class="ltx_text"&gt;Differentiating (&lt;a href="#S2.E9" title="In Theorem 2.2 (PGF formula). ‣ 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;9&lt;/span&gt;&lt;/a&gt;): $G_{T}(w)-1=(1-w)(g(u)-1)/(1-w+qwg(u))$ (using $1-u-qw=1-w$), so $E[T]=\lim_{w\to 1}(G_{T}(w)-1)/(w-1)=(1-p)/(qp)\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S2.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="affine-structure-and-the-derivative-reduction-principle"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;2.2 &lt;/span&gt;Affine Structure and the Derivative Reduction Principle&lt;/h3&gt;
&lt;div id="S2.SS2.p1" class="ltx_para"&gt;
&lt;p id="S2.SS2.p1.1" class="ltx_p"&gt;We now identify the structural property of (&lt;a href="#S2.E9" title="In Theorem 2.2 (PGF formula). ‣ 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;9&lt;/span&gt;&lt;/a&gt;) that drives all subsequent results.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmtheorem4" class="ltx_theorem ltx_theorem_definition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmtheorem4.2" class="ltx_text ltx_font_bold"&gt;Definition 2.4&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmtheorem4.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Uniform affine PGF structure)&lt;span id="S2.Thmtheorem4.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmtheorem4.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmtheorem4.p1.1" class="ltx_p"&gt;A catastrophe mechanism has uniform affine PGF structure if there exist functions
$a(w),b(w),c(w),d(w)\text{,}$ analytic in a neighborhood of $w=1\text{,}$ depending only on the mechanism
(not on the base process $T_{0}$), and a linear function $u(w)$ with $u(1)\in(0,1)\text{,}$ such that for all base processes $T_{0}\text{,}$&lt;/p&gt;
&lt;table id="S2.Ex7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$G_{T}(w)=\frac{a(w)\,g(u(w))+b(w)}{c(w)\,g(u(w))+d(w)},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.Thmtheorem4.p1.2" class="ltx_p"&gt;with $a$ and $c$ not identically zero, and the non-degeneracy condition $c(1)\,g(u(1))+d(1)\neq 0$ for all admissible $g\text{.}$&lt;span id="footnote2" class="ltx_note ltx_role_footnote"&gt;&lt;sup class="ltx_note_mark"&gt;2&lt;/sup&gt;&lt;span class="ltx_note_outer"&gt;&lt;span class="ltx_note_content"&gt;&lt;sup class="ltx_note_mark"&gt;2&lt;/sup&gt;
&lt;span class="ltx_tag ltx_tag_note"&gt;2&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; Non-degeneracy excludes pathological representations obtained by multiplying numerator and denominator by a factor vanishing at $w=1\text{,}$ which would create a $0/0$ indeterminacy and invalidate the coefficient-matching argument.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.Thmtheorem5" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmtheorem5.2" class="ltx_text ltx_font_bold"&gt;Proposition 2.5&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmtheorem5.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Affine structure and coefficient equality)&lt;span id="S2.Thmtheorem5.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmtheorem5.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmtheorem5.p1.1" class="ltx_p"&gt;&lt;span id="S2.Thmtheorem5.p1.1.1" class="ltx_text ltx_font_italic"&gt;The PGF formula (&lt;a href="#S2.E9" title="In Theorem 2.2 (PGF formula). ‣ 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;9&lt;/span&gt;&lt;/a&gt;) exhibits uniform affine structure with&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.Ex8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$a(w)=1-u,\quad b(w)=0,\quad c(w)=qw,\quad d(w)=1-w,\quad u(w)=ws.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.Thmtheorem5.p1.2" class="ltx_p"&gt;&lt;span id="S2.Thmtheorem5.p1.2.1" class="ltx_text ltx_font_italic"&gt;Writing $N(w)=a(w)\,g(u)+b(w)$ and $D(w)=c(w)\,g(u)+d(w)$ for the numerator and denominator, the normalization $G_{T}(1)=1$ forces&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.E10" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\alpha_{N}(1)\;:=\;a(1)\;=\;q\;=\;c(1)\;=:\;\alpha_{D}(1).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(10)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS2.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S2.SS2.p2" class="ltx_para"&gt;
&lt;p id="S2.SS2.p2.1" class="ltx_p"&gt;&lt;span id="S2.SS2.p2.1.1" class="ltx_text"&gt;Immediate from (&lt;a href="#S2.E9" title="In Theorem 2.2 (PGF formula). ‣ 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;9&lt;/span&gt;&lt;/a&gt;): at $w=1\text{,}$ $b(1)=0=d(1)\text{,}$ so $G_{T}(1)=1$ gives $a(1)\,g(s)=c(1)\,g(s)$ and $a(1)=c(1)$ (since $g(s)=p&amp;gt;0$); since $a(1)=1-s=q\text{,}$ the result follows.
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS2.p3" class="ltx_para"&gt;
&lt;p id="S2.SS2.p3.1" class="ltx_p"&gt;The coefficient equality (&lt;a href="#S2.E10" title="In Proposition 2.5 (Affine structure and coefficient equality). ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;10&lt;/span&gt;&lt;/a&gt;) is a direct consequence of the probability axiom $G_{T}(1)=1$ applied to the affine form. Together with the linearity of $u(w)=ws$ and the affine dependence on $g(u)\text{,}$ it produces an exact derivative cancellation at every moment level.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS2.p4" class="ltx_para"&gt;
&lt;p id="S2.SS2.p4.1" class="ltx_p"&gt;The PGF formula expresses $G_{T}(w)=N(w)/D(w)\text{,}$ where&lt;/p&gt;
&lt;table id="S2.E11" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$N(w)=(1-u)\,g(u),\qquad D(w)=(1-w)+qw\,g(u),\qquad u=ws.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(11)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.SS2.p4.2" class="ltx_p"&gt;The $k$-th factorial moment is $\eta_{k}=G_{T}^{(k)}(1)\text{.}$ Since $u=ws$ is linear, $\frac{d^{j}}{dw^{j}}g(ws)=s^{j}g^{(j)}(ws)$ with no Faà di Bruno corrections. Writing $D_{j}=g^{(j)}(s)\text{,}$ one might expect $\eta_{k}$ to depend on the full $k$-jet $\{D_{0},\ldots,D_{k}\}\text{.}$ The following theorem shows that $D_{k}$ cancels exactly.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmtheorem6" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmtheorem6.2" class="ltx_text ltx_font_bold"&gt;Theorem 2.6&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmtheorem6.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Derivative reduction principle)&lt;span id="S2.Thmtheorem6.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmtheorem6.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmtheorem6.p1.1" class="ltx_p"&gt;&lt;span id="S2.Thmtheorem6.p1.1.1" class="ltx_text ltx_font_italic"&gt;Define $\Delta_{k}=N^{(k)}(1)-D^{(k)}(1)$ for $k\geq 1\text{.}$ Then&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.E12" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Delta_{k}=\begin{cases}1-p,&amp;amp;k=1,\\[3.0pt] -k\,s^{k-1}\,D_{k-1},&amp;amp;k\geq 2.\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(12)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.Thmtheorem6.p1.2" class="ltx_p"&gt;&lt;span id="S2.Thmtheorem6.p1.2.1" class="ltx_text ltx_font_italic"&gt;In particular, $\Delta_{k}$ does not contain $D_{k}=g^{(k)}(s)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS2.3" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S2.SS2.p5" class="ltx_para"&gt;
&lt;p id="S2.SS2.p5.1" class="ltx_p"&gt;&lt;span id="S2.SS2.p5.1.1" class="ltx_text"&gt;We compute $N^{(k)}(1)$ and $D^{(k)}(1)$ separately via the Leibniz rule, then subtract.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS2.p6" class="ltx_para ltx_noindent"&gt;
&lt;p id="S2.SS2.p6.1" class="ltx_p"&gt;&lt;em id="S2.SS2.p6.1.1" class="ltx_emph ltx_font_italic"&gt;Case $k\geq 2\text{.}$&lt;/em&gt; 
Write $N(w)=f_{1}(w)\cdot g(ws)$ with $f_{1}(w)=1-ws\text{.}$ Since $f_{1}(1)=q\text{,}$ $f_{1}^{\prime}(w)=-s\text{,}$ and $f_{1}^{(j)}=0$ for $j\geq 2\text{,}$ the Leibniz rule gives&lt;/p&gt;
&lt;table id="S2.E13" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$N^{(k)}(1)=q\,s^{k}D_{k}-k\,s^{k}D_{k-1}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(13)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.SS2.p6.2" class="ltx_p"&gt;Similarly, $D(w)=(1-w)+f_{2}(w)\cdot g(ws)$ with $f_{2}(w)=qw\text{.}$ For $k\geq 2\text{,}$ $\frac{d^{k}}{dw^{k}}(1-w)=0\text{.}$ Since $f_{2}(1)=q\text{,}$ $f_{2}^{\prime}(w)=q\text{,}$ and $f_{2}^{(j)}=0$ for $j\geq 2\text{:}$&lt;/p&gt;
&lt;table id="S2.E14" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$D^{(k)}(1)=q\,s^{k}D_{k}+k\,q\,s^{k-1}D_{k-1}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(14)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.SS2.p6.3" class="ltx_p"&gt;Subtracting (&lt;a href="#S2.E14" title="In Proof. ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;14&lt;/span&gt;&lt;/a&gt;) from (&lt;a href="#S2.E13" title="In Proof. ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;13&lt;/span&gt;&lt;/a&gt;):&lt;/p&gt;
&lt;table id="S2.Ex9" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Delta_{k}=\underbrace{(q\,s^{k}-q\,s^{k})}_{=0}\,D_{k}+\bigl(-k\,s^{k}-k\,q\,s^{k-1}\bigr)\,D_{k-1}=-k\,s^{k-1}(s+q)\,D_{k-1}=-k\,s^{k-1}D_{k-1},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.SS2.p6.4" class="ltx_p"&gt;where the last step uses $s+q=1\text{.}$ The $D_{k}$-terms cancel because they enter $N^{(k)}(1)$ and $D^{(k)}(1)$ with the same coefficient $q\,s^{k}$—precisely the coefficient equality (&lt;a href="#S2.E10" title="In Proposition 2.5 (Affine structure and coefficient equality). ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;10&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS2.p7" class="ltx_para ltx_noindent"&gt;
&lt;p id="S2.SS2.p7.1" class="ltx_p"&gt;&lt;em id="S2.SS2.p7.1.1" class="ltx_emph ltx_font_italic"&gt;Case $k=1\text{.}$&lt;/em&gt; 
Direct computation: $N^{\prime}(1)=-sp+qsD_{1}\text{,}$ $D^{\prime}(1)=-1+qp+qsD_{1}\text{.}$ Hence&lt;/p&gt;
&lt;table id="S2.Ex10" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Delta_{1}=(-sp+qsD_{1})-(-1+qp+qsD_{1})=1-p(s+q)=1-p.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS2.p8" class="ltx_para"&gt;
&lt;p id="S2.SS2.p8.1" class="ltx_p"&gt;The next lemma extracts the cancellation mechanism behind Theorem &lt;a href="#S2.Thmtheorem6" title="Theorem 2.6 (Derivative reduction principle). ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.6&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmtheorem7" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmtheorem7.2" class="ltx_text ltx_font_bold"&gt;Lemma 2.7&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmtheorem7.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Affine-ratio recursion)&lt;span id="S2.Thmtheorem7.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmtheorem7.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmtheorem7.p1.1" class="ltx_p"&gt;&lt;span id="S2.Thmtheorem7.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.Ex11" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R(z)=\frac{a(z)h(u(z))+b(z)}{c(z)h(u(z))+d(z)},\qquad u(z)=u_{0}+\kappa(z-z_{*}),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.Thmtheorem7.p1.2" class="ltx_p"&gt;&lt;span id="S2.Thmtheorem7.p1.2.1" class="ltx_text ltx_font_italic"&gt;where $a,b,c,d$ are $C^{\infty}$ near $z_{*}\text{,}$ and $a(z_{*})=c(z_{*}),b(z_{*})=d(z_{*}),D(z_{*}):=c(z_{*})h(u_{0})+d(z_{*})\neq 0\text{.}$
Set&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.Ex12" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$N(z)=a(z)h(u(z))+b(z),\qquad D(z)=c(z)h(u(z))+d(z).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.Thmtheorem7.p1.3" class="ltx_p"&gt;&lt;span id="S2.Thmtheorem7.p1.3.1" class="ltx_text ltx_font_italic"&gt;Then, for every $k\geq 1\text{,}$ $\Delta_{k}:=N^{(k)}(z_{*})-D^{(k)}(z_{*})$ depends only on $h(u_{0}),h^{\prime}(u_{0}),\dots,h^{(k-1)}(u_{0})\text{,}$ and&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.Ex13" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{(k)}(z_{*})=\frac{1}{D(z_{*})}\left(\Delta_{k}-\sum_{j=1}^{k-1}\binom{k}{j}D^{(j)}(z_{*})R^{(k-j)}(z_{*})\right).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.Thmtheorem7.p1.4" class="ltx_p"&gt;&lt;span id="S2.Thmtheorem7.p1.4.1" class="ltx_text ltx_font_italic"&gt;Consequently, $R^{(k)}(z_{*})$ depends only on the $(k-1)$-jet of $h$ at $u_{0}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS2.4" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S2.SS2.p9" class="ltx_para"&gt;
&lt;p id="S2.SS2.p9.1" class="ltx_p"&gt;&lt;span id="S2.SS2.p9.1.1" class="ltx_text"&gt;Since $u$ is linear, $(h\circ u)^{(k)}(z_{*})=\kappa^{k}h^{(k)}(u_{0})$ and no Faà di Bruno terms appear. Hence the coefficient of $h^{(k)}(u_{0})$ in $N^{(k)}(z_{*})$ is $a(z_{*})\kappa^{k}\text{,}$ while in $D^{(k)}(z_{*})$ it is $c(z_{*})\kappa^{k}\text{;}$ these agree by $a(z_{*})=c(z_{*})\text{,}$ so $\Delta_{k}$ contains no $h^{(k)}(u_{0})\text{.}$ Differentiating the identity $D(z)R(z)=N(z)$ $k$ times at $z=z_{*}$ and isolating the $j=0$ and $j=k$ terms gives the displayed recursion.
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S2.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="moment-recursion-and-the-complexity-staircase"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;2.3 &lt;/span&gt;Moment Recursion and the Complexity Staircase&lt;/h3&gt;
&lt;div id="S2.Thmtheorem8" class="ltx_theorem ltx_theorem_corollary"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmtheorem8.2" class="ltx_text ltx_font_bold"&gt;Corollary 2.8&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmtheorem8.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Moment recursion)&lt;span id="S2.Thmtheorem8.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmtheorem8.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmtheorem8.p1.1" class="ltx_p"&gt;&lt;span id="S2.Thmtheorem8.p1.1.1" class="ltx_text ltx_font_italic"&gt;The factorial moments of $T$ satisfy $\eta_{0}=1$ and, for $k\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.E15" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\eta_{k}=\frac{1}{pq}\left(\Delta_{k}-\sum_{j=1}^{k-1}\binom{k}{j}D^{(j)}(1)\,\eta_{k-j}\right),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(15)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.Thmtheorem8.p1.2" class="ltx_p"&gt;&lt;span id="S2.Thmtheorem8.p1.2.1" class="ltx_text ltx_font_italic"&gt;where $D^{(j)}(1)$ is the $j$-th derivative of $D(w)=(1-w)+qw\,g(ws)$ at $w=1\text{.}$ Since $\Delta_{k}$ involves at most $D_{k-1}$ (Theorem &lt;a href="#S2.Thmtheorem6" title="Theorem 2.6 (Derivative reduction principle). ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.6&lt;/span&gt;&lt;/a&gt;) and $D^{(j)}(1)$ involves at most $D_{j}$ for $j\leq k-1$ (by (&lt;a href="#S2.E14" title="In Proof. ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;14&lt;/span&gt;&lt;/a&gt;)), induction on $k$ confirms: $\eta_{k}$ depends on the $(k{-}1)$-jet $\{D_{0},D_{1},\ldots,D_{k-1}\}\text{,}$ never on $D_{k}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS3.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S2.SS3.p1" class="ltx_para"&gt;
&lt;p id="S2.SS3.p1.1" class="ltx_p"&gt;&lt;span id="S2.SS3.p1.1.1" class="ltx_text"&gt;Apply the Leibniz rule to $D\cdot G_{T}=N$ at $w=1\text{,}$ separate the $j=0$ and $j=k$ terms, and use $\Delta_{k}=N^{(k)}(1)-D^{(k)}(1)$ to cancel $D^{(k)}(1)\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS3.p2" class="ltx_para"&gt;
&lt;p id="S2.SS3.p2.1" class="ltx_p"&gt;The low-order derivatives of $D$ at $w=1$ are:&lt;/p&gt;
&lt;table id="S2.E16" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$D(1)=qp,\qquad D^{\prime}(1)=-1+qp+qsD_{1},\qquad D^{\prime\prime}(1)=2qsD_{1}+qs^{2}D_{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(16)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S2.Thmtheorem9" class="ltx_theorem ltx_theorem_example"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmtheorem9.2" class="ltx_text ltx_font_bold"&gt;Example 2.9&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmtheorem9.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(First two moments)&lt;span id="S2.Thmtheorem9.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmtheorem9.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmtheorem9.p1.1" class="ltx_p"&gt;From (&lt;a href="#S2.E15" title="In Corollary 2.8 (Moment recursion). ‣ 2.3 Moment Recursion and the Complexity Staircase ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;15&lt;/span&gt;&lt;/a&gt;) with $k=1\text{:}$ $\eta_{1}=(1-p)/(pq)\text{,}$ recovering Corollary &lt;a href="#S2.Thmtheorem3" title="Corollary 2.3 (Expected completion time). ‣ 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt;. With $k=2\text{:}$ $\eta_{2}=\frac{1}{pq}(-2sD_{1}-2D^{\prime}(1)\,\eta_{1})\text{.}$ The variance $\operatorname{Var}(T)=\eta_{2}+\eta_{1}-\eta_{1}^{2}$ simplifies to&lt;/p&gt;
&lt;table id="S2.E17" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\operatorname{Var}(T)=\frac{(1-p)(1+ps)-2qsD_{1}}{p^{2}q^{2}},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(17)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.Thmtheorem9.p1.2" class="ltx_p"&gt;which depends on $p=D_{0}$ and $D_{1}=g^{\prime}(s)$ but not on $D_{2}$—exactly as the DRP predicts.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS3.p3" class="ltx_para"&gt;
&lt;p id="S2.SS3.p3.1" class="ltx_p"&gt;The DRP asserts that each moment level requires at most $D_{k-1}\text{.}$ The following shows that, for base processes with sufficiently rich structure, it requires &lt;em id="S2.SS3.p3.1.1" class="ltx_emph ltx_font_italic"&gt;exactly&lt;/em&gt; $D_{k-1}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmtheorem10" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmtheorem10.2" class="ltx_text ltx_font_bold"&gt;Proposition 2.10&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmtheorem10.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Tightness of the staircase)&lt;span id="S2.Thmtheorem10.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmtheorem10.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmtheorem10.p1.1" class="ltx_p"&gt;&lt;span id="S2.Thmtheorem10.p1.1.1" class="ltx_text ltx_font_italic"&gt;For $k\geq 2\text{,}$ the total coefficient of $D_{k-1}$ in $\eta_{k}$ is $-ks^{k-1}/(p^{2}q)\neq 0\text{,}$ provided $D_{k-1}\neq 0\text{.}$ The latter holds whenever $P(T_{0}\geq k)&amp;gt;0\text{.}$ In particular, for base processes with unbounded support, every moment level introduces exactly one new derivative of $g\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS3.3" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S2.SS3.p4" class="ltx_para"&gt;
&lt;p id="S2.SS3.p4.1" class="ltx_p"&gt;&lt;span id="S2.SS3.p4.1.1" class="ltx_text"&gt;By Theorem &lt;a href="#S2.Thmtheorem6" title="Theorem 2.6 (Derivative reduction principle). ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.6&lt;/span&gt;&lt;/a&gt;, $\Delta_{k}=-ks^{k-1}D_{k-1}$ for $k\geq 2\text{.}$ By induction, $\eta_{k-j}$ for $j\geq 1$ depends on $\{D_{0},\ldots,D_{k-j-1}\}\text{,}$ so $D_{k-1}$ enters the sum in (&lt;a href="#S2.E15" title="In Corollary 2.8 (Moment recursion). ‣ 2.3 Moment Recursion and the Complexity Staircase ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;15&lt;/span&gt;&lt;/a&gt;) only through the $j=k-1$ term $D^{(k-1)}(1)\,\eta_{1}\text{,}$ where $D^{(k-1)}(1)$ contains $D_{k-1}$ with coefficient $qs^{k-1}\text{.}$ Combining: the total coefficient of $D_{k-1}$ in $\eta_{k}$ is $\frac{1}{pq}(-ks^{k-1}-k\,qs^{k-1}\,\eta_{1})=\frac{-ks^{k-1}}{pq}(1+q\eta_{1})=\frac{-ks^{k-1}}{p^{2}q}\text{,}$ using $\eta_{1}=(1-p)/(pq)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS3.p5" class="ltx_para"&gt;
&lt;p id="S2.SS3.p5.1" class="ltx_p"&gt;&lt;span id="S2.SS3.p5.1.1" class="ltx_text"&gt;For the second claim: $g^{(k-1)}(s)=\sum_{t\geq k}\frac{t!}{(t-k+1)!}\pi_{t}s^{t-k+1}&amp;gt;0$ whenever some $\pi_{t}&amp;gt;0$ for $t\geq k\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS3.p6" class="ltx_para"&gt;
&lt;p id="S2.SS3.p6.1" class="ltx_p"&gt;Together, Theorem &lt;a href="#S2.Thmtheorem6" title="Theorem 2.6 (Derivative reduction principle). ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.6&lt;/span&gt;&lt;/a&gt; and Proposition &lt;a href="#S2.Thmtheorem10" title="Proposition 2.10 (Tightness of the staircase). ‣ 2.3 Moment Recursion and the Complexity Staircase ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.10&lt;/span&gt;&lt;/a&gt; establish a sharp complexity staircase: for base processes with unbounded support, each moment of $T$ introduces exactly one new derivative of $g\text{,}$ and this staircase collapses only when $T_{0}$ has bounded support.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S3" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="characterization-of-geometric-tail-catastrophe"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;3 &lt;/span&gt;Characterization of Geometric-Tail Catastrophe&lt;/h2&gt;
&lt;div id="S3.p1" class="ltx_para"&gt;
&lt;p id="S3.p1.1" class="ltx_p"&gt;§&lt;a href="#S2" title="2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; established a chain of implications under memoryless catastrophe:&lt;/p&gt;
&lt;table id="S3.Ex14" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\text{memoryless catastrophe}\;\Longrightarrow\;\text{affine PGF structure}\;\Longrightarrow\;\text{derivative reduction (DRP)}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.p1.2" class="ltx_p"&gt;A natural question arises: &lt;em id="S3.p1.2.1" class="ltx_emph ltx_font_italic"&gt;is memoryless catastrophe the only mechanism producing these properties, or do they hold more broadly?&lt;/em&gt; This section answers the question precisely. The answer is that affine PGF structure—and hence the DRP—characterizes a slightly larger class, which we call &lt;em id="S3.p1.2.2" class="ltx_emph ltx_font_italic"&gt;geometric-tail catastrophe&lt;/em&gt;: mechanisms whose hazard rate is constant from the second step onward, with the first-step hazard left free. Full memorylessness is the unique member of this class satisfying an additional algebraic condition ($p=g(s)$ rather than $p\propto g(s)$).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.p2" class="ltx_para"&gt;
&lt;p id="S3.p2.1" class="ltx_p"&gt;To state and prove this characterization, we first extend the framework of §&lt;a href="#S2" title="2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; to general age-based catastrophe mechanisms.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S3.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="general-hazard-framework"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.1 &lt;/span&gt;General Hazard Framework&lt;/h3&gt;
&lt;div id="S3.Thmtheorem1" class="ltx_theorem ltx_theorem_definition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmtheorem1.2" class="ltx_text ltx_font_bold"&gt;Definition 3.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmtheorem1.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Age-based catastrophe mechanism)&lt;span id="S3.Thmtheorem1.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmtheorem1.p1.1" class="ltx_p"&gt;An &lt;em id="S3.Thmtheorem1.p1.1.1" class="ltx_emph ltx_font_italic"&gt;age-based catastrophe mechanism&lt;/em&gt; is specified by a hazard sequence $(h_{t})_{t\geq 1}$ with $h_{t}\in(0,1)$ for all $t\text{.}$ Here $h_{t}$ is the conditional probability of catastrophe at step $t\text{,}$ given that no catastrophe has occurred in steps $1,\ldots,t-1\text{.}$ The associated &lt;em id="S3.Thmtheorem1.p1.1.2" class="ltx_emph ltx_font_italic"&gt;survival function&lt;/em&gt; is&lt;/p&gt;
&lt;table id="S3.E18" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$S(0)=1,\qquad S(t)=\prod_{i=1}^{t}(1-h_{i}),\quad t\geq 1.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(18)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.Thmtheorem1.p1.2" class="ltx_p"&gt;Thus $S(t)$ is the probability of surviving $t$ consecutive steps without catastrophe. The requirement $h_{t}\in(0,1)$ ensures $S(t)&amp;gt;0$ for all $t$ (every step has a positive probability of both survival and catastrophe).&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p1" class="ltx_para"&gt;
&lt;p id="S3.SS1.p1.1" class="ltx_p"&gt;Note that memoryless catastrophe (Definition &lt;a href="#S2.Thmtheorem1" title="Definition 2.1 (Memoryless catastrophe). ‣ 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;) is the special case $h_{t}\equiv q\text{,}$ giving $S(t)=s^{t}\text{.}$ The attempt decomposition (&lt;a href="#S2.E6" title="In 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;) remains valid under any age-based mechanism: each attempt starts from the empty state, so successive attempts are i.i.d. The success probability generalizes from $p=g(s)$ to&lt;/p&gt;
&lt;table id="S3.E19" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$p=\sum_{t\geq 1}S(t)\,\pi_{t},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(19)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS1.p1.2" class="ltx_p"&gt;which is no longer a PGF evaluation unless $S(t)$ is exponential in $t\text{.}$ The expected completion time generalizes from Theorem &lt;a href="#S2.Thmtheorem2" title="Theorem 2.2 (PGF formula). ‣ 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt; as follows.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.Thmtheorem2" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmtheorem2.2" class="ltx_text ltx_font_bold"&gt;Lemma 3.2&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmtheorem2.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Expected attempt length)&lt;span id="S3.Thmtheorem2.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmtheorem2.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmtheorem2.p1.1" class="ltx_p"&gt;&lt;span id="S3.Thmtheorem2.p1.1.1" class="ltx_text ltx_font_italic"&gt;Under an age-based mechanism with survival function $S\text{,}$ the expected length of a single attempt (regardless of outcome) satisfies&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.E20" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$E[\ell]=\sum_{j\geq 1}F(j)\,\pi_{j},\qquad F(j)=\sum_{t=0}^{j-1}S(t).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(20)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S3.SS1.p2" class="ltx_para"&gt;
&lt;p id="S3.SS1.p2.1" class="ltx_p"&gt;&lt;span id="S3.SS1.p2.1.1" class="ltx_text"&gt;Condition on $T_{0}=j\text{:}$ step $t\leq j$ is reached with probability $S(t-1)\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.Thmtheorem3" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmtheorem3.2" class="ltx_text ltx_font_bold"&gt;Proposition 3.3&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmtheorem3.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(General expected completion time)&lt;span id="S3.Thmtheorem3.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmtheorem3.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmtheorem3.p1.1" class="ltx_p"&gt;&lt;span id="S3.Thmtheorem3.p1.1.1" class="ltx_text ltx_font_italic"&gt;Assume $E[\ell]=\sum_{j\geq 1}F(j)\pi_{j}&amp;lt;\infty\text{.}$ Then&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.E21" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$E[T]=\frac{E[\ell]}{p}=\frac{\sum_{j\geq 1}F(j)\pi_{j}}{\sum_{j\geq 1}S(j)\pi_{j}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(21)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.3" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S3.SS1.p3" class="ltx_para"&gt;
&lt;p id="S3.SS1.p3.1" class="ltx_p"&gt;&lt;span id="S3.SS1.p3.1.1" class="ltx_text"&gt;The pairs $(\ell_{i},\mathrm{outcome}_{i})$ are i.i.d., and $M=N+1\sim\operatorname{Geom}_{1}(p)$ is a stopping time. Since $E[\ell]&amp;lt;\infty\text{,}$ Wald’s identity applies and gives $E[T]=E[\ell]\cdot E[M]=\frac{E[\ell]}{p}\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p4" class="ltx_para"&gt;
&lt;p id="S3.SS1.p4.1" class="ltx_p"&gt;Formula (&lt;a href="#S3.E21" title="In Proposition 3.3 (General expected completion time). ‣ 3.1 General Hazard Framework ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;21&lt;/span&gt;&lt;/a&gt;) expresses $E[T]$ as a ratio of two linear functionals of the base distribution $(\pi_{j})_{j\geq 1}\text{.}$ In the memoryless case, $S(t)=s^{t}$ makes the denominator $p=g(s)$—a PGF evaluation—and $E[T]$ depends on $T_{0}$ only through this single number. For a general mechanism, $E[T]$ depends on the full interaction between $(\pi_{j})$ and $S\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S3.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="geometric-tail-catastrophe"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.2 &lt;/span&gt;Geometric-Tail Catastrophe&lt;/h3&gt;
&lt;div id="S3.Thmtheorem4" class="ltx_theorem ltx_theorem_definition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmtheorem4.2" class="ltx_text ltx_font_bold"&gt;Definition 3.4&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmtheorem4.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Geometric-tail catastrophe)&lt;span id="S3.Thmtheorem4.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmtheorem4.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmtheorem4.p1.1" class="ltx_p"&gt;A hazard sequence $(h_{t})_{t\geq 1}$ has &lt;em id="S3.Thmtheorem4.p1.1.1" class="ltx_emph ltx_font_italic"&gt;geometric tail&lt;/em&gt; if there exist $a\in(0,1)$ and $q\in(0,1)$ such that&lt;/p&gt;
&lt;table id="S3.Ex15" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$h_{1}=1-a,\qquad h_{t}=q\quad\text{for all }t\geq 2.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.Thmtheorem4.p1.2" class="ltx_p"&gt;Equivalently, $S(t)=a\,s^{t-1}$ for $t\geq 1\text{,}$ where $s=1-q\text{.}$ The parameter $a=S(1)=1-h_{1}$ is the first-step survival probability. The special case $a=s$ (i.e., $h_{1}=q$) recovers memoryless catastrophe.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p1" class="ltx_para"&gt;
&lt;p id="S3.SS2.p1.1" class="ltx_p"&gt;The geometric-tail class has one degree of freedom beyond full memorylessness: the first-step hazard $h_{1}$ may differ from $q\text{.}$ The next proposition shows that every member of this class produces a PGF with affine structure, establishing the forward direction of the characterization.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.Thmtheorem5" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmtheorem5.2" class="ltx_text ltx_font_bold"&gt;Proposition 3.5&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmtheorem5.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Geometric-tail PGF formula)&lt;span id="S3.Thmtheorem5.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmtheorem5.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmtheorem5.p1.1" class="ltx_p"&gt;&lt;span id="S3.Thmtheorem5.p1.1.1" class="ltx_text ltx_font_italic"&gt;Under geometric-tail catastrophe with parameters $(a,q)\text{,}$ the success probability is $p=(a/s)\,g(s)$ and the completion-time PGF is&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.E22" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$G_{T}(w)=\frac{a(1-u)\,g(u)}{s(1-w)(1-w(s-a))+aqw\,g(u)},\qquad u=ws.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(22)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.Thmtheorem5.p1.2" class="ltx_p"&gt;&lt;span id="S3.Thmtheorem5.p1.2.1" class="ltx_text ltx_font_italic"&gt;This exhibits uniform affine PGF structure (Definition &lt;a href="#S2.Thmtheorem4" title="Definition 2.4 (Uniform affine PGF structure). ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.4&lt;/span&gt;&lt;/a&gt;) with coefficient equality $\alpha_{N}(1)=\alpha_{D}(1)=aq\text{.}$ Setting $a=s$ recovers the memoryless formula (&lt;a href="#S2.E9" title="In Theorem 2.2 (PGF formula). ‣ 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;9&lt;/span&gt;&lt;/a&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S3.SS2.p2" class="ltx_para"&gt;
&lt;p id="S3.SS2.p2.1" class="ltx_p"&gt;&lt;span id="S3.SS2.p2.1.1" class="ltx_text"&gt;Since $S(t)=as^{t-1}\text{,}$ the success probability is $p=(a/s)\,g(s)$ and the successful-attempt PGF is $G_{B}(w)=a\,g(u)/(ps)\text{,}$ where $u=ws\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p3" class="ltx_para"&gt;
&lt;p id="S3.SS2.p3.1" class="ltx_p"&gt;&lt;span id="S3.SS2.p3.1.1" class="ltx_text"&gt;For the failed-attempt PGF, note that the only departure from the memoryless calculation (§&lt;a href="#S2" title="2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;) is the first-step hazard $h_{1}=1-a\neq q\text{.}$ Splitting accordingly:&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex16" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(1-p)\,G_{A}(w)=w(1-a)+\frac{aqw}{s}\sum_{j\geq 1}u^{j}\,P(T_{0}&amp;gt;j).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS2.p3.2" class="ltx_p"&gt;&lt;span id="S3.SS2.p3.2.1" class="ltx_text"&gt;The identity $\sum_{j\geq 1}u^{j}P(T_{0}&amp;gt;j)=(u-g(u))/(1-u)$ (used in §&lt;a href="#S2" title="2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;) gives&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex17" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(1-p)\,G_{A}(w)=w(1-a)+\frac{aqw(u-g(u))}{s(1-u)}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS2.p3.3" class="ltx_p"&gt;&lt;span id="S3.SS2.p3.3.1" class="ltx_text"&gt;Substituting into $G_{T}=p\,G_{B}/[1-(1-p)G_{A}]$ and clearing denominators, the denominator simplifies (using $s+q=1$ and $u=ws$) to $s(1-w)(1-w(s-a))+aqw\,g(u)\text{,}$ yielding (&lt;a href="#S3.E22" title="In Proposition 3.5 (Geometric-tail PGF formula). ‣ 3.2 Geometric-Tail Catastrophe ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;22&lt;/span&gt;&lt;/a&gt;). (Setting $a=s$ eliminates the $1-w(s-a)$ factor and recovers (&lt;a href="#S2.E9" title="In Theorem 2.2 (PGF formula). ‣ 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;9&lt;/span&gt;&lt;/a&gt;).)&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p4" class="ltx_para"&gt;
&lt;p id="S3.SS2.p4.1" class="ltx_p"&gt;&lt;span id="S3.SS2.p4.1.1" class="ltx_text"&gt;The $g(u)$-coefficients are $\alpha_{N}(w)=a(1-u)$ and $\alpha_{D}(w)=aqw\text{,}$ giving $\alpha_{N}(1)=\alpha_{D}(1)=aq\text{.}$ Since the numerator has no $g$-free term ($\beta_{N}\equiv 0$) and $\beta_{D}(1)=0\text{,}$ we obtain $G_{T}(1)=1\text{.}$ Non-degeneracy: $D(1)=aqg(s)=pqs&amp;gt;0\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p5" class="ltx_para"&gt;
&lt;p id="S3.SS2.p5.1" class="ltx_p"&gt;Since the geometric-tail PGF has the same affine-ratio form, the same linear shift $u=ws\text{,}$ and coefficient matching at $w=1\text{,}$ Lemma &lt;a href="#S2.Thmtheorem7" title="Lemma 2.7 (Affine-ratio recursion). ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.7&lt;/span&gt;&lt;/a&gt; applies verbatim. Hence the DRP holds for geometric-tail mechanisms, with $\alpha_{N}(1)=\alpha_{D}(1)=aq$ replacing $q\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S3.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-characterization-theorem"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.3 &lt;/span&gt;The Characterization Theorem&lt;/h3&gt;
&lt;div id="S3.SS3.p1" class="ltx_para"&gt;
&lt;p id="S3.SS3.p1.1" class="ltx_p"&gt;We now prove the converse: geometric-tail catastrophe is the &lt;em id="S3.SS3.p1.1.1" class="ltx_emph ltx_font_italic"&gt;only&lt;/em&gt; age-based mechanism producing affine PGF structure. The result takes the form of a four-way equivalence linking the survival function, the PGF structure, the derivative reduction property, and the success probability formula.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.Thmtheorem6" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmtheorem6.2" class="ltx_text ltx_font_bold"&gt;Theorem 3.6&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmtheorem6.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Characterization)&lt;span id="S3.Thmtheorem6.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmtheorem6.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmtheorem6.p1.1" class="ltx_p"&gt;&lt;span id="S3.Thmtheorem6.p1.1.1" class="ltx_text ltx_font_italic"&gt;Among age-based catastrophe mechanisms (Definition &lt;a href="#S3.Thmtheorem1" title="Definition 3.1 (Age-based catastrophe mechanism). ‣ 3.1 General Hazard Framework ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt;), the following are equivalent:&lt;/span&gt;&lt;/p&gt;
&lt;ol id="S3.I1" class="ltx_enumerate"&gt;
&lt;li id="S3.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;(A)&lt;/span&gt;
&lt;div id="S3.I1.i1.p1" class="ltx_para"&gt;
&lt;p id="S3.I1.i1.p1.1" class="ltx_p"&gt;&lt;em id="S3.I1.i1.p1.1.1" class="ltx_emph"&gt;Geometric-tail catastrophe&lt;/em&gt;&lt;span id="S3.I1.i1.p1.1.2" class="ltx_text ltx_font_italic"&gt;: &lt;/span&gt;$S(t)=a\,s^{t-1}$&lt;span id="S3.I1.i1.p1.1.3" class="ltx_text ltx_font_italic"&gt; for &lt;/span&gt;$t\geq 1$&lt;span id="S3.I1.i1.p1.1.4" class="ltx_text ltx_font_italic"&gt; (Definition &lt;/span&gt;&lt;a href="#S3.Thmtheorem4" title="Definition 3.4 (Geometric-tail catastrophe). ‣ 3.2 Geometric-Tail Catastrophe ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref ltx_font_italic"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.4&lt;/span&gt;&lt;/a&gt;&lt;span id="S3.I1.i1.p1.1.5" class="ltx_text ltx_font_italic"&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S3.I1.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;(B)&lt;/span&gt;
&lt;div id="S3.I1.i2.p1" class="ltx_para"&gt;
&lt;p id="S3.I1.i2.p1.1" class="ltx_p"&gt;&lt;em id="S3.I1.i2.p1.1.1" class="ltx_emph"&gt;Uniform affine PGF structure&lt;/em&gt;&lt;span id="S3.I1.i2.p1.1.2" class="ltx_text ltx_font_italic"&gt;: Definition &lt;/span&gt;&lt;a href="#S2.Thmtheorem4" title="Definition 2.4 (Uniform affine PGF structure). ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref ltx_font_italic"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.4&lt;/span&gt;&lt;/a&gt;&lt;span id="S3.I1.i2.p1.1.3" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S3.I1.i3" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;(C)&lt;/span&gt;
&lt;div id="S3.I1.i3.p1" class="ltx_para"&gt;
&lt;p id="S3.I1.i3.p1.1" class="ltx_p"&gt;&lt;em id="S3.I1.i3.p1.1.1" class="ltx_emph"&gt;Derivative reduction&lt;/em&gt;&lt;span id="S3.I1.i3.p1.1.2" class="ltx_text ltx_font_italic"&gt;: there exists &lt;/span&gt;$z_{0}\in(0,1)$&lt;span id="S3.I1.i3.p1.1.3" class="ltx_text ltx_font_italic"&gt; such that for every &lt;/span&gt;$k\geq 1$&lt;span id="S3.I1.i3.p1.1.4" class="ltx_text ltx_font_italic"&gt; and every finitely-supported &lt;/span&gt;$T_{0}$&lt;span id="S3.I1.i3.p1.1.5" class="ltx_text ltx_font_italic"&gt;, the &lt;/span&gt;$k$&lt;span id="S3.I1.i3.p1.1.6" class="ltx_text ltx_font_italic"&gt;-th factorial moment &lt;/span&gt;$\eta_{k}$&lt;span id="S3.I1.i3.p1.1.7" class="ltx_text ltx_font_italic"&gt; depends on &lt;/span&gt;$T_{0}$&lt;span id="S3.I1.i3.p1.1.8" class="ltx_text ltx_font_italic"&gt; only through &lt;/span&gt;$\{g^{(j)}(z_{0})\}_{j=0}^{k-1}$&lt;span id="S3.I1.i3.p1.1.9" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S3.I1.i4" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;(D)&lt;/span&gt;
&lt;div id="S3.I1.i4.p1" class="ltx_para"&gt;
&lt;p id="S3.I1.i4.p1.1" class="ltx_p"&gt;&lt;em id="S3.I1.i4.p1.1.1" class="ltx_emph"&gt;Proportional single-point sufficiency&lt;/em&gt;&lt;span id="S3.I1.i4.p1.1.2" class="ltx_text ltx_font_italic"&gt;: there exist &lt;/span&gt;$z_{0}\in(0,1)$&lt;span id="S3.I1.i4.p1.1.3" class="ltx_text ltx_font_italic"&gt; and &lt;/span&gt;$\lambda&amp;gt;0$&lt;span id="S3.I1.i4.p1.1.4" class="ltx_text ltx_font_italic"&gt; such that &lt;/span&gt;$p=\lambda\,g(z_{0})$&lt;span id="S3.I1.i4.p1.1.5" class="ltx_text ltx_font_italic"&gt; for all finitely-supported &lt;/span&gt;$T_{0}$&lt;span id="S3.I1.i4.p1.1.6" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p2" class="ltx_para"&gt;
&lt;p id="S3.SS3.p2.1" class="ltx_p"&gt;We prove the cycle (A)$\Rightarrow$(B)$\Rightarrow$(C)$\Rightarrow$(A), and independently prove (A)$\Leftrightarrow$(D). The implications (A)$\Rightarrow$(B) and (A)$\Rightarrow$(D) have been established; the substance lies in (C)$\Rightarrow$(A), which uses only the $k=1$ instance of (C) and proceeds by a Möbius rigidity argument.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of &lt;span id="S3.SS3.2.1" class="ltx_text ltx_font_upright"&gt;(A)$\Rightarrow$(B)&lt;/span&gt;.&lt;/h6&gt;
&lt;div id="S3.SS3.p3" class="ltx_para"&gt;
&lt;p id="S3.SS3.p3.1" class="ltx_p"&gt;&lt;span id="S3.SS3.p3.1.1" class="ltx_text"&gt;This is Proposition &lt;a href="#S3.Thmtheorem5" title="Proposition 3.5 (Geometric-tail PGF formula). ‣ 3.2 Geometric-Tail Catastrophe ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.5&lt;/span&gt;&lt;/a&gt;.
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.3" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of &lt;span id="S3.SS3.3.1" class="ltx_text ltx_font_upright"&gt;(B)$\Rightarrow$(C)&lt;/span&gt;.&lt;/h6&gt;
&lt;div id="S3.SS3.p4" class="ltx_para"&gt;
&lt;p id="S3.SS3.p4.1" class="ltx_p"&gt;&lt;span id="S3.SS3.p4.1.1" class="ltx_text"&gt;Suppose&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex18" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$G_{T}(w)=\frac{a(w)g(u(w))+b(w)}{c(w)g(u(w))+d(w)},\qquad u(1)=u_{1}\in(0,1),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS3.p4.2" class="ltx_p"&gt;&lt;span id="S3.SS3.p4.2.1" class="ltx_text"&gt;with $u$ linear. From $G_{T}(1)=1$ for all finitely-supported $T_{0}\text{,}$ taking $T_{0}\equiv n$ and letting $n\to\infty$ gives $b(1)=d(1)\text{,}$ and then back-substitution gives $a(1)=c(1)\text{.}$ Since non-degeneracy yields $c(1)g(u_{1})+d(1)\neq 0\text{,}$ Lemma &lt;a href="#S2.Thmtheorem7" title="Lemma 2.7 (Affine-ratio recursion). ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.7&lt;/span&gt;&lt;/a&gt; applies with $R=G_{T}\text{,}$ $h=g\text{,}$ $z_{*}=1\text{,}$ and $u_{0}=u_{1}\text{.}$ Therefore the $k$-th factorial moment $\eta_{k}=G_{T}^{(k)}(1)$ depends only on $\{g^{(j)}(u_{1})\}_{j=0}^{k-1}\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.4" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of &lt;span id="S3.SS3.4.1" class="ltx_text ltx_font_upright"&gt;(C)$\Rightarrow$(A)&lt;/span&gt;.&lt;/h6&gt;
&lt;div id="S3.SS3.p5" class="ltx_para"&gt;
&lt;p id="S3.SS3.p5.1" class="ltx_p"&gt;&lt;span id="S3.SS3.p5.1.1" class="ltx_text"&gt;We use only the $k=1$ case: $E[T]$ depends on $T_{0}$ only through $g(z_{0})$ for some $z_{0}\in(0,1)\text{.}$ By Proposition &lt;a href="#S3.Thmtheorem3" title="Proposition 3.3 (General expected completion time). ‣ 3.1 General Hazard Framework ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt;, there exists $\psi:(0,1)\to\mathbb{R}$ such that&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.E23" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{\sum_{j\geq 1}F(j)\,\pi_{j}}{\sum_{j\geq 1}S(j)\,\pi_{j}}=\psi\!\left(\sum_{j\geq 1}z_{0}^{j}\,\pi_{j}\right)\quad\text{for all finitely-supported }(\pi_{j}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(23)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p6" class="ltx_para"&gt;
&lt;p id="S3.SS3.p6.1" class="ltx_p"&gt;&lt;em id="S3.SS3.p6.1.1" class="ltx_emph ltx_font_italic"&gt;Step 1: Point masses.&lt;/em&gt;&lt;span id="S3.SS3.p6.1.2" class="ltx_text"&gt; 
Taking $\pi=\delta_{j}$ gives $\psi(z_{0}^{j})=F(j)/S(j)=:f_{j}$ for each $j\geq 1\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p7" class="ltx_para"&gt;
&lt;p id="S3.SS3.p7.1" class="ltx_p"&gt;&lt;em id="S3.SS3.p7.1.1" class="ltx_emph ltx_font_italic"&gt;Step 2: Two-point distributions force $\psi$ to be Möbius.&lt;/em&gt;&lt;span id="S3.SS3.p7.1.2" class="ltx_text"&gt; 
For $\pi_{a}=\alpha\text{,}$ $\pi_{b}=1-\alpha$ with $a&amp;lt;b\text{,}$ set $v=\alpha z_{0}^{a}+(1-\alpha)z_{0}^{b}\text{.}$ Substituting into (&lt;a href="#S3.E23" title="In Proof of (C)⇒(A). ‣ 3.3 The Characterization Theorem ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;23&lt;/span&gt;&lt;/a&gt;) and solving for $\alpha$ in terms of $v$ gives&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.E24" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\psi(v)=\frac{(F(a)-F(b))\,v+F(b)z_{0}^{a}-F(a)z_{0}^{b}}{(S(a)-S(b))\,v+S(b)z_{0}^{a}-S(a)z_{0}^{b}}=:M_{ab}(v)$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(24)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS3.p7.2" class="ltx_p"&gt;&lt;span id="S3.SS3.p7.2.1" class="ltx_text"&gt;on $[z_{0}^{b},z_{0}^{a}]\text{.}$ This is a Möbius transformation of $v\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p8" class="ltx_para"&gt;
&lt;p id="S3.SS3.p8.1" class="ltx_p"&gt;&lt;em id="S3.SS3.p8.1.1" class="ltx_emph ltx_font_italic"&gt;Step 3: Global consistency.&lt;/em&gt;&lt;span id="S3.SS3.p8.1.2" class="ltx_text"&gt; 
For $a&amp;lt;c&amp;lt;b\text{,}$ the Möbius transformations $M_{ab}$ and $M_{ac}$ agree on the interval $[z_{0}^{c},z_{0}^{a}]\text{,}$ which contains infinitely many points; since a non-degenerate Möbius transformation is determined by three values, $M_{ab}=M_{ac}$ as rational functions. For any two pairs $(a_{1},b_{1})\text{,}$ $(a_{2},b_{2})$ with $a_{i}&amp;lt;b_{i}\text{,}$ setting $a^{*}=\min(a_{1},a_{2})\text{,}$ $b^{*}=\max(b_{1},b_{2})$ gives $[z_{0}^{b_{i}},z_{0}^{a_{i}}]\subset[z_{0}^{b^{*}},z_{0}^{a^{*}}]$ for each $i$ (since $z_{0}\in(0,1)$ makes $j\mapsto z_{0}^{j}$ decreasing), so $M_{a_{1}b_{1}}=M_{a^{*}b^{*}}=M_{a_{2}b_{2}}\text{.}$ Hence all $M_{ab}$ coincide with a single&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.E25" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\psi(v)=M(v)=\frac{Av+B}{Cv+D}\qquad\text{on }(0,z_{0}].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(25)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS3.p8.2" class="ltx_p"&gt;&lt;span id="S3.SS3.p8.2.1" class="ltx_text"&gt;The denominator slope of each $M_{ab}$ is proportional to $S(a)-S(b)\neq 0$ (since $h_{t}\in(0,1)$ makes $S$ strictly decreasing), so $C\neq 0\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p9" class="ltx_para"&gt;
&lt;p id="S3.SS3.p9.1" class="ltx_p"&gt;&lt;em id="S3.SS3.p9.1.1" class="ltx_emph ltx_font_italic"&gt;Step 4: Coefficient consistency forces $F=rS+c\text{.}$&lt;/em&gt;&lt;span id="S3.SS3.p9.1.2" class="ltx_text"&gt; 
Since $M_{ab}=M$ up to a common scalar, $A/C=(F(a)-F(b))/(S(a)-S(b))$ is constant across all $a\neq b\text{.}$ Denoting this constant by $r\text{,}$ we obtain $F(j)=rS(j)+c$ for all $j\geq 1\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p10" class="ltx_para"&gt;
&lt;p id="S3.SS3.p10.1" class="ltx_p"&gt;&lt;em id="S3.SS3.p10.1.1" class="ltx_emph ltx_font_italic"&gt;Step 5: Differencing yields constant hazard from step $2$ onward.&lt;/em&gt;&lt;span id="S3.SS3.p10.1.2" class="ltx_text"&gt; 
From $F(j)=\sum_{t=0}^{j-1}S(t)\text{:}$ $F(j+1)-F(j)=S(j)\text{.}$ From $F=rS+c\text{:}$ $F(j+1)-F(j)=r(S(j+1)-S(j))=-rS(j)h_{j+1}\text{.}$ Equating and dividing by $S(j)&amp;gt;0\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex19" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$h_{j+1}=-1/r\quad\text{for all }j\geq 1.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS3.p10.2" class="ltx_p"&gt;&lt;span id="S3.SS3.p10.2.1" class="ltx_text"&gt;Hence $h_{t}=q:=-1/r$ for all $t\geq 2\text{,}$ with $r&amp;lt;-1$ (since $q\in(0,1)$). Setting $a=S(1)\in(0,1)$ gives $S(t)=as^{t-1}$ for $t\geq 1\text{,}$ confirming geometric-tail catastrophe.
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.5" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of &lt;span id="S3.SS3.5.1" class="ltx_text ltx_font_upright"&gt;(A)$\Rightarrow$(D)&lt;/span&gt;.&lt;/h6&gt;
&lt;div id="S3.SS3.p11" class="ltx_para"&gt;
&lt;p id="S3.SS3.p11.1" class="ltx_p"&gt;&lt;span id="S3.SS3.p11.1.1" class="ltx_text"&gt;If $S(t)=as^{t-1}\text{,}$ then $p=\sum_{t\geq 1}as^{t-1}\pi_{t}=(a/s)\,g(s)\text{,}$ with $z_{0}=s$ and $\lambda=a/s&amp;gt;0\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.6" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of &lt;span id="S3.SS3.6.1" class="ltx_text ltx_font_upright"&gt;(D)$\Rightarrow$(A)&lt;/span&gt;.&lt;/h6&gt;
&lt;div id="S3.SS3.p12" class="ltx_para"&gt;
&lt;p id="S3.SS3.p12.1" class="ltx_p"&gt;&lt;span id="S3.SS3.p12.1.1" class="ltx_text"&gt;The hypothesis $p=\lambda\,g(z_{0})$ for all finitely-supported $(\pi_{j})$ gives, upon taking $\pi=\delta_{t}\text{:}$ $S(t)=\lambda\,z_{0}^{t}$ for each $t\geq 1\text{.}$ Hence $h_{t}=1-S(t)/S(t-1)=1-z_{0}$ for all $t\geq 2\text{,}$ confirming geometric tail with $s=z_{0}\text{,}$ $q=1-z_{0}\text{,}$ and $a=\lambda z_{0}\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.Thmtheorem7" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmtheorem7.2" class="ltx_text ltx_font_italic"&gt;Remark 3.7&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmtheorem7.3" class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;(Emphasis of the (C)$\Rightarrow$(A) argument)&lt;span id="S3.Thmtheorem7.4" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmtheorem7.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmtheorem7.p1.1" class="ltx_p"&gt;Only the $k=1$ instance of (C) is needed: the condition that $E[T]$ depends on $T_{0}$ through $g(z_{0})$ alone already forces geometric-tail catastrophe. The mechanism is Möbius rigidity: the ratio of two linear functionals of $(\pi_{j})$ equaling a function of a third forces that function to be linear fractional, and determination by three points propagates the local constraint globally. This is the same low-dimensionality phenomenon that drives the DRP—there, affine dependence on $g(u)$ forces the highest derivative to cancel; here, it forces the hazard sequence to stabilize.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S3.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="from-geometric-tail-to-full-memorylessness"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.4 &lt;/span&gt;From Geometric Tail to Full Memorylessness&lt;/h3&gt;
&lt;div id="S3.SS4.p1" class="ltx_para"&gt;
&lt;p id="S3.SS4.p1.1" class="ltx_p"&gt;The geometric-tail class has one free parameter ($a=S(1)$) beyond the catastrophe rate $q\text{.}$ The following corollary identifies the algebraic condition that pins down this parameter.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.Thmtheorem8" class="ltx_theorem ltx_theorem_corollary"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmtheorem8.2" class="ltx_text ltx_font_bold"&gt;Corollary 3.8&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmtheorem8.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Full memorylessness)&lt;span id="S3.Thmtheorem8.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmtheorem8.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmtheorem8.p1.1" class="ltx_p"&gt;&lt;span id="S3.Thmtheorem8.p1.1.1" class="ltx_text ltx_font_italic"&gt;Among geometric-tail mechanisms, full memorylessness ($h_{t}\equiv q$ for all $t\geq 1$) is equivalent to $\lambda=1$ in condition (D) of Theorem &lt;a href="#S3.Thmtheorem6" title="Theorem 3.6 (Characterization). ‣ 3.3 The Characterization Theorem ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.6&lt;/span&gt;&lt;/a&gt;, i.e., the success probability is a literal PGF evaluation:&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex20" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$p=g(s).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS4.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S3.SS4.p2" class="ltx_para"&gt;
&lt;p id="S3.SS4.p2.1" class="ltx_p"&gt;&lt;span id="S3.SS4.p2.1.1" class="ltx_text"&gt;Geometric tail gives $p=(a/s)\,g(s)\text{,}$ so $\lambda=a/s\text{.}$ If $\lambda=1$ then $a=s\text{,}$ hence $h_{1}=1-a=1-s=q\text{,}$ giving full memorylessness. Conversely, memorylessness gives $a=s$ and $\lambda=1\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.Thmtheorem9" class="ltx_theorem ltx_theorem_example"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmtheorem9.2" class="ltx_text ltx_font_bold"&gt;Example 3.9&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmtheorem9.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Geometric-tail but not memoryless)&lt;span id="S3.Thmtheorem9.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmtheorem9.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmtheorem9.p1.1" class="ltx_p"&gt;Set $h_{1}=1/2$ and $h_{t}=1/4$ for $t\geq 2\text{,}$ so $a=1/2\text{,}$ $q=1/4\text{,}$ $s=3/4\text{.}$ Then $S(t)=(1/2)(3/4)^{t-1}$ and $p=(2/3)\,g(3/4)\text{.}$ Since $h_{1}=1/2\neq 1/4=q\text{,}$ this is not memoryless, yet it has uniform affine PGF structure by Proposition &lt;a href="#S3.Thmtheorem5" title="Proposition 3.5 (Geometric-tail PGF formula). ‣ 3.2 Geometric-Tail Catastrophe ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.5&lt;/span&gt;&lt;/a&gt;, with $\alpha_{N}(1)=\alpha_{D}(1)=aq=1/8\text{.}$ This confirms that affine PGF structure characterizes the geometric-tail class, not full memorylessness.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.Thmtheorem10" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmtheorem10.2" class="ltx_text ltx_font_italic"&gt;Remark 3.10&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmtheorem10.3" class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;(Proportionality is essential)&lt;span id="S3.Thmtheorem10.4" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmtheorem10.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmtheorem10.p1.1" class="ltx_p"&gt;Condition (D) requires $p=\lambda\,g(z_{0})$—proportionality, not merely functional dependence. If one weakens (D) to “$p=\varphi(g(z_{0}))$ for some function $\varphi\text{,}$” then two-point distributions force $\varphi$ to be affine: $\varphi(x)=\lambda x+\mu\text{.}$ When $\mu&amp;gt;0\text{,}$ the resulting survival function $S(j)=\lambda z_{0}^{j}+\mu$ has $h_{j}\to 0$ as $j\to\infty\text{,}$ violating both (B) and (C). Thus proportionality ($\mu=0$) is necessary for the equivalence.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S4" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="exponential-approximation"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;4 &lt;/span&gt;Exponential Approximation&lt;/h2&gt;
&lt;div id="S4.p1" class="ltx_para"&gt;
&lt;p id="S4.p1.1" class="ltx_p"&gt;The attempt decomposition (Theorem &lt;a href="#S2.Thmtheorem2" title="Theorem 2.2 (PGF formula). ‣ 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt;) writes $T=\sum_{i=1}^{N}A_{i}+B$ as a geometric sum plus a perturbation. A classical theorem of &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib36" title="" class="ltx_ref"&gt;36&lt;/a&gt;]&lt;/cite&gt; establishes that normalized geometric sums converge to the exponential distribution; see &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib21" title="" class="ltx_ref"&gt;21&lt;/a&gt;, &lt;a href="#bib.bib25" title="" class="ltx_ref"&gt;25&lt;/a&gt;]&lt;/cite&gt; for comprehensive treatments. §&lt;a href="#S2" title="2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; revealed a specific algebraic structure—the coefficient equality $\alpha_{N}(1)=\alpha_{D}(1)$—governing the PGF of $T\text{.}$ We now show that this structure sharpens Rényi’s result into:&lt;/p&gt;
&lt;ol id="S4.I1" class="ltx_enumerate"&gt;
&lt;li id="S4.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;(i)&lt;/span&gt;
&lt;div id="S4.I1.i1.p1" class="ltx_para"&gt;
&lt;p id="S4.I1.i1.p1.1" class="ltx_p"&gt;a quantitative Laplace expansion whose leading error is second-order (the first-order term vanishes as an algebraic identity, not an asymptotic cancellation), and&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S4.I1.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;(ii)&lt;/span&gt;
&lt;div id="S4.I1.i2.p1" class="ltx_para"&gt;
&lt;p id="S4.I1.i2.p1.1" class="ltx_p"&gt;a sharp two-sided Kolmogorov bound $d_{K}(T/E[T],\operatorname{Exp}(1))\asymp p+|\alpha|$ that closes a logarithmic gap left by the smoothing inequality approach.&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p id="S4.p1.2" class="ltx_p"&gt;Both results hold for arbitrary base processes $T_{0}$ and are driven by the same coefficient equality.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S4.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-perturbation-parameter"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;4.1 &lt;/span&gt;The Perturbation Parameter&lt;/h3&gt;
&lt;div id="S4.SS1.p1" class="ltx_para"&gt;
&lt;p id="S4.SS1.p1.1" class="ltx_p"&gt;Recall the notation: $\mu=E[T]=(1-p)/(qp)\text{,}$ $b=E[B]\text{,}$ and write $W=T/\mu$ for the normalized completion time. From the decomposition (&lt;a href="#S2.E6" title="In 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;), $W=U/\mu+B/\mu$ where $U=\sum_{i=1}^{N}A_{i}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem1" class="ltx_theorem ltx_theorem_definition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmtheorem1.2" class="ltx_text ltx_font_bold"&gt;Definition 4.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmtheorem1.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Perturbation parameters)&lt;span id="S4.Thmtheorem1.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmtheorem1.p1.1" class="ltx_p"&gt;Define&lt;/p&gt;
&lt;table id="S4.E26" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\alpha=\frac{s(p-qD_{1})}{1-p},\qquad\beta=\frac{1-qp-qsD_{1}}{1-p},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(26)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.Thmtheorem1.p1.2" class="ltx_p"&gt;where $D_{1}=g^{\prime}(s)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem2" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmtheorem2.2" class="ltx_text ltx_font_bold"&gt;Proposition 4.2&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmtheorem2.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Properties of the perturbation parameters)&lt;span id="S4.Thmtheorem2.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmtheorem2.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmtheorem2.p1.1" class="ltx_p"&gt;&lt;span id="S4.Thmtheorem2.p1.1.1" class="ltx_text"&gt;&lt;/span&gt;&lt;span id="S4.Thmtheorem2.p1.1.2" class="ltx_text"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ol id="S4.I2" class="ltx_enumerate"&gt;
&lt;li id="S4.I2.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;(a)&lt;/span&gt;
&lt;div id="S4.I2.i1.p1" class="ltx_para"&gt;
&lt;p id="S4.I2.i1.p1.1" class="ltx_p"&gt;&lt;em id="S4.I2.i1.p1.1.1" class="ltx_emph"&gt;Fundamental identity&lt;/em&gt;&lt;span id="S4.I2.i1.p1.1.2" class="ltx_text ltx_font_italic"&gt;: &lt;/span&gt;$1+\alpha-\beta=0$&lt;span id="S4.I2.i1.p1.1.3" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S4.I2.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;(b)&lt;/span&gt;
&lt;div id="S4.I2.i2.p1" class="ltx_para"&gt;
&lt;p id="S4.I2.i2.p1.1" class="ltx_p"&gt;&lt;em id="S4.I2.i2.p1.1.1" class="ltx_emph"&gt;Successful-attempt identity&lt;/em&gt;&lt;span id="S4.I2.i2.p1.1.2" class="ltx_text ltx_font_italic"&gt;: &lt;/span&gt;$b/\mu=sp/(1-p)-\alpha=qsD_{1}/(1-p)$&lt;span id="S4.I2.i2.p1.1.3" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S4.I2.i3" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;(c)&lt;/span&gt;
&lt;div id="S4.I2.i3.p1" class="ltx_para"&gt;
&lt;p id="S4.I2.i3.p1.1" class="ltx_p"&gt;&lt;em id="S4.I2.i3.p1.1.1" class="ltx_emph"&gt;Vanishing rate&lt;/em&gt;&lt;span id="S4.I2.i3.p1.1.2" class="ltx_text ltx_font_italic"&gt;: for fixed &lt;/span&gt;$q\in(0,1)$&lt;span id="S4.I2.i3.p1.1.3" class="ltx_text ltx_font_italic"&gt;, &lt;/span&gt;$|\alpha|=O_{q}(p|\ln p|)$&lt;span id="S4.I2.i3.p1.1.4" class="ltx_text ltx_font_italic"&gt; as &lt;/span&gt;$p\to 0$&lt;span id="S4.I2.i3.p1.1.5" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS1.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS1.p2" class="ltx_para"&gt;
&lt;p id="S4.SS1.p2.1" class="ltx_p"&gt;&lt;span id="S4.SS1.p2.1.1" class="ltx_text"&gt;(a) $1+\alpha-\beta=1+[sp-qsD_{1}-1+qp+qsD_{1}]/(1-p)=1+(p-1)/(1-p)=0\text{,}$ noting that $s+q=1\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS1.p3" class="ltx_para"&gt;
&lt;p id="S4.SS1.p3.1" class="ltx_p"&gt;&lt;span id="S4.SS1.p3.1.1" class="ltx_text"&gt;(b) Differentiating $G_{B}(w)=g(ws)/p$ at $w=1$ gives $b=sD_{1}/p\text{,}$ so $b/\mu=qsD_{1}/(1-p)\text{.}$ The first equality follows from the definition of $\alpha\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS1.p4" class="ltx_para"&gt;
&lt;p id="S4.SS1.p4.1" class="ltx_p"&gt;&lt;span id="S4.SS1.p4.1.1" class="ltx_text"&gt;(c) Set $Y=s^{T_{0}}\in(0,1]\text{,}$ so $p=E[Y]$ and $qsD_{1}=qE[-Y\ln Y]/|\ln s|\text{.}$ Since $\varphi(x)=-x\ln x$ is concave, Jensen gives $E[-Y\ln Y]\leq-p\ln p\text{,}$ whence $qsD_{1}=O_{q}(p|\ln p|)\text{.}$ Both terms in $\alpha=(sp-qsD_{1})/(1-p)$ are therefore $O_{q}(p|\ln p|)\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS1.p5" class="ltx_para"&gt;
&lt;p id="S4.SS1.p5.1" class="ltx_p"&gt;Identity (a) is the Laplace-domain restatement of the coefficient equality (&lt;a href="#S2.E10" title="In Proposition 2.5 (Affine structure and coefficient equality). ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;10&lt;/span&gt;&lt;/a&gt;): both arise from $s+q=1\text{.}$ Its consequence is that the first-order error in the exponential approximation vanishes exactly (Theorem &lt;a href="#S4.Thmtheorem4" title="Theorem 4.4 (Laplace expansion). ‣ 4.2 The Laplace Expansion ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.4&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem3" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmtheorem3.2" class="ltx_text ltx_font_italic"&gt;Remark 4.3&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmtheorem3.3" class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;(Interpretation of $\alpha$)&lt;span id="S4.Thmtheorem3.4" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmtheorem3.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmtheorem3.p1.1" class="ltx_p"&gt;Identity (b) shows that $\alpha$ measures the deviation of the successful attempt from a “geometric target”: $\alpha=sp/(1-p)-b/\mu\text{.}$ If $\alpha=0\text{,}$ the rescaled successful attempt $B/\mu$ has exactly the expected length one would predict from a pure geometric model; if $\alpha\neq 0\text{,}$ $B$ is longer (when $\alpha&amp;lt;0$) or shorter (when $\alpha&amp;gt;0$) than this target. As we shall see, the Kolmogorov distance decomposes into two independent error sources: a lattice error $\Theta(p)$ from the integrality of the attempt count, and a perturbation error $\Theta(|\alpha|)$ from this mismatch.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S4.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-laplace-expansion"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;4.2 &lt;/span&gt;The Laplace Expansion&lt;/h3&gt;
&lt;div id="S4.Thmtheorem4" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmtheorem4.2" class="ltx_text ltx_font_bold"&gt;Theorem 4.4&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmtheorem4.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Laplace expansion)&lt;span id="S4.Thmtheorem4.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmtheorem4.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmtheorem4.p1.1" class="ltx_p"&gt;&lt;span id="S4.Thmtheorem4.p1.1.1" class="ltx_text ltx_font_italic"&gt;Fix $q\in(0,1)\text{.}$ There exist $p_{0}(q),\epsilon_{0}(q)&amp;gt;0$ such that for all $p\leq p_{0}$ and $\theta&amp;gt;0$ satisfying $\epsilon:=\theta pq/(1-p)\leq\epsilon_{0}\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.E27" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$E[e^{-\theta W}]-\frac{1}{1+\theta}=\frac{\alpha\,\theta^{2}}{(1+\theta)^{2}}+O\!\left(\frac{|\alpha|^{2}\,\theta^{3}}{(1+\theta)^{3}}\right)+O\!\left(\frac{p\,\theta^{2}}{1+\theta}\right),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(27)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.Thmtheorem4.p1.2" class="ltx_p"&gt;&lt;span id="S4.Thmtheorem4.p1.2.1" class="ltx_text ltx_font_italic"&gt;with implicit constants depending only on $q\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS2.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS2.p1" class="ltx_para"&gt;
&lt;p id="S4.SS2.p1.1" class="ltx_p"&gt;&lt;span id="S4.SS2.p1.1.1" class="ltx_text"&gt;Set $\epsilon=\theta/\mu=\theta pq/(1-p)$ and $w=e^{-\epsilon}\text{.}$ Then $E[e^{-\theta W}]=G_{T}(w)\text{.}$ We expand the numerator $N(w)$ and denominator $D(w)$ of (&lt;a href="#S2.E9" title="In Theorem 2.2 (PGF formula). ‣ 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;9&lt;/span&gt;&lt;/a&gt;) around $w=1\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS2.p2" class="ltx_para"&gt;
&lt;p id="S4.SS2.p2.1" class="ltx_p"&gt;&lt;span id="S4.SS2.p2.1.1" class="ltx_text"&gt;Using $w=1-\epsilon+O(\epsilon^{2})\text{,}$ $u=ws=s-s\epsilon+O(\epsilon^{2})\text{,}$ and $g(u)=p-sD_{1}\epsilon+O(\epsilon^{2})\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS2.p3" class="ltx_para"&gt;
&lt;p id="S4.SS2.p3.1" class="ltx_p"&gt;&lt;em id="S4.SS2.p3.1.1" class="ltx_emph ltx_font_italic"&gt;Numerator.&lt;/em&gt;&lt;span id="S4.SS2.p3.1.2" class="ltx_text"&gt;  $g(u)(1-u)=(p-sD_{1}\epsilon+O(\epsilon^{2}))(q+s\epsilon+O(\epsilon^{2}))=pq+(ps-qsD_{1})\epsilon+O(\epsilon^{2})\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS2.p4" class="ltx_para"&gt;
&lt;p id="S4.SS2.p4.1" class="ltx_p"&gt;&lt;em id="S4.SS2.p4.1.1" class="ltx_emph ltx_font_italic"&gt;Denominator.&lt;/em&gt;&lt;span id="S4.SS2.p4.1.2" class="ltx_text"&gt;  $1-w+qwg(u)=\epsilon+O(\epsilon^{2})+q(1-\epsilon+O(\epsilon^{2}))(p-sD_{1}\epsilon+O(\epsilon^{2}))=qp+(1-qp-qsD_{1})\epsilon+O(\epsilon^{2})\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS2.p5" class="ltx_para"&gt;
&lt;p id="S4.SS2.p5.1" class="ltx_p"&gt;&lt;span id="S4.SS2.p5.1.1" class="ltx_text"&gt;Dividing both by $pq$ and substituting $\epsilon=\theta pq/(1-p)\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.E28" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$G_{T}(w)=\frac{1+\alpha\theta+R_{N}(\theta)}{1+\beta\theta+R_{D}(\theta)},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(28)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.SS2.p5.2" class="ltx_p"&gt;&lt;span id="S4.SS2.p5.2.1" class="ltx_text"&gt;where $|R_{N}|,|R_{D}|=O(\theta^{2}p)$ (with implicit constants bounded for fixed $q\text{,}$ since $s^{k}D_{k}\leq\max_{t\geq 1}t^{k}s^{t}=(k/(e|\ln s|))^{k}$).&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS2.p6" class="ltx_para"&gt;
&lt;p id="S4.SS2.p6.1" class="ltx_p"&gt;&lt;span id="S4.SS2.p6.1.1" class="ltx_text"&gt;By Proposition &lt;a href="#S4.Thmtheorem2" title="Proposition 4.2 (Properties of the perturbation parameters). ‣ 4.1 The Perturbation Parameter ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt; (&lt;a href="#S4.I2.i1" title="item a ‣ Proposition 4.2 (Properties of the perturbation parameters). ‣ 4.1 The Perturbation Parameter ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;a&lt;/span&gt;&lt;/a&gt;), $\beta=1+\alpha\text{.}$ Computing:&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex21" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{1+\alpha\theta}{1+\beta\theta}-\frac{1}{1+\theta}=\frac{(1+\alpha-\beta)\theta+\alpha\theta^{2}}{(1+\beta\theta)(1+\theta)}=\frac{\alpha\theta^{2}}{(1+\beta\theta)(1+\theta)}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.SS2.p6.2" class="ltx_p"&gt;&lt;span id="S4.SS2.p6.2.1" class="ltx_text"&gt;Since $\beta=1+\alpha\text{:}$ $1/(1+\beta\theta)=1/((1+\theta)(1+\alpha\theta/(1+\theta)))\text{,}$ giving&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex22" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{\alpha\theta^{2}}{(1+\beta\theta)(1+\theta)}=\frac{\alpha\theta^{2}}{(1+\theta)^{2}}+O\!\left(\frac{|\alpha|^{2}\theta^{3}}{(1+\theta)^{3}}\right).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S4.SS2.p7" class="ltx_para"&gt;
&lt;p id="S4.SS2.p7.1" class="ltx_p"&gt;&lt;span id="S4.SS2.p7.1.1" class="ltx_text"&gt;It remains to bound the contribution of the remainders $R_{N},R_{D}$ to the ratio (&lt;a href="#S4.E28" title="In Proof. ‣ 4.2 The Laplace Expansion ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;28&lt;/span&gt;&lt;/a&gt;). Writing $G_{T}(w)-1/(1+\theta)$ and using $1+\alpha-\beta=0\text{,}$ the numerator becomes $\alpha\theta^{2}+(1+\theta)R_{N}-R_{D}\text{.}$ For the denominator: $1+\beta\theta+R_{D}=(1+\theta)(1+\alpha\theta/(1+\theta)+R_{D}/(1+\theta))\text{.}$ Taking $p_{0}$ small enough that $|\alpha|\leq 1/4$ and $\epsilon_{0}\leq q/4\text{,}$ the parenthetical factor is at least $1/2\text{,}$ so $|1+\beta\theta+R_{D}|\geq(1+\theta)/2\text{.}$ The numerator remainder satisfies $|(1+\theta)R_{N}-R_{D}|=O((1+\theta)\theta^{2}p)\text{,}$ giving a contribution $O(p\theta^{2}/(1+\theta))\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem5" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmtheorem5.2" class="ltx_text ltx_font_italic"&gt;Remark 4.5&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmtheorem5.3" class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;(Algebraic origin of the $\theta^{1}$ cancellation)&lt;span id="S4.Thmtheorem5.4" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmtheorem5.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmtheorem5.p1.1" class="ltx_p"&gt;The identity $1+\alpha-\beta=0$ is equivalent to $E[W]=1$ (matching first moments). Its algebraic root is $s+q=1\text{,}$ the same identity underlying the coefficient equality $\alpha_{N}(1)=\alpha_{D}(1)$ that drives the DRP. This is an exact algebraic identity, not an asymptotic cancellation—a structural guarantee that the exponential approximation begins at second order for any base process.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem6" class="ltx_theorem ltx_theorem_corollary"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmtheorem6.2" class="ltx_text ltx_font_bold"&gt;Corollary 4.6&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmtheorem6.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Exponential limit)&lt;span id="S4.Thmtheorem6.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmtheorem6.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmtheorem6.p1.1" class="ltx_p"&gt;&lt;span id="S4.Thmtheorem6.p1.1.1" class="ltx_text ltx_font_italic"&gt;Fix $q\in(0,1)\text{.}$ Under memoryless catastrophe with rate $q\text{,}$ $T/E[T]\xrightarrow{d}\operatorname{Exp}(1)$ as $p=g(s)\to 0\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS2.3" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS2.p8" class="ltx_para"&gt;
&lt;p id="S4.SS2.p8.1" class="ltx_p"&gt;&lt;span id="S4.SS2.p8.1.1" class="ltx_text"&gt;By Proposition &lt;a href="#S4.Thmtheorem2" title="Proposition 4.2 (Properties of the perturbation parameters). ‣ 4.1 The Perturbation Parameter ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt; (&lt;a href="#S4.I2.i3" title="item c ‣ Proposition 4.2 (Properties of the perturbation parameters). ‣ 4.1 The Perturbation Parameter ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;c&lt;/span&gt;&lt;/a&gt;), $|\alpha|\to 0\text{.}$ For each fixed $\theta&amp;gt;0\text{,}$ the condition $\epsilon=\theta pq/(1-p)\leq\epsilon_{0}$ is eventually satisfied, and both error terms in (&lt;a href="#S4.E27" title="In Theorem 4.4 (Laplace expansion). ‣ 4.2 The Laplace Expansion ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;27&lt;/span&gt;&lt;/a&gt;) vanish. Hence $E[e^{-\theta W}]\to 1/(1+\theta)$ pointwise. Pointwise convergence of Laplace transforms on $(0,\infty)$ implies convergence in distribution &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib21" title="" class="ltx_ref"&gt;21&lt;/a&gt;]&lt;/cite&gt;.
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem7" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmtheorem7.2" class="ltx_text ltx_font_italic"&gt;Remark 4.7&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmtheorem7.3" class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;(Variable $q$ regime)&lt;span id="S4.Thmtheorem7.4" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmtheorem7.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmtheorem7.p1.1" class="ltx_p"&gt;Corollary &lt;a href="#S4.Thmtheorem6" title="Corollary 4.6 (Exponential limit). ‣ 4.2 The Laplace Expansion ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.6&lt;/span&gt;&lt;/a&gt; assumes fixed $q\text{.}$ When $q\to 0$ simultaneously with $p\to 0$ (as in the CCP, where $q=m/(n+m)\to 0$), the implicit constants in (&lt;a href="#S4.E27" title="In Theorem 4.4 (Laplace expansion). ‣ 4.2 The Laplace Expansion ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;27&lt;/span&gt;&lt;/a&gt;) may deteriorate. The convergence $T/E[T]\xrightarrow{d}\operatorname{Exp}(1)$ in such regimes follows instead from the Bridge Theorem below (Theorem &lt;a href="#S4.Thmtheorem13" title="Theorem 4.13 (Bridge Theorem). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.13&lt;/span&gt;&lt;/a&gt;), which requires only $p\to 0$ and uniform control of certain moment ratios of $A\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S4.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-bridge-theorem"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;4.3 &lt;/span&gt;The Bridge Theorem&lt;/h3&gt;
&lt;div id="S4.SS3.p1" class="ltx_para"&gt;
&lt;p id="S4.SS3.p1.1" class="ltx_p"&gt;The Laplace expansion (Theorem &lt;a href="#S4.Thmtheorem4" title="Theorem 4.4 (Laplace expansion). ‣ 4.2 The Laplace Expansion ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.4&lt;/span&gt;&lt;/a&gt;) gives pointwise control on the Laplace transform error. Converting to Kolmogorov distance $d_{\mathrm{K}}$ via the smoothing inequality (&lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib25" title="" class="ltx_ref"&gt;25&lt;/a&gt;]&lt;/cite&gt;) yields&lt;/p&gt;
&lt;table id="S4.Ex23" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{\mathrm{K}}\lesssim\int_{0}^{R}\frac{|\alpha|\theta}{(1+\theta)^{2}}\,d\theta+\frac{1}{R},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.SS3.p1.2" class="ltx_p"&gt;which evaluates to $O(|\alpha|\ln(1/|\alpha|))$ upon optimizing $R\text{.}$ The logarithmic factor arises because the integrand decays only as $|\alpha|/\theta$ for large $\theta\text{,}$ accumulating a logarithmic contribution absent from the pointwise bound.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p2" class="ltx_para"&gt;
&lt;p id="S4.SS3.p2.1" class="ltx_p"&gt;We now develop a direct probabilistic approach that avoids this loss entirely. The key idea is to decompose the approximation into three steps, each handling one component of $W=U/\mu+B/\mu\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem8" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmtheorem8.2" class="ltx_text ltx_font_bold"&gt;Lemma 4.8&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmtheorem8.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Failed-attempt tail bound)&lt;span id="S4.Thmtheorem8.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmtheorem8.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmtheorem8.p1.1" class="ltx_p"&gt;&lt;span id="S4.Thmtheorem8.p1.1.1" class="ltx_text ltx_font_italic"&gt;Under memoryless catastrophe with rate $q\text{,}$ the failed-attempt length satisfies $P(A\geq t)\leq s^{t-1}$ for all $t\geq 1\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS3.p3" class="ltx_para"&gt;
&lt;p id="S4.SS3.p3.1" class="ltx_p"&gt;&lt;span id="S4.SS3.p3.1.1" class="ltx_text"&gt;A failure at step $j$ requires survival through steps $1,\ldots,j-1$ (probability $s^{j-1}$), catastrophe at step $j$ (probability $q$), and $T_{0}\geq j\text{.}$ Hence&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex24" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$P(A\geq t)=\frac{\sum_{j\geq t}q\,s^{j-1}P(T_{0}\geq j)}{1-p}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.SS3.p3.2" class="ltx_p"&gt;&lt;span id="S4.SS3.p3.2.1" class="ltx_text"&gt;Factoring $s^{t-1}$ and using $P(T_{0}\geq t+k)\leq P(T_{0}\geq k+1)\text{:}$ the numerator is at most $s^{t-1}\sum_{k\geq 0}q\,s^{k}P(T_{0}\geq k+1)=s^{t-1}(1-p)\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem9" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmtheorem9.2" class="ltx_text ltx_font_bold"&gt;Lemma 4.9&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmtheorem9.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Uniform moment-ratio control)&lt;span id="S4.Thmtheorem9.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmtheorem9.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmtheorem9.p1.1" class="ltx_p"&gt;&lt;span id="S4.Thmtheorem9.p1.1.1" class="ltx_text ltx_font_italic"&gt;Fix $q\in(0,1)\text{.}$ For any base process $T_{0}$ and any integer $k\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex25" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$E[A^{k}]\leq M_{k}(q):=\sum_{t\geq 1}k\,t^{k-1}\,s^{t-1}&amp;lt;\infty,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.Thmtheorem9.p1.2" class="ltx_p"&gt;&lt;span id="S4.Thmtheorem9.p1.2.1" class="ltx_text ltx_font_italic"&gt;and $E[A]\geq 1\text{.}$ Hence all moment ratios $E[A^{k}]/E[A]^{k}$ are bounded by constants depending only on $q\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.3" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS3.p4" class="ltx_para"&gt;
&lt;p id="S4.SS3.p4.1" class="ltx_p"&gt;&lt;span id="S4.SS3.p4.1.1" class="ltx_text"&gt;The tail-sum formula $E[A^{k}]=\sum_{t\geq 1}[t^{k}-(t-1)^{k}]P(A\geq t)\text{,}$ combined with the mean value theorem bound $t^{k}-(t-1)^{k}\leq kt^{k-1}$ and Lemma &lt;a href="#S4.Thmtheorem8" title="Lemma 4.8 (Failed-attempt tail bound). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.8&lt;/span&gt;&lt;/a&gt;, gives $E[A^{k}]\leq\sum_{t\geq 1}kt^{k-1}s^{t-1}&amp;lt;\infty\text{.}$ The bound $E[A]\geq 1$ is immediate since $A\geq 1\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem10" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmtheorem10.2" class="ltx_text ltx_font_bold"&gt;Lemma 4.10&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmtheorem10.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Scaling perturbation)&lt;span id="S4.Thmtheorem10.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmtheorem10.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmtheorem10.p1.1" class="ltx_p"&gt;&lt;span id="S4.Thmtheorem10.p1.1.1" class="ltx_text ltx_font_italic"&gt;For any non-negative random variable $X$ and $r\in(0,1)\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex26" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{\mathrm{K}}(rX,\operatorname{Exp}(1))\leq d_{\mathrm{K}}(X,\operatorname{Exp}(1))+(1-r).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.4" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS3.p5" class="ltx_para"&gt;
&lt;p id="S4.SS3.p5.1" class="ltx_p"&gt;&lt;span id="S4.SS3.p5.1.1" class="ltx_text"&gt;Set $\varepsilon=d_{\mathrm{K}}(X,\operatorname{Exp}(1))$ and $F_{E}(x)=1-e^{-x}\text{.}$ For all $x\geq 0\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex27" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$|P(rX\leq x)-F_{E}(x)|\leq\underbrace{|P(X\leq x/r)-F_{E}(x/r)|}_{\leq\,\varepsilon}+\underbrace{|F_{E}(x/r)-F_{E}(x)|}_{=\,e^{-x}-e^{-x/r}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.SS3.p5.2" class="ltx_p"&gt;&lt;span id="S4.SS3.p5.2.1" class="ltx_text"&gt;The second term is non-negative (since $r&amp;lt;1$) and maximized at $x^{*}=r\ln(1/r)/(1-r)\text{,}$ where it equals $(1-r)r^{r/(1-r)}\leq 1-r\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem11" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmtheorem11.2" class="ltx_text ltx_font_bold"&gt;Lemma 4.11&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmtheorem11.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Additive perturbation)&lt;span id="S4.Thmtheorem11.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmtheorem11.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmtheorem11.p1.1" class="ltx_p"&gt;&lt;span id="S4.Thmtheorem11.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $X\geq 0$ and $Y\geq 0$ be independent. Then&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex28" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{\mathrm{K}}(X+Y,\operatorname{Exp}(1))\leq d_{\mathrm{K}}(X,\operatorname{Exp}(1))+E[Y].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.5" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS3.p6" class="ltx_para"&gt;
&lt;p id="S4.SS3.p6.1" class="ltx_p"&gt;&lt;span id="S4.SS3.p6.1.1" class="ltx_text"&gt;Set $\varepsilon=d_{\mathrm{K}}(X,\operatorname{Exp}(1))$ and $F_{E}(x)=1-e^{-x}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p7" class="ltx_para"&gt;
&lt;p id="S4.SS3.p7.1" class="ltx_p"&gt;&lt;em id="S4.SS3.p7.1.1" class="ltx_emph ltx_font_italic"&gt;Upper bound.&lt;/em&gt;&lt;span id="S4.SS3.p7.1.2" class="ltx_text"&gt;  Since $Y\geq 0\text{,}$ $P(X+Y\leq x)\leq P(X\leq x)\leq F_{E}(x)+\varepsilon\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p8" class="ltx_para"&gt;
&lt;p id="S4.SS3.p8.1" class="ltx_p"&gt;&lt;em id="S4.SS3.p8.1.1" class="ltx_emph ltx_font_italic"&gt;Lower bound.&lt;/em&gt;&lt;span id="S4.SS3.p8.1.2" class="ltx_text"&gt;  We must show $F_{E}(x)-P(X+Y\leq x)\leq E[Y]+\varepsilon\text{.}$ Conditioning on $Y\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex29" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F_{E}(x)-P(X+Y\leq x)=E\bigl[\bigl(F_{E}(x)-F_{X}(x-Y)\bigr)\mathbf{1}_{\{Y\leq x\}}\bigr]+F_{E}(x)\,P(Y&amp;gt;x).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.SS3.p8.2" class="ltx_p"&gt;&lt;span id="S4.SS3.p8.2.1" class="ltx_text"&gt;For the first term, when $Y\leq x\text{,}$ $F_{E}(x)-F_{X}(x-Y)\leq\bigl[F_{E}(x)-F_{E}(x-Y)\bigr]+\varepsilon\leq Y+\varepsilon\text{,}$ using $|F_{E}^{\prime}|\leq 1\text{.}$ For the second term, $F_{E}(x)\,P(Y&amp;gt;x)\leq xP(Y&amp;gt;x)\leq E[Y\cdot\mathbf{1}_{\{Y&amp;gt;x\}}]\text{.}$ Combining them gives&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex30" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F_{E}(x)-P(X+Y\leq x)\leq E[Y]+\varepsilon.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p9" class="ltx_para"&gt;
&lt;p id="S4.SS3.p9.1" class="ltx_p"&gt;Rényi’s classical theorem (&lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib36" title="" class="ltx_ref"&gt;36&lt;/a&gt;]&lt;/cite&gt;) asserts that normalized geometric sums converge in distribution to $\operatorname{Exp}(1)\text{.}$ &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib6" title="" class="ltx_ref"&gt;6&lt;/a&gt;]&lt;/cite&gt; established the first explicit Kolmogorov-distance bound, showing that the rate is linear in the geometric parameter $p\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem12" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmtheorem12.2" class="ltx_text ltx_font_bold"&gt;Theorem 4.12&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmtheorem12.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Theorem 2.1 (ii), &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib6" title="" class="ltx_ref"&gt;6&lt;/a&gt;]&lt;/cite&gt;)&lt;span id="S4.Thmtheorem12.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmtheorem12.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmtheorem12.p1.1" class="ltx_p"&gt;&lt;span id="S4.Thmtheorem12.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $U=\sum_{i=1}^{N}X_{i}\text{,}$ $N\sim\operatorname{Geom}_{0}(p)\text{,}$ where $0&amp;lt;p&amp;lt;1\text{,}$ the $X_{i}$ are i.i.d. nonnegative random variables, $P(X_{1}=0)&amp;lt;1\text{,}$ and $E[X_{1}^{2}]&amp;lt;\infty\text{.}$ Set $\bar{p}:=1-p\text{,}$
$\rho_{2}:=\frac{E[X_{1}^{2}]}{E[X_{1}]^{2}}\text{.}$
Then&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.E29" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{K}\!\left(\frac{U}{E[U]},\,\operatorname{Exp}(1)\right)\leq p\max\!\left(\rho_{2},\frac{\rho_{2}}{2\bar{p}}\right).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(29)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p10" class="ltx_para"&gt;
&lt;p id="S4.SS3.p10.1" class="ltx_p"&gt;We can now state and prove the Bridge Theorem. The name reflects its role: it bridges the $O(p)$ exponential approximation of the pure geometric sum $U/\mu_{U}$ to the full completion time $W=T/\mu\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem13" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmtheorem13.2" class="ltx_text ltx_font_bold"&gt;Theorem 4.13&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmtheorem13.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Bridge Theorem)&lt;span id="S4.Thmtheorem13.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmtheorem13.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmtheorem13.p1.1" class="ltx_p"&gt;&lt;span id="S4.Thmtheorem13.p1.1.1" class="ltx_text ltx_font_italic"&gt;For $0&amp;lt;p\leq 1/2\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.E30" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{\mathrm{K}}(W,\operatorname{Exp}(1))\leq C_{1}\,p+2\,\frac{b}{\mu},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(30)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.Thmtheorem13.p1.2" class="ltx_p"&gt;&lt;span id="S4.Thmtheorem13.p1.2.1" class="ltx_text ltx_font_italic"&gt;where $C_{1}&amp;lt;\infty$ depends only on the distribution of $A$ (and is uniformly bounded over all base processes $T_{0}$ for fixed $q\text{,}$ by Lemma &lt;a href="#S4.Thmtheorem9" title="Lemma 4.9 (Uniform moment-ratio control). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.9&lt;/span&gt;&lt;/a&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.6" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS3.p11" class="ltx_para"&gt;
&lt;p id="S4.SS3.p11.1" class="ltx_p"&gt;&lt;span id="S4.SS3.p11.1.1" class="ltx_text"&gt;Set $\mu_{U}=E[U]=(1-p)E[A]/p$ and $r=\mu_{U}/\mu=1-b/\mu\in(0,1)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p12" class="ltx_para"&gt;
&lt;p id="S4.SS3.p12.1" class="ltx_p"&gt;&lt;em id="S4.SS3.p12.1.1" class="ltx_emph ltx_font_italic"&gt;Step 1: Geometric-convolution bound for $V=U/\mu_{U}\text{.}$&lt;/em&gt;&lt;span id="S4.SS3.p12.1.2" class="ltx_text"&gt; 
By Lemma &lt;a href="#S4.Thmtheorem9" title="Lemma 4.9 (Uniform moment-ratio control). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.9&lt;/span&gt;&lt;/a&gt;, $E[A^{k}]\leq M_{k}(q)&amp;lt;\infty$ for all $k\geq 1\text{,}$ so Brown’s moment condition $E[A^{2}]&amp;lt;\infty$ is satisfied and the moment ratios $\rho_{j}=E[A^{j}]/E[A]^{j}\leq M_{j}(q)/1=M_{j}(q)$ are uniformly bounded. Theorem &lt;a href="#S4.Thmtheorem12" title="Theorem 4.12 (Theorem 2.1 (ii), []). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.12&lt;/span&gt;&lt;/a&gt; applied with $X_{i}=A_{i}$ gives $d_{\mathrm{K}}(V,\operatorname{Exp}(1))\leq\rho_{2}(A)\,p\text{.}$ Since $\rho_{2}(A)=E[A^{2}]/E[A]^{2}\leq M_{2}(q)$ by Lemma &lt;a href="#S4.Thmtheorem9" title="Lemma 4.9 (Uniform moment-ratio control). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.9&lt;/span&gt;&lt;/a&gt;,
we may take $C_{1}=M_{2}(q)\text{,}$ and hence
$d_{\mathrm{K}}(V,\operatorname{Exp}(1))\leq C_{1}p\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p13" class="ltx_para"&gt;
&lt;p id="S4.SS3.p13.1" class="ltx_p"&gt;&lt;em id="S4.SS3.p13.1.1" class="ltx_emph ltx_font_italic"&gt;Step 2: Scaling perturbation.&lt;/em&gt;&lt;span id="S4.SS3.p13.1.2" class="ltx_text"&gt; 
Since $U/\mu=rV$ with $r=1-b/\mu\text{,}$ Lemma &lt;a href="#S4.Thmtheorem10" title="Lemma 4.10 (Scaling perturbation). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.10&lt;/span&gt;&lt;/a&gt; gives $d_{\mathrm{K}}(U/\mu,\operatorname{Exp}(1))\leq C_{1}p+b/\mu\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p14" class="ltx_para"&gt;
&lt;p id="S4.SS3.p14.1" class="ltx_p"&gt;&lt;em id="S4.SS3.p14.1.1" class="ltx_emph ltx_font_italic"&gt;Step 3: Additive perturbation.&lt;/em&gt;&lt;span id="S4.SS3.p14.1.2" class="ltx_text"&gt; 
Since $W=U/\mu+B/\mu$ and $U,B$ are independent (by mutual independence of $N\text{,}$ $(A_{i})\text{,}$ $B$ in (&lt;a href="#S2.E6" title="In 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;)), Lemma &lt;a href="#S4.Thmtheorem11" title="Lemma 4.11 (Additive perturbation). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.11&lt;/span&gt;&lt;/a&gt; gives $d_{\mathrm{K}}(W,\operatorname{Exp}(1))\leq C_{1}p+b/\mu+E[B/\mu]=C_{1}p+2b/\mu\text{.}$ ∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem14" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmtheorem14.2" class="ltx_text ltx_font_italic"&gt;Remark 4.14&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmtheorem14.3" class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;(Connection to the staircase)&lt;span id="S4.Thmtheorem14.4" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmtheorem14.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmtheorem14.p1.1" class="ltx_p"&gt;The explicit correction terms in the Bridge Theorem—$p=g(s)$ and $b/\mu=qsD_{1}/(1-p)$—involve only the $1$-jet $\{g(s),g^{\prime}(s)\}\text{,}$ matching the staircase level of $\operatorname{Var}(T)$ (&lt;a href="#S2.E17" title="In Example 2.9 (First two moments). ‣ 2.3 Moment Recursion and the Complexity Staircase ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;17&lt;/span&gt;&lt;/a&gt;). The Brown constant $C_{1}$ depends on the full distribution of $A$ (via moment ratios), so this staircase connection is more heuristic than exact.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S4.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-sharp-two-sided-bound"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;4.4 &lt;/span&gt;The Sharp Two-Sided Bound&lt;/h3&gt;
&lt;div id="S4.SS4.p1" class="ltx_para"&gt;
&lt;p id="S4.SS4.p1.1" class="ltx_p"&gt;We now combine the Laplace expansion (Theorem &lt;a href="#S4.Thmtheorem4" title="Theorem 4.4 (Laplace expansion). ‣ 4.2 The Laplace Expansion ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.4&lt;/span&gt;&lt;/a&gt;) and the Bridge Theorem (Theorem &lt;a href="#S4.Thmtheorem13" title="Theorem 4.13 (Bridge Theorem). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.13&lt;/span&gt;&lt;/a&gt;) to obtain a sharp two-sided bound showing that $p+|\alpha|$ is the correct rate.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem15" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmtheorem15.2" class="ltx_text ltx_font_bold"&gt;Theorem 4.15&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmtheorem15.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Two-sided bound)&lt;span id="S4.Thmtheorem15.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmtheorem15.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmtheorem15.p1.1" class="ltx_p"&gt;&lt;span id="S4.Thmtheorem15.p1.1.1" class="ltx_text ltx_font_italic"&gt;There exist constants $c_{A},C_{A},\delta_{A}&amp;gt;0$ depending only on $q$ such that, for $p+|\alpha|\leq\delta_{A}\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.E31" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$c_{A}\,(p+|\alpha|)\leq d_{\mathrm{K}}\!\left(\frac{T}{E[T]},\,\operatorname{Exp}(1)\right)\leq C_{A}\,(p+|\alpha|).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(31)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS4.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of the upper bound.&lt;/h6&gt;
&lt;div id="S4.SS4.p2" class="ltx_para"&gt;
&lt;p id="S4.SS4.p2.1" class="ltx_p"&gt;&lt;span id="S4.SS4.p2.1.1" class="ltx_text"&gt;From Theorem &lt;a href="#S4.Thmtheorem13" title="Theorem 4.13 (Bridge Theorem). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.13&lt;/span&gt;&lt;/a&gt; and Proposition &lt;a href="#S4.Thmtheorem2" title="Proposition 4.2 (Properties of the perturbation parameters). ‣ 4.1 The Perturbation Parameter ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt; (&lt;a href="#S4.I2.i2" title="item b ‣ Proposition 4.2 (Properties of the perturbation parameters). ‣ 4.1 The Perturbation Parameter ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;b&lt;/span&gt;&lt;/a&gt;): when $\alpha\leq 0\text{,}$ $b/\mu=|\alpha|+sp/(1-p)\text{;}$ when $\alpha&amp;gt;0\text{,}$ $b/\mu=sp/(1-p)-\alpha\leq sp/(1-p)\text{.}$ In both cases, $2b/\mu\leq 2|\alpha|+2sp/(1-p)\text{.}$ Hence&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex31" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{\mathrm{K}}\leq C_{1}p+2|\alpha|+\frac{2sp}{1-p}\leq C_{A}(p+|\alpha|).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS4.3" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of the lower bound.&lt;/h6&gt;
&lt;div id="S4.SS4.p3" class="ltx_para"&gt;
&lt;p id="S4.SS4.p3.1" class="ltx_p"&gt;&lt;span id="S4.SS4.p3.1.1" class="ltx_text"&gt;We exhibit two independent error sources, each yielding a lower bound.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS4.p4" class="ltx_para"&gt;
&lt;p id="S4.SS4.p4.1" class="ltx_p"&gt;&lt;em id="S4.SS4.p4.1.1" class="ltx_emph ltx_font_italic"&gt;Lower bound from discreteness.&lt;/em&gt;&lt;span id="S4.SS4.p4.1.2" class="ltx_text"&gt; 
Since $T\geq 1\text{,}$ $W=T/\mu\geq 1/\mu=pq/(1-p)\text{.}$ For $x=pq/(2(1-p))&amp;lt;1/\mu\text{:}$ $P(W\leq x)=0\text{,}$ while $F_{E}(x)=1-e^{-x}\geq x/2=pq/(4(1-p))$ (using $1-e^{-t}\geq t/2$ for $t\in[0,1]$). Hence&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.E32" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{\mathrm{K}}\geq\frac{pq}{4(1-p)}=\Omega(p).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(32)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S4.SS4.p5" class="ltx_para"&gt;
&lt;p id="S4.SS4.p5.1" class="ltx_p"&gt;&lt;em id="S4.SS4.p5.1.1" class="ltx_emph ltx_font_italic"&gt;Lower bound from the Laplace transform.&lt;/em&gt;&lt;span id="S4.SS4.p5.1.2" class="ltx_text"&gt; 
For any non-negative random variables $W,Z$ and any $\theta&amp;gt;0\text{,}$ the integral representation $E[e^{-\theta X}]=\int_{0}^{\infty}\theta e^{-\theta x}(1-F_{X}(x))\,dx$ gives&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.E33" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{\mathrm{K}}(W,Z)\geq|E[e^{-\theta W}]-E[e^{-\theta Z}]|.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(33)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.SS4.p5.2" class="ltx_p"&gt;&lt;span id="S4.SS4.p5.2.1" class="ltx_text"&gt;Applying (&lt;a href="#S4.E33" title="In Proof of the lower bound. ‣ 4.4 The Sharp Two-Sided Bound ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;33&lt;/span&gt;&lt;/a&gt;) with $Z\sim\operatorname{Exp}(1)$ and $\theta=1\text{:}$ for $p$ sufficiently small, Theorem &lt;a href="#S4.Thmtheorem4" title="Theorem 4.4 (Laplace expansion). ‣ 4.2 The Laplace Expansion ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.4&lt;/span&gt;&lt;/a&gt; gives $|E[e^{-W}]-1/2|=|\alpha|/4+O(|\alpha|^{2})+O(p)\text{,}$ so&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.E34" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{\mathrm{K}}\geq\frac{|\alpha|}{4}-O(|\alpha|^{2})-O(p)\geq c^{\prime}|\alpha|-c^{\prime\prime}p$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(34)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.SS4.p5.3" class="ltx_p"&gt;&lt;span id="S4.SS4.p5.3.1" class="ltx_text"&gt;for suitable $c^{\prime},c^{\prime\prime}&amp;gt;0\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS4.p6" class="ltx_para"&gt;
&lt;p id="S4.SS4.p6.1" class="ltx_p"&gt;&lt;em id="S4.SS4.p6.1.1" class="ltx_emph ltx_font_italic"&gt;Combining.&lt;/em&gt;&lt;span id="S4.SS4.p6.1.2" class="ltx_text"&gt; 
Set $K=2c^{\prime\prime}/c^{\prime}\text{.}$ Choose $\delta_{A}$ small enough that both (&lt;a href="#S4.E32" title="In Proof of the lower bound. ‣ 4.4 The Sharp Two-Sided Bound ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;32&lt;/span&gt;&lt;/a&gt;) and (&lt;a href="#S4.E34" title="In Proof of the lower bound. ‣ 4.4 The Sharp Two-Sided Bound ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;34&lt;/span&gt;&lt;/a&gt;) hold.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS4.p7" class="ltx_para"&gt;
&lt;p id="S4.SS4.p7.1" class="ltx_p"&gt;&lt;em id="S4.SS4.p7.1.1" class="ltx_emph ltx_font_italic"&gt;Case 1&lt;/em&gt;&lt;span id="S4.SS4.p7.1.2" class="ltx_text"&gt;: $|\alpha|\leq Kp\text{.}$ Then $p+|\alpha|\leq(1+K)p\text{.}$ From (&lt;a href="#S4.E32" title="In Proof of the lower bound. ‣ 4.4 The Sharp Two-Sided Bound ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;32&lt;/span&gt;&lt;/a&gt;), $d_{\mathrm{K}}\geq qp/4\geq q(p+|\alpha|)/(4(1+K))\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS4.p8" class="ltx_para"&gt;
&lt;p id="S4.SS4.p8.1" class="ltx_p"&gt;&lt;em id="S4.SS4.p8.1.1" class="ltx_emph ltx_font_italic"&gt;Case 2&lt;/em&gt;&lt;span id="S4.SS4.p8.1.2" class="ltx_text"&gt;: $|\alpha|&amp;gt;Kp\text{.}$ Then $p+|\alpha|\leq(1+1/K)|\alpha|\text{.}$ From (&lt;a href="#S4.E34" title="In Proof of the lower bound. ‣ 4.4 The Sharp Two-Sided Bound ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;34&lt;/span&gt;&lt;/a&gt;), $d_{\mathrm{K}}\geq c^{\prime}|\alpha|/2\geq c^{\prime}K(p+|\alpha|)/(2(K+1))\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS4.p9" class="ltx_para"&gt;
&lt;p id="S4.SS4.p9.1" class="ltx_p"&gt;&lt;span id="S4.SS4.p9.1.1" class="ltx_text"&gt;In both cases, $d_{\mathrm{K}}\geq c_{A}(p+|\alpha|)$ with $c_{A}=\min\{q/(4(1+K)),\;c^{\prime}K/(2(K+1))\}&amp;gt;0\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS4.p10" class="ltx_para"&gt;
&lt;p id="S4.SS4.p10.1" class="ltx_p"&gt;The following counterexample shows that the $p$-term in the template $p+|\alpha|$ cannot be dropped.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem16" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmtheorem16.2" class="ltx_text ltx_font_bold"&gt;Proposition 4.16&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmtheorem16.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Counterexample: $p$ cannot be dropped)&lt;span id="S4.Thmtheorem16.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmtheorem16.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmtheorem16.p1.1" class="ltx_p"&gt;&lt;span id="S4.Thmtheorem16.p1.1.1" class="ltx_text ltx_font_italic"&gt;There exists a family of base processes $(T_{0}^{(\varepsilon)})_{\varepsilon\to 0}$ with $q=1/2$ such that $|\alpha_{\varepsilon}|=o(p_{\varepsilon})$ but $d_{\mathrm{K}}(W_{\varepsilon},\operatorname{Exp}(1))=\Theta(p_{\varepsilon})\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS4.4" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS4.p11" class="ltx_para"&gt;
&lt;p id="S4.SS4.p11.1" class="ltx_p"&gt;&lt;span id="S4.SS4.p11.1.1" class="ltx_text"&gt;Set $q=s=1/2$ and $P(T_{0}^{(\varepsilon)}=t)=\varepsilon\,\mathbf{1}_{t=1}+(1-\varepsilon)\,\mathbf{1}_{t=M_{\varepsilon}}$ where $M_{\varepsilon}=\lceil 3\log_{2}(1/\varepsilon)\rceil\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS4.p12" class="ltx_para"&gt;
&lt;p id="S4.SS4.p12.1" class="ltx_p"&gt;&lt;em id="S4.SS4.p12.1.1" class="ltx_emph ltx_font_italic"&gt;Claim 1&lt;/em&gt;&lt;span id="S4.SS4.p12.1.2" class="ltx_text"&gt;: $|\alpha_{\varepsilon}|=o(p_{\varepsilon})\text{.}$ Since $2^{-M_{\varepsilon}}\leq\varepsilon^{3}\text{:}$ $p_{\varepsilon}=\varepsilon/2+O(\varepsilon^{3})$ and $qD_{1,\varepsilon}=\varepsilon/2+o(\varepsilon)=p_{\varepsilon}+o(p_{\varepsilon})\text{,}$ so $\alpha_{\varepsilon}=o(p_{\varepsilon})\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS4.p13" class="ltx_para"&gt;
&lt;p id="S4.SS4.p13.1" class="ltx_p"&gt;&lt;em id="S4.SS4.p13.1.1" class="ltx_emph ltx_font_italic"&gt;Claim 2&lt;/em&gt;&lt;span id="S4.SS4.p13.1.2" class="ltx_text"&gt;: $d_{\mathrm{K}}=\Theta(p_{\varepsilon})\text{.}$ The event $\{T=1\}$ requires $T_{0}=1$ and no catastrophe: $P(T=1)=\varepsilon/2\text{.}$ At $x_{0}=1/E[T]\text{:}$ $P(W\leq x_{0})=P(T\leq 1)=p_{\varepsilon}+o(p_{\varepsilon})$ while $1-e^{-x_{0}}=p_{\varepsilon}/2+O(p_{\varepsilon}^{2})\text{.}$ Hence $d_{\mathrm{K}}\geq p_{\varepsilon}/2+o(p_{\varepsilon})\text{.}$ The upper bound $d_{\mathrm{K}}=O(p_{\varepsilon})$ follows from Theorem &lt;a href="#S4.Thmtheorem13" title="Theorem 4.13 (Bridge Theorem). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.13&lt;/span&gt;&lt;/a&gt; (since $|\alpha_{\varepsilon}|=o(p_{\varepsilon})$).
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem17" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmtheorem17.2" class="ltx_text ltx_font_italic"&gt;Remark 4.17&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmtheorem17.3" class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;(Why $p+|\alpha|$ is the correct template)&lt;span id="S4.Thmtheorem17.4" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmtheorem17.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmtheorem17.p1.1" class="ltx_p"&gt;The two-sided bound decomposes the approximation error into two sources with distinct physical origins:&lt;/p&gt;
&lt;ul id="S4.I3" class="ltx_itemize"&gt;
&lt;li id="S4.I3.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S4.I3.i1.p1" class="ltx_para"&gt;
&lt;p id="S4.I3.i1.p1.1" class="ltx_p"&gt;The &lt;em id="S4.I3.i1.p1.1.1" class="ltx_emph ltx_font_italic"&gt;$p$-term&lt;/em&gt; reflects geometric discreteness: the attempt count is integer-valued, so $W$ takes values in $(1/\mu)\mathbb{Z}_{&amp;gt;0}\text{,}$ creating CDF jumps that no continuous distribution can match.&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S4.I3.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S4.I3.i2.p1" class="ltx_para"&gt;
&lt;p id="S4.I3.i2.p1.1" class="ltx_p"&gt;The &lt;em id="S4.I3.i2.p1.1.1" class="ltx_emph ltx_font_italic"&gt;$|\alpha|$-term&lt;/em&gt; reflects the successful-attempt perturbation: $T$ is not a pure geometric sum but includes the final attempt $B\text{,}$ whose expected length may deviate from the rescaling target.&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p id="S4.Thmtheorem17.p1.2" class="ltx_p"&gt;The counterexample engineers near-cancellation of the perturbation ($\alpha\approx 0$) while preserving the irreducible lattice error, exposing the $\Theta(p)$ floor. In the CCP application (§&lt;a href="#S6" title="6 Application: Coupon Collector with Reset ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;), the opposite regime prevails: $p\ll|\alpha|\text{,}$ so the perturbation term dominates.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S5" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="continuous-time-theory"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;5 &lt;/span&gt;Continuous-Time Theory&lt;/h2&gt;
&lt;div id="S5.p1" class="ltx_para"&gt;
&lt;p id="S5.p1.1" class="ltx_p"&gt;The discrete theory of §§&lt;a href="#S2" title="2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;–&lt;a href="#S4" title="4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; rests on the affine dependence of $G_{T}$ on the base PGF $g$ at a linearly shifted argument. In continuous time, the same mechanism operates with PGFs replaced by Laplace transforms and the multiplicative shift $u=ws$ replaced by an additive shift $\sigma=\lambda+r\text{.}$ The entire theory carries over, with one notable sharpening: the geometric-tail gap of Theorem &lt;a href="#S3.Thmtheorem6" title="Theorem 3.6 (Characterization). ‣ 3.3 The Characterization Theorem ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.6&lt;/span&gt;&lt;/a&gt; closes, and affine Laplace structure characterizes &lt;em id="S5.p1.1.1" class="ltx_emph ltx_font_italic"&gt;full&lt;/em&gt; Poisson resetting with no residual degree of freedom (Theorem &lt;a href="#S5.Thmtheorem7" title="Theorem 5.7 (Continuous-time characterization). ‣ 5.4 Characterization: Affine Laplace Structure Is Poisson ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.7&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S5.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="setup"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.1 &lt;/span&gt;Setup&lt;/h3&gt;
&lt;div id="S5.SS1.p1" class="ltx_para"&gt;
&lt;p id="S5.SS1.p1.1" class="ltx_p"&gt;Let $T_{0}$ be a positive, almost surely finite, continuous random variable with Laplace transform $\hat{f}_{0}(\lambda)=E[e^{-\lambda T_{0}}]\text{.}$ Catastrophe occurs via a Poisson process of rate $r&amp;gt;0\text{,}$ independent of $T_{0}\text{.}$ The attempt decomposition (&lt;a href="#S2.E6" title="In 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;) carries over with $N\sim\operatorname{Geom}_{0}(p)$ and&lt;/p&gt;
&lt;table id="S5.E35" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$p=P(T_{0}&amp;lt;\tau)=E[e^{-rT_{0}}]=\hat{f}_{0}(r),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(35)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS1.p1.2" class="ltx_p"&gt;where $\tau\sim\operatorname{Exp}(r)$ is the first catastrophe time. Under any age-based mechanism, catastrophe and $T_{0}$ are independent, so $p=P(T_{0}&amp;lt;\tau)=E[S(T_{0})]\text{,}$ the continuous-time analog of (&lt;a href="#S3.E19" title="In 3.1 General Hazard Framework ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;19&lt;/span&gt;&lt;/a&gt;). More generally, for any continuous-time catastrophe mechanism with hazard rate $h:(0,\infty)\to(0,\infty)\text{,}$ the survival function $S(x)=\exp\bigl(-\int_{0}^{x}h(t)\,dt\bigr)$ gives the probability of no catastrophe before time $x\text{;}$ Poisson resetting is the special case $h\equiv r\text{,}$ i.e., $S(x)=e^{-rx}\text{.}$ We write $\hat{f}_{T}(\lambda)=E[e^{-\lambda T}]$ for the Laplace transform of the completion time.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S5.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-laplace-transform-formula-and-affine-structure"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.2 &lt;/span&gt;The Laplace Transform Formula and Affine Structure&lt;/h3&gt;
&lt;div id="S5.SS2.p1" class="ltx_para"&gt;
&lt;p id="S5.SS2.p1.1" class="ltx_p"&gt;The following is a standard consequence of the renewal structure under Poisson resetting (see, e.g., &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib16" title="" class="ltx_ref"&gt;15&lt;/a&gt;, &lt;a href="#bib.bib8" title="" class="ltx_ref"&gt;8&lt;/a&gt;]&lt;/cite&gt;). We state it to exhibit its affine structure, which has not been identified previously.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.Thmtheorem1" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmtheorem1.2" class="ltx_text ltx_font_bold"&gt;Theorem 5.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmtheorem1.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Laplace transform under Poisson resetting)&lt;span id="S5.Thmtheorem1.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmtheorem1.p1.1" class="ltx_p"&gt;&lt;span id="S5.Thmtheorem1.p1.1.1" class="ltx_text ltx_font_italic"&gt;For any base process $T_{0}$ under Poisson resetting at rate $r\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.E36" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\hat{f}_{T}(\lambda)=\frac{(\lambda+r)\,\hat{f}_{0}(\lambda+r)}{\lambda+r\,\hat{f}_{0}(\lambda+r)},\qquad\sigma:=\lambda+r.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(36)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.SS2.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S5.SS2.p2" class="ltx_para"&gt;
&lt;p id="S5.SS2.p2.1" class="ltx_p"&gt;&lt;span id="S5.SS2.p2.1.1" class="ltx_text"&gt;The successful-attempt Laplace transform is $\hat{f}_{B}(\lambda)=\hat{f}_{0}(\sigma)/p$ (tilting by $e^{-rT_{0}}/p$). For the failed attempt, $A=\tau\mid\tau&amp;lt;T_{0}$ with $\tau\sim\operatorname{Exp}(r)$ independent of $T_{0}\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex32" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(1-p)\,\hat{f}_{A}(\lambda)=E[e^{-\lambda\tau}\mathbf{1}_{\tau&amp;lt;T_{0}}]=\frac{r(1-\hat{f}_{0}(\sigma))}{\sigma}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS2.p2.2" class="ltx_p"&gt;&lt;span id="S5.SS2.p2.2.1" class="ltx_text"&gt;Composing via $\hat{f}_{T}=\hat{f}_{B}\cdot p/[1-(1-p)\hat{f}_{A}]\text{,}$ the denominator becomes $1-r(1-\hat{f}_{0}(\sigma))/\sigma=(\lambda+r\hat{f}_{0}(\sigma))/\sigma\text{,}$ using $\sigma-r=\lambda\text{,}$ which gives (&lt;a href="#S5.E36" title="In Theorem 5.1 (Laplace transform under Poisson resetting). ‣ 5.2 The Laplace Transform Formula and Affine Structure ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;36&lt;/span&gt;&lt;/a&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS2.p3" class="ltx_para"&gt;
&lt;p id="S5.SS2.p3.1" class="ltx_p"&gt;&lt;span id="S5.SS2.p3.1.1" class="ltx_text"&gt;∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.Thmtheorem2" class="ltx_theorem ltx_theorem_corollary"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmtheorem2.2" class="ltx_text ltx_font_bold"&gt;Corollary 5.2&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmtheorem2.3" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmtheorem2.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmtheorem2.p1.1" class="ltx_p"&gt;$E[T]=(1-p)/(rp)$&lt;span id="S5.Thmtheorem2.p1.1.1" class="ltx_text ltx_font_italic"&gt;, depending on $T_{0}$ only through $p=\hat{f}_{0}(r)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.SS2.3" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S5.SS2.p4" class="ltx_para"&gt;
&lt;p id="S5.SS2.p4.1" class="ltx_p"&gt;&lt;span id="S5.SS2.p4.1.1" class="ltx_text"&gt;By the attempt decomposition, $E[T]=E[\ell]/p$ with $E[\ell]=(1-p)/r$ (the expected attempt length under $\operatorname{Exp}(r)$ catastrophe), giving $E[T]=(1-p)/(rp)\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.SS2.p5" class="ltx_para"&gt;
&lt;p id="S5.SS2.p5.1" class="ltx_p"&gt;As in the discrete case (§&lt;a href="#S2.SS2" title="2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt;), formula (&lt;a href="#S5.E36" title="In Theorem 5.1 (Laplace transform under Poisson resetting). ‣ 5.2 The Laplace Transform Formula and Affine Structure ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;36&lt;/span&gt;&lt;/a&gt;) is affine in $\hat{f}_{0}(\sigma)$ with linear shift $\sigma=\lambda+r\text{:}$&lt;/p&gt;
&lt;table id="S5.E37" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$N(\lambda)=\underbrace{\sigma}_{\alpha_{N}(\lambda)}\cdot\hat{f}_{0}(\sigma)+\underbrace{0}_{\beta_{N}(\lambda)},\qquad D(\lambda)=\underbrace{r}_{\alpha_{D}(\lambda)}\cdot\hat{f}_{0}(\sigma)+\underbrace{\lambda}_{\beta_{D}(\lambda)}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(37)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS2.p5.2" class="ltx_p"&gt;At the normalization point $\lambda=0\text{:}$ $\beta_{N}(0)=0=\beta_{D}(0)\text{,}$ so $\hat{f}_{T}(0)=1$ forces&lt;/p&gt;
&lt;table id="S5.E38" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\alpha_{N}(0)=\alpha_{D}(0)=r,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(38)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS2.p5.3" class="ltx_p"&gt;the continuous-time counterpart of (&lt;a href="#S2.E10" title="In Proposition 2.5 (Affine structure and coefficient equality). ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;10&lt;/span&gt;&lt;/a&gt;). Since the transform has the same affine-ratio structure with linear shift and coefficient matching at $\lambda=0\text{,}$ Lemma &lt;a href="#S2.Thmtheorem7" title="Lemma 2.7 (Affine-ratio recursion). ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.7&lt;/span&gt;&lt;/a&gt; applies in continuous time as well.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S5.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="derivative-reduction"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.3 &lt;/span&gt;Derivative Reduction&lt;/h3&gt;
&lt;div id="S5.Thmtheorem3" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmtheorem3.2" class="ltx_text ltx_font_bold"&gt;Theorem 5.3&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmtheorem3.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Continuous-time DRP)&lt;span id="S5.Thmtheorem3.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmtheorem3.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmtheorem3.p1.1" class="ltx_p"&gt;&lt;span id="S5.Thmtheorem3.p1.1.1" class="ltx_text ltx_font_italic"&gt;Define $D_{k}=\hat{f}_{0}^{(k)}(r)$ and $\Delta_{k}=N^{(k)}(0)-D^{(k)}(0)\text{.}$ For all $k\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.E39" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Delta_{k}=\begin{cases}-(1-p),&amp;amp;k=1,\\ k\,D_{k-1},&amp;amp;k\geq 2.\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(39)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.Thmtheorem3.p1.2" class="ltx_p"&gt;&lt;span id="S5.Thmtheorem3.p1.2.1" class="ltx_text ltx_font_italic"&gt;In particular, $\Delta_{k}$ does not contain $D_{k}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.SS3.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S5.SS3.p1" class="ltx_para"&gt;
&lt;p id="S5.SS3.p1.1" class="ltx_p"&gt;&lt;span id="S5.SS3.p1.1.1" class="ltx_text"&gt;Since $N(\lambda)=(\lambda+r)\hat{f}_{0}(\lambda+r)$ and $\sigma=\lambda+r$ is linear ($\sigma^{\prime}=1$), the Leibniz rule gives $N^{(k)}(0)=rD_{k}+kD_{k-1}\text{.}$ For the denominator: $D^{(1)}(0)=1+rD_{1}$ and $D^{(k)}(0)=rD_{k}$ for $k\geq 2\text{.}$ Hence $\Delta_{k}=kD_{k-1}$ for $k\geq 2$ (the $D_{k}$ terms cancel because $\alpha_{N}(0)=\alpha_{D}(0)=r$), and $\Delta_{1}=(rD_{1}+p)-(1+rD_{1})=p-1\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.Thmtheorem4" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmtheorem4.2" class="ltx_text ltx_font_italic"&gt;Remark 5.4&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmtheorem4.3" class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;(Comparison with the discrete DRP)&lt;span id="S5.Thmtheorem4.4" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmtheorem4.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmtheorem4.p1.1" class="ltx_p"&gt;The discrete formula $\Delta_{k}=-ks^{k-1}D_{k-1}$ (Theorem &lt;a href="#S2.Thmtheorem6" title="Theorem 2.6 (Derivative reduction principle). ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.6&lt;/span&gt;&lt;/a&gt;) contains the factor $s^{k-1}$ from the multiplicative shift $u=ws$ (chain rule coefficient $s$). The continuous formula $\Delta_{k}=kD_{k-1}$ has no such factor because the additive shift $\sigma=\lambda+r$ has chain rule coefficient $1\text{.}$ The sign difference ($-k$ vs. $+k$) reflects opposite monotonicity conventions: $G_{T}^{\prime}(1)=E[T]&amp;gt;0$ while $\hat{f}_{T}^{\prime}(0)=-E[T]&amp;lt;0\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S5.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="characterization-affine-laplace-structure-is-poisson"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.4 &lt;/span&gt;Characterization: Affine Laplace Structure Is Poisson&lt;/h3&gt;
&lt;div id="S5.SS4.p1" class="ltx_para"&gt;
&lt;p id="S5.SS4.p1.1" class="ltx_p"&gt;In discrete time, affine PGF structure characterizes geometric-tail catastrophe—constant hazard from the second step onward—leaving the first-step hazard $h_{1}$ as a free parameter (Theorem &lt;a href="#S3.Thmtheorem6" title="Theorem 3.6 (Characterization). ‣ 3.3 The Characterization Theorem ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.6&lt;/span&gt;&lt;/a&gt;). In continuous time, this residual degree of freedom vanishes.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.Thmtheorem5" class="ltx_theorem ltx_theorem_definition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmtheorem5.2" class="ltx_text ltx_font_bold"&gt;Definition 5.5&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmtheorem5.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Uniform affine Laplace structure)&lt;span id="S5.Thmtheorem5.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmtheorem5.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmtheorem5.p1.1" class="ltx_p"&gt;A continuous-time catastrophe mechanism has &lt;em id="S5.Thmtheorem5.p1.1.1" class="ltx_emph ltx_font_italic"&gt;uniform affine Laplace structure&lt;/em&gt; if there exist functions $a(\lambda),b(\lambda),c(\lambda),d(\lambda)\text{,}$ analytic in a neighborhood of $\lambda=0\text{,}$ depending only on the mechanism and a linear function $\sigma(\lambda)=\lambda+r$ ($r&amp;gt;0$), such that for all base processes $T_{0}\text{,}$&lt;/p&gt;
&lt;table id="S5.Ex33" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\hat{f}_{T}(\lambda)=\frac{a(\lambda)\,\hat{f}_{0}(\sigma)+b(\lambda)}{c(\lambda)\,\hat{f}_{0}(\sigma)+d(\lambda)},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.Thmtheorem5.p1.2" class="ltx_p"&gt;with $a,c$ not identically zero and $c(0)\hat{f}_{0}(r)+d(0)\neq 0$ for all admissible $\hat{f}_{0}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.Thmtheorem6" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmtheorem6.2" class="ltx_text ltx_font_italic"&gt;Remark 5.6&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmtheorem6.3" class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;(Why the shift has unit slope)&lt;span id="S5.Thmtheorem6.4" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmtheorem6.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmtheorem6.p1.1" class="ltx_p"&gt;The restriction $\sigma(\lambda)=\lambda+r$ is not &lt;em id="S5.Thmtheorem6.p1.1.1" class="ltx_emph ltx_font_italic"&gt;ad hoc&lt;/em&gt;. Starting from a general linear shift $\sigma(\lambda)=a\lambda+b$ with $a,b&amp;gt;0\text{,}$ the single-point sufficiency condition $p=\hat{f}_{0}(b)$ for all $T_{0}$ forces $S(x)=e^{-bx}$ (take $T_{0}=\delta_{x}$), identifying $b$ with the catastrophe rate $r\text{.}$ The Poisson catastrophe time then contributes a factor $e^{-rt}$ that combines with the Laplace kernel $e^{-\lambda t}$ into $e^{-(\lambda+r)t}\text{,}$ giving $a=1$ without further assumptions.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.SS4.p2" class="ltx_para"&gt;
&lt;p id="S5.SS4.p2.1" class="ltx_p"&gt;For the characterization result below, we temporarily enlarge the admissible
class of base laws: the quantifiers over $T_{0}$ range over all positive,
almost surely finite random variables, including point masses and two-point
mixtures. Continuity of $T_{0}$ is imposed only later, in the lattice-free
sharp-rate statement.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.Thmtheorem7" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmtheorem7.2" class="ltx_text ltx_font_bold"&gt;Theorem 5.7&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmtheorem7.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Continuous-time characterization)&lt;span id="S5.Thmtheorem7.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmtheorem7.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmtheorem7.p1.1" class="ltx_p"&gt;&lt;span id="S5.Thmtheorem7.p1.1.1" class="ltx_text ltx_font_italic"&gt;Among continuous-time age-based catastrophe mechanisms specified by a measurable, locally integrable hazard rate $h:(0,\infty)\to(0,\infty)$ (so that $S(x)=\exp(-\int_{0}^{x}h(t)\,dt)$ is well-defined, strictly decreasing, and absolutely continuous), the following are equivalent:&lt;/span&gt;&lt;/p&gt;
&lt;ol id="S5.I1" class="ltx_enumerate"&gt;
&lt;li id="S5.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;(a)&lt;/span&gt;
&lt;div id="S5.I1.i1.p1" class="ltx_para"&gt;
&lt;p id="S5.I1.i1.p1.1" class="ltx_p"&gt;$S(x)=e^{-rx}$&lt;span id="S5.I1.i1.p1.1.1" class="ltx_text ltx_font_italic"&gt; for all &lt;/span&gt;$x&amp;gt;0$&lt;span id="S5.I1.i1.p1.1.2" class="ltx_text ltx_font_italic"&gt; (Poisson resetting; equivalently,
&lt;/span&gt;$h(t)=r$&lt;span id="S5.I1.i1.p1.1.3" class="ltx_text ltx_font_italic"&gt; for a.e. &lt;/span&gt;$t&amp;gt;0$&lt;span id="S5.I1.i1.p1.1.4" class="ltx_text ltx_font_italic"&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S5.I1.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;(b)&lt;/span&gt;
&lt;div id="S5.I1.i2.p1" class="ltx_para"&gt;
&lt;p id="S5.I1.i2.p1.1" class="ltx_p"&gt;&lt;span id="S5.I1.i2.p1.1.1" class="ltx_text ltx_font_italic"&gt;Uniform affine Laplace structure (Definition &lt;/span&gt;&lt;a href="#S5.Thmtheorem5" title="Definition 5.5 (Uniform affine Laplace structure). ‣ 5.4 Characterization: Affine Laplace Structure Is Poisson ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref ltx_font_italic"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.5&lt;/span&gt;&lt;/a&gt;&lt;span id="S5.I1.i2.p1.1.2" class="ltx_text ltx_font_italic"&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S5.I1.i3" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;(c)&lt;/span&gt;
&lt;div id="S5.I1.i3.p1" class="ltx_para"&gt;
&lt;p id="S5.I1.i3.p1.1" class="ltx_p"&gt;&lt;span id="S5.I1.i3.p1.1.1" class="ltx_text ltx_font_italic"&gt;Derivative reduction: there exists &lt;/span&gt;$r_{0}&amp;gt;0$&lt;span id="S5.I1.i3.p1.1.2" class="ltx_text ltx_font_italic"&gt; such that for every
positive, almost surely finite &lt;/span&gt;$T_{0}$&lt;span id="S5.I1.i3.p1.1.3" class="ltx_text ltx_font_italic"&gt; and every &lt;/span&gt;$k\geq 1$&lt;span id="S5.I1.i3.p1.1.4" class="ltx_text ltx_font_italic"&gt;, the &lt;/span&gt;$k$&lt;span id="S5.I1.i3.p1.1.5" class="ltx_text ltx_font_italic"&gt;-th
moment of &lt;/span&gt;$T$&lt;span id="S5.I1.i3.p1.1.6" class="ltx_text ltx_font_italic"&gt; is determined by
&lt;/span&gt;$\{\hat{f}_{0}^{(j)}(r_{0})\}_{j=0}^{k-1}$&lt;span id="S5.I1.i3.p1.1.7" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S5.I1.i4" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;(d)&lt;/span&gt;
&lt;div id="S5.I1.i4.p1" class="ltx_para"&gt;
&lt;p id="S5.I1.i4.p1.1" class="ltx_p"&gt;&lt;span id="S5.I1.i4.p1.1.1" class="ltx_text ltx_font_italic"&gt;Single-point sufficiency: there exists &lt;/span&gt;$r_{0}&amp;gt;0$&lt;span id="S5.I1.i4.p1.1.2" class="ltx_text ltx_font_italic"&gt; such that
&lt;/span&gt;$p=\hat{f}_{0}(r_{0})$&lt;span id="S5.I1.i4.p1.1.3" class="ltx_text ltx_font_italic"&gt; for every positive, almost surely finite &lt;/span&gt;$T_{0}$&lt;span id="S5.I1.i4.p1.1.4" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.SS4.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S5.SS4.p3" class="ltx_para"&gt;
&lt;p id="S5.SS4.p3.1" class="ltx_p"&gt;&lt;span id="S5.SS4.p3.1.1" class="ltx_text"&gt;(a)$\Rightarrow$(b): Theorem &lt;a href="#S5.Thmtheorem1" title="Theorem 5.1 (Laplace transform under Poisson resetting). ‣ 5.2 The Laplace Transform Formula and Affine Structure ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.1&lt;/span&gt;&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS4.p4" class="ltx_para"&gt;
&lt;p id="S5.SS4.p4.1" class="ltx_p"&gt;&lt;span id="S5.SS4.p4.1.1" class="ltx_text"&gt;(b)$\Rightarrow$(c): Suppose&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex34" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\hat{f}_{T}(\lambda)=\frac{a(\lambda)\hat{f}_{0}(\sigma(\lambda))+b(\lambda)}{c(\lambda)\hat{f}_{0}(\sigma(\lambda))+d(\lambda)},\qquad\sigma(\lambda)=\lambda+r_{0}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS4.p4.2" class="ltx_p"&gt;&lt;span id="S5.SS4.p4.2.1" class="ltx_text"&gt;Applying $\hat{f}_{T}(0)=1$ to point masses $T_{0}=\delta_{x}$ and letting $x\to\infty$ gives $b(0)=d(0)\text{;}$ back-substitution yields $a(0)=c(0)\text{.}$ By non-degeneracy, Lemma &lt;a href="#S2.Thmtheorem7" title="Lemma 2.7 (Affine-ratio recursion). ‣ 2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.7&lt;/span&gt;&lt;/a&gt; applies with $R=\hat{f}_{T}\text{,}$ $h=\hat{f}_{0}\text{,}$ $z_{*}=0\text{,}$ and $u_{0}=r_{0}\text{.}$ Hence $\hat{f}_{T}^{(k)}(0)$ depends only on $\{\hat{f}_{0}^{(j)}(r_{0})\}_{j=0}^{k-1}\text{,}$ which is exactly the derivative-reduction property.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS4.p5" class="ltx_para"&gt;
&lt;p id="S5.SS4.p5.1" class="ltx_p"&gt;&lt;span id="S5.SS4.p5.1.1" class="ltx_text"&gt;(a)$\Rightarrow$(d): By definition (&lt;a href="#S5.E35" title="In 5.1 Setup ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;35&lt;/span&gt;&lt;/a&gt;),&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex35" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$p=P(T_{0}&amp;lt;\tau)=E[e^{-rT_{0}}]=\hat{f}_{0}(r).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S5.SS4.p6" class="ltx_para"&gt;
&lt;p id="S5.SS4.p6.1" class="ltx_p"&gt;&lt;span id="S5.SS4.p6.1.1" class="ltx_text"&gt;(d)$\Rightarrow$(a): Under (d), for every positive, almost surely finite
$T_{0}$ we have&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex36" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$E[S(T_{0})]=p=\hat{f}_{0}(r_{0})=E[e^{-r_{0}T_{0}}].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS4.p6.2" class="ltx_p"&gt;&lt;span id="S5.SS4.p6.2.1" class="ltx_text"&gt;Taking $T_{0}=\delta_{x}$ gives $S(x)=e^{-r_{0}x}$ for every $x&amp;gt;0\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS4.p7" class="ltx_para"&gt;
&lt;p id="S5.SS4.p7.1" class="ltx_p"&gt;&lt;span id="S5.SS4.p7.1.1" class="ltx_text"&gt;(c)$\Rightarrow$(a): We use only the $k=1$ case. Thus there exist
$r_{0}&amp;gt;0$ and a function $\psi:(0,1)\to\mathbb{R}$ such that&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex37" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$E[T]=\psi(\hat{f}_{0}(r_{0}))$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS4.p7.2" class="ltx_p"&gt;&lt;span id="S5.SS4.p7.2.1" class="ltx_text"&gt;for every positive, almost surely finite $T_{0}\text{.}$
For a general continuous-time age-based catastrophe mechanism,&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex38" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$p=E[S(T_{0})],\qquad E[\ell\,|\,T_{0}=x]=F(x):=\int_{0}^{x}S(t)\,dt,\qquad E[T]=\frac{E[\ell]}{p}=\frac{E[F(T_{0})]}{E[S(T_{0})]}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS4.p7.3" class="ltx_p"&gt;&lt;span id="S5.SS4.p7.3.1" class="ltx_text"&gt;Hence&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.E40" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{E[F(T_{0})]}{E[S(T_{0})]}=\psi\!\bigl(E[e^{-r_{0}T_{0}}]\bigr)$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(40)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS4.p7.4" class="ltx_p"&gt;&lt;span id="S5.SS4.p7.4.1" class="ltx_text"&gt;for all positive, almost surely finite $T_{0}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS4.p8" class="ltx_para"&gt;
&lt;p id="S5.SS4.p8.1" class="ltx_p"&gt;&lt;em id="S5.SS4.p8.1.1" class="ltx_emph ltx_font_italic"&gt;Step 1: point masses determine $\psi$ on $(0,1)\text{.}$&lt;/em&gt;&lt;span id="S5.SS4.p8.1.2" class="ltx_text"&gt;
Taking $T_{0}=\delta_{x}$ in (&lt;a href="#S5.E40" title="In Proof. ‣ 5.4 Characterization: Affine Laplace Structure Is Poisson ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;40&lt;/span&gt;&lt;/a&gt;) gives&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex39" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\psi(e^{-r_{0}x})=\frac{F(x)}{S(x)},\qquad x&amp;gt;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS4.p8.2" class="ltx_p"&gt;&lt;span id="S5.SS4.p8.2.1" class="ltx_text"&gt;Since $x\mapsto e^{-r_{0}x}$ is a bijection $(0,\infty)\to(0,1)\text{,}$ point
masses determine $\psi$ on all of $(0,1)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS4.p9" class="ltx_para"&gt;
&lt;p id="S5.SS4.p9.1" class="ltx_p"&gt;&lt;em id="S5.SS4.p9.1.1" class="ltx_emph ltx_font_italic"&gt;Step 2: two-point laws force $\psi$ to be Möbius.&lt;/em&gt;&lt;span id="S5.SS4.p9.1.2" class="ltx_text"&gt;
Take $T_{0}=\alpha\delta_{a}+(1-\alpha)\delta_{b}$ with $0&amp;lt;a&amp;lt;b\text{.}$ Writing&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex40" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$v=\alpha e^{-r_{0}a}+(1-\alpha)e^{-r_{0}b}\in[e^{-r_{0}b},e^{-r_{0}a}],$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS4.p9.2" class="ltx_p"&gt;&lt;span id="S5.SS4.p9.2.1" class="ltx_text"&gt;equation (&lt;a href="#S5.E40" title="In Proof. ‣ 5.4 Characterization: Affine Laplace Structure Is Poisson ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;40&lt;/span&gt;&lt;/a&gt;) becomes&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex41" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\psi(v)=\frac{\alpha F(a)+(1-\alpha)F(b)}{\alpha S(a)+(1-\alpha)S(b)}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS4.p9.3" class="ltx_p"&gt;&lt;span id="S5.SS4.p9.3.1" class="ltx_text"&gt;Solving for $\alpha$ in terms of $v$ shows that the right-hand side is a
linear-fractional function of $v\text{,}$ namely&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex42" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\psi(v)=\frac{(F(a)-F(b))\,v+F(b)e^{-r_{0}a}-F(a)e^{-r_{0}b}}{(S(a)-S(b))\,v+S(b)e^{-r_{0}a}-S(a)e^{-r_{0}b}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS4.p9.4" class="ltx_p"&gt;&lt;span id="S5.SS4.p9.4.1" class="ltx_text"&gt;Thus $\psi$ is Möbius on every interval
$[e^{-r_{0}b},e^{-r_{0}a}]\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS4.p10" class="ltx_para"&gt;
&lt;p id="S5.SS4.p10.1" class="ltx_p"&gt;&lt;em id="S5.SS4.p10.1.1" class="ltx_emph ltx_font_italic"&gt;Step 3: overlapping intervals glue the local Möbius maps globally.&lt;/em&gt;&lt;span id="S5.SS4.p10.1.2" class="ltx_text"&gt;
Exactly as in Steps 2–4 of Theorem &lt;a href="#S3.Thmtheorem6" title="Theorem 3.6 (Characterization). ‣ 3.3 The Characterization Theorem ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.6&lt;/span&gt;&lt;/a&gt;, the overlapping-interval
consistency argument shows that all these local Möbius maps coincide with a
single global one:&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex43" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\psi(v)=\frac{Av+B}{Cv+D},\qquad v\in(0,1).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS4.p10.2" class="ltx_p"&gt;&lt;span id="S5.SS4.p10.2.1" class="ltx_text"&gt;Because $S$ is strictly decreasing, the denominator slope in the two-point
formula is nonzero, so the global denominator coefficient satisfies $C\neq 0\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS4.p11" class="ltx_para"&gt;
&lt;p id="S5.SS4.p11.1" class="ltx_p"&gt;&lt;em id="S5.SS4.p11.1.1" class="ltx_emph ltx_font_italic"&gt;Step 4: coefficient consistency forces $F=\rho S+c\text{.}$&lt;/em&gt;&lt;span id="S5.SS4.p11.1.2" class="ltx_text"&gt;
Comparing the coefficients of $v$ in the two-point representation with the
global Möbius map shows that&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex44" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{F(a)-F(b)}{S(a)-S(b)}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS4.p11.2" class="ltx_p"&gt;&lt;span id="S5.SS4.p11.2.1" class="ltx_text"&gt;is independent of the pair $(a,b)$ with $a\neq b\text{.}$ Denoting this constant by
$\rho\text{,}$ we obtain&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex45" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F(x)=\rho\,S(x)+c,\qquad x&amp;gt;0$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS4.p11.3" class="ltx_p"&gt;&lt;span id="S5.SS4.p11.3.1" class="ltx_text"&gt;for some constant $c\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS4.p12" class="ltx_para"&gt;
&lt;p id="S5.SS4.p12.1" class="ltx_p"&gt;&lt;em id="S5.SS4.p12.1.1" class="ltx_emph ltx_font_italic"&gt;Step 5: differentiation yields constant hazard everywhere.&lt;/em&gt;&lt;span id="S5.SS4.p12.1.2" class="ltx_text"&gt;
Since $F(x)=\int_{0}^{x}S(t)\,dt$ is absolutely continuous and
$F^{\prime}(x)=S(x)$ a.e., differentiating $F=\rho S+c$ gives&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex46" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$S(x)=\rho\,S^{\prime}(x)\qquad\text{for a.e.\ }x&amp;gt;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS4.p12.2" class="ltx_p"&gt;&lt;span id="S5.SS4.p12.2.1" class="ltx_text"&gt;As $S^{\prime}(x)=-h(x)S(x)$ a.e. and $S(x)&amp;gt;0\text{,}$ we conclude&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex47" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$h(x)=-\frac{1}{\rho}=:r\qquad\text{for a.e.\ }x&amp;gt;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS4.p12.3" class="ltx_p"&gt;&lt;span id="S5.SS4.p12.3.1" class="ltx_text"&gt;Hence $S(x)=e^{-rx}$ for all $x&amp;gt;0\text{,}$ which is exactly (a).
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.Thmtheorem8" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmtheorem8.2" class="ltx_text ltx_font_italic"&gt;Remark 5.8&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmtheorem8.3" class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;(Why the geometric-tail gap closes)&lt;span id="S5.Thmtheorem8.4" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmtheorem8.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmtheorem8.p1.1" class="ltx_p"&gt;The geometric-tail gap of Theorem &lt;a href="#S3.Thmtheorem6" title="Theorem 3.6 (Characterization). ‣ 3.3 The Characterization Theorem ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.6&lt;/span&gt;&lt;/a&gt; is a joint artifact of two discrete-time limitations: countable test points (requiring Möbius extension) and integer arithmetic (permitting only differencing). In continuous time, both limitations vanish simultaneously, forcing full Poisson resetting with no residual degree of freedom.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S5.SS5" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="exponential-approximation-1"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.5 &lt;/span&gt;Exponential Approximation&lt;/h3&gt;
&lt;div id="S5.SS5.p1" class="ltx_para"&gt;
&lt;p id="S5.SS5.p1.1" class="ltx_p"&gt;The exponential approximation theory of §&lt;a href="#S4" title="4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; has a continuous-time counterpart. Define the continuous-time perturbation parameters:&lt;/p&gt;
&lt;table id="S5.E41" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\alpha=\frac{p+rD_{1}}{1-p},\qquad\beta=\frac{1+rD_{1}}{1-p},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(41)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS5.p1.2" class="ltx_p"&gt;where $D_{1}=\hat{f}_{0}^{\prime}(r)\text{.}$ Note that $D_{1}=-E[T_{0}e^{-rT_{0}}]&amp;lt;0\text{,}$ so the sign conventions in the discrete and continuous perturbation parameters are consistent: both $\alpha$ vanish when $b/\mu$ matches the geometric target (Remark &lt;a href="#S4.Thmtheorem3" title="Remark 4.3 (Interpretation of 𝛼). ‣ 4.1 The Perturbation Parameter ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.3&lt;/span&gt;&lt;/a&gt;).
The fundamental identity&lt;/p&gt;
&lt;table id="S5.E42" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$1+\alpha-\beta=0$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(42)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS5.p1.3" class="ltx_p"&gt;holds by the same one-line computation as Proposition &lt;a href="#S4.Thmtheorem2" title="Proposition 4.2 (Properties of the perturbation parameters). ‣ 4.1 The Perturbation Parameter ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S4.I2.i1" title="item a ‣ Proposition 4.2 (Properties of the perturbation parameters). ‣ 4.1 The Perturbation Parameter ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;a&lt;/span&gt;&lt;/a&gt;), replacing $s+q=1$ by direct cancellation of $rD_{1}\text{.}$ Differentiating $\hat{f}_{B}(\lambda)=\hat{f}_{0}(\lambda+r)/p$ at $\lambda=0$ gives $b=-D_{1}/p\text{,}$ so&lt;/p&gt;
&lt;table id="S5.E43" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{b}{\mu}=\frac{-rD_{1}}{1-p}=\frac{p}{1-p}-\alpha,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(43)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS5.p1.4" class="ltx_p"&gt;the continuous-time analog of Proposition &lt;a href="#S4.Thmtheorem2" title="Proposition 4.2 (Properties of the perturbation parameters). ‣ 4.1 The Perturbation Parameter ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S4.I2.i2" title="item b ‣ Proposition 4.2 (Properties of the perturbation parameters). ‣ 4.1 The Perturbation Parameter ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;b&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.Thmtheorem9" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmtheorem9.2" class="ltx_text ltx_font_bold"&gt;Theorem 5.9&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmtheorem9.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Continuous-time Laplace expansion)&lt;span id="S5.Thmtheorem9.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmtheorem9.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmtheorem9.p1.1" class="ltx_p"&gt;&lt;span id="S5.Thmtheorem9.p1.1.1" class="ltx_text ltx_font_italic"&gt;Under Poisson resetting at rate $r\text{,}$ let $W=T/E[T]\text{.}$ For $\epsilon:=\theta rp/(1-p)\leq\epsilon_{0}\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.E44" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$E[e^{-\theta W}]-\frac{1}{1+\theta}=\frac{\alpha\,\theta^{2}}{(1+\theta)^{2}}+O\!\left(\frac{|\alpha|^{2}\,\theta^{3}}{(1+\theta)^{3}}\right)+O\!\left(\frac{p\,\theta^{2}}{1+\theta}\right),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(44)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.Thmtheorem9.p1.2" class="ltx_p"&gt;&lt;span id="S5.Thmtheorem9.p1.2.1" class="ltx_text ltx_font_italic"&gt;with implicit constants depending on $|D_{1}|$ and $|D_{2}|\text{,}$ which satisfy $|D_{k}|=|\hat{f}_{0}^{(k)}(r)|=E[T_{0}^{k}e^{-rT_{0}}]\leq(k/(er))^{k}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.SS5.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S5.SS5.p2" class="ltx_para"&gt;
&lt;p id="S5.SS5.p2.1" class="ltx_p"&gt;&lt;span id="S5.SS5.p2.1.1" class="ltx_text"&gt;Set $\mu=(1-p)/(rp)\text{,}$ $\epsilon=\theta/\mu\text{,}$ and expand $\hat{f}_{0}(r+\epsilon)=p+D_{1}\epsilon+O(\epsilon^{2})\text{.}$ Then $N(\epsilon)=(r+\epsilon)(p+D_{1}\epsilon+O(\epsilon^{2}))=rp+(p+rD_{1})\epsilon+O(\epsilon^{2})$ and $D(\epsilon)=\epsilon+r(p+D_{1}\epsilon+O(\epsilon^{2}))=rp+(1+rD_{1})\epsilon+O(\epsilon^{2})\text{.}$ Dividing by $rp$ and substituting $\epsilon=\theta rp/(1-p)$ yields the ratio $(1+\alpha\theta+R_{N})/(1+\beta\theta+R_{D})$ with $|R_{N}|,|R_{D}|=O(\theta^{2}p)\text{.}$ The identity $1+\alpha-\beta=0$ ensures the $\theta^{1}$-coefficient vanishes. The remainder analysis is identical to the proof of Theorem &lt;a href="#S4.Thmtheorem4" title="Theorem 4.4 (Laplace expansion). ‣ 4.2 The Laplace Expansion ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.4&lt;/span&gt;&lt;/a&gt;.
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.Thmtheorem10" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmtheorem10.2" class="ltx_text ltx_font_bold"&gt;Lemma 5.10&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmtheorem10.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Continuous-time $\alpha\to 0$)&lt;span id="S5.Thmtheorem10.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmtheorem10.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmtheorem10.p1.1" class="ltx_p"&gt;&lt;span id="S5.Thmtheorem10.p1.1.1" class="ltx_text ltx_font_italic"&gt;For fixed $r&amp;gt;0\text{,}$ $|\alpha|=O(p|\ln p|)$ as $p=\hat{f}_{0}(r)\to 0\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.SS5.3" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S5.SS5.p3" class="ltx_para"&gt;
&lt;p id="S5.SS5.p3.1" class="ltx_p"&gt;&lt;span id="S5.SS5.p3.1.1" class="ltx_text"&gt;Set $Y=e^{-rT_{0}}\in(0,1]\text{,}$ so $p=E[Y]$ and $rD_{1}=E[Y\ln Y]$ (since $Y\ln Y=-rT_{0}e^{-rT_{0}}$), giving $-rD_{1}=E[-Y\ln Y]\text{.}$ Since $\varphi(x)=-x\ln x$ is concave, Jensen’s inequality gives $E[-Y\ln Y]\leq-p\ln p\text{.}$ Hence $|p+rD_{1}|\leq p+E[-Y\ln Y]\leq p(1+|\ln p|)\text{,}$ so $|\alpha|=O(p|\ln p|)\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.SS5.p4" class="ltx_para"&gt;
&lt;p id="S5.SS5.p4.1" class="ltx_p"&gt;In continuous time, the lattice error that contributes the $\Theta(p)$ floor in the discrete two-sided bound (Theorem &lt;a href="#S4.Thmtheorem15" title="Theorem 4.15 (Two-sided bound). ‣ 4.4 The Sharp Two-Sided Bound ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.15&lt;/span&gt;&lt;/a&gt;) disappears: when $T_{0}$ has a continuous distribution, so does $T\text{,}$ and the CDF of $W$ has no jumps. The sharp rate therefore reduces to $|\alpha|$ alone. The following lemma provides the necessary moment convergence for the Bridge Theorem.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.Thmtheorem11" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmtheorem11.2" class="ltx_text ltx_font_bold"&gt;Lemma 5.11&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmtheorem11.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Escape to infinity)&lt;span id="S5.Thmtheorem11.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmtheorem11.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmtheorem11.p1.1" class="ltx_p"&gt;&lt;span id="S5.Thmtheorem11.p1.1.1" class="ltx_text ltx_font_italic"&gt;Fix $r&amp;gt;0\text{.}$ Let $(T_{0,n})$ be a sequence of positive random variables with $p_{n}=E[e^{-rT_{0,n}}]\to 0\text{.}$ Then $T_{0,n}\to\infty$ in probability. Consequently, for each fixed $t\geq 0\text{,}$ $P(A_{n}\geq t)\to e^{-rt}\text{,}$ and for each fixed integer $k\geq 1\text{,}$ $E[A_{n}^{k}]\to k!/r^{k}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.SS5.4" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S5.SS5.p5" class="ltx_para"&gt;
&lt;p id="S5.SS5.p5.1" class="ltx_p"&gt;&lt;span id="S5.SS5.p5.1.1" class="ltx_text"&gt;For any fixed $x&amp;gt;0\text{,}$ $p_{n}\geq e^{-rx}P(T_{0,n}\leq x)\text{,}$ so $P(T_{0,n}\leq x)\leq e^{rx}p_{n}\to 0\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS5.p6" class="ltx_para"&gt;
&lt;p id="S5.SS5.p6.1" class="ltx_p"&gt;&lt;span id="S5.SS5.p6.1.1" class="ltx_text"&gt;For the failed-attempt tail: since $\tau\sim\operatorname{Exp}(r)$ is independent of $T_{0,n}\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex48" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$P(A_{n}\geq t)=\frac{P(\tau\geq t,\,\tau&amp;lt;T_{0,n})}{1-p_{n}}=\frac{E[(e^{-rt}-e^{-rT_{0,n}})\mathbf{1}_{\{T_{0,n}&amp;gt;t\}}]}{1-p_{n}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS5.p6.2" class="ltx_p"&gt;&lt;span id="S5.SS5.p6.2.1" class="ltx_text"&gt;As $n\to\infty\text{:}$ $E[e^{-rT_{0,n}}\mathbf{1}_{\{T_{0,n}&amp;gt;t\}}]\leq p_{n}\to 0$ and $P(T_{0,n}&amp;gt;t)\to 1\text{,}$ so the numerator tends to $e^{-rt}$ and the denominator to $1\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS5.p7" class="ltx_para"&gt;
&lt;p id="S5.SS5.p7.1" class="ltx_p"&gt;&lt;span id="S5.SS5.p7.1.1" class="ltx_text"&gt;The uniform bound $P(A_{n}\geq t)\leq e^{-rt}/(1-p_{n})\leq 2e^{-rt}$ (for $p_{n}\leq 1/2$) provides a dominator for $t^{k-1}P(A_{n}\geq t)\text{,}$ so dominated convergence gives $E[A_{n}^{k}]=k\int_{0}^{\infty}t^{k-1}P(A_{n}\geq t)\,dt\to k!/r^{k}\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.Thmtheorem12" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmtheorem12.2" class="ltx_text ltx_font_bold"&gt;Theorem 5.12&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmtheorem12.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Continuous-time sharp bound)&lt;span id="S5.Thmtheorem12.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmtheorem12.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmtheorem12.p1.1" class="ltx_p"&gt;&lt;span id="S5.Thmtheorem12.p1.1.1" class="ltx_text ltx_font_italic"&gt;Under Poisson resetting at rate $r\text{,}$ for $T_{0}$ with continuous distribution, and $|\alpha|/p\to\infty$ as $p\to 0\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.E45" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{\mathrm{K}}\!\left(\frac{T}{E[T]},\,\operatorname{Exp}(1)\right)\in\bigl[1-o(1),\;2+o(1)\bigr]\cdot|\alpha|.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(45)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.SS5.5" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S5.SS5.p8" class="ltx_para"&gt;
&lt;p id="S5.SS5.p8.1" class="ltx_p"&gt;&lt;em id="S5.SS5.p8.1.1" class="ltx_emph ltx_font_italic"&gt;Upper bound.&lt;/em&gt;&lt;span id="S5.SS5.p8.1.2" class="ltx_text"&gt; 
The Bridge Theorem (Theorem &lt;a href="#S4.Thmtheorem13" title="Theorem 4.13 (Bridge Theorem). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.13&lt;/span&gt;&lt;/a&gt;) applies in continuous time: its three steps—Brown’s bound, scaling, and additive perturbation—require only that $N\sim\operatorname{Geom}_{0}(p)\text{,}$ the $A_{i}$ be i.i.d. positive with $E[A^{2}]&amp;lt;\infty\text{,}$ and $B$ be independent of $U\text{;}$ none assumes integrality. The tail bound $P(A\geq t)\leq e^{-rt}/(1-p)$ from the proof of Lemma &lt;a href="#S5.Thmtheorem11" title="Lemma 5.11 (Escape to infinity). ‣ 5.5 Exponential Approximation ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.11&lt;/span&gt;&lt;/a&gt; gives $E[A^{k}]&amp;lt;\infty$ for all $k\text{,}$ verifying Brown’s moment condition. By Lemma &lt;a href="#S5.Thmtheorem11" title="Lemma 5.11 (Escape to infinity). ‣ 5.5 Exponential Approximation ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.11&lt;/span&gt;&lt;/a&gt;, $\rho_{j}=E[A^{j}]/E[A]^{j}\to j!$ as $p\to 0\text{,}$ so the Brown constant $C_{1}=O(1)\text{.}$ By (&lt;a href="#S5.E43" title="In 5.5 Exponential Approximation ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;43&lt;/span&gt;&lt;/a&gt;), $2b/\mu\leq 2|\alpha|+2p/(1-p)\text{.}$ Hence $d_{\mathrm{K}}\leq C_{1}p+2|\alpha|+2p/(1-p)=(2+o(1))|\alpha|\text{,}$ using $p=o(|\alpha|)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS5.p9" class="ltx_para"&gt;
&lt;p id="S5.SS5.p9.1" class="ltx_p"&gt;&lt;em id="S5.SS5.p9.1.1" class="ltx_emph ltx_font_italic"&gt;Lower bound.&lt;/em&gt;&lt;span id="S5.SS5.p9.1.2" class="ltx_text"&gt; 
Apply the Laplace expansion (Theorem &lt;a href="#S5.Thmtheorem9" title="Theorem 5.9 (Continuous-time Laplace expansion). ‣ 5.5 Exponential Approximation ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.9&lt;/span&gt;&lt;/a&gt;) with $\theta=\theta_{n}=(|\alpha|/(2p))^{1/2}\to\infty\text{.}$ The validity condition $\epsilon=\theta rp/(1-p)\to 0$ holds since $\epsilon=O(r\sqrt{p|\alpha|})\to 0$ by Lemma &lt;a href="#S5.Thmtheorem10" title="Lemma 5.10 (Continuous-time 𝛼→0). ‣ 5.5 Exponential Approximation ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.10&lt;/span&gt;&lt;/a&gt;. The error terms satisfy $p\theta^{2}/(1+\theta)\leq p\theta=\sqrt{p|\alpha|/2}=o(|\alpha|)$ and $|\alpha|^{2}\theta^{3}/(1+\theta)^{3}\leq|\alpha|^{2}=o(|\alpha|)\text{.}$ The leading term: $|\alpha|\theta^{2}/(1+\theta)^{2}=(1-o(1))|\alpha|$ since $\theta\to\infty\text{.}$ By (&lt;a href="#S4.E33" title="In Proof of the lower bound. ‣ 4.4 The Sharp Two-Sided Bound ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;33&lt;/span&gt;&lt;/a&gt;), $d_{\mathrm{K}}\geq(1-o(1))|\alpha|\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.Thmtheorem13" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmtheorem13.2" class="ltx_text ltx_font_italic"&gt;Remark 5.13&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmtheorem13.3" class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;(Disappearance of the lattice error)&lt;span id="S5.Thmtheorem13.4" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmtheorem13.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmtheorem13.p1.1" class="ltx_p"&gt;In the discrete two-sided bound (Theorem &lt;a href="#S4.Thmtheorem15" title="Theorem 4.15 (Two-sided bound). ‣ 4.4 The Sharp Two-Sided Bound ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.15&lt;/span&gt;&lt;/a&gt;), the template is $p+|\alpha|$ because $W$ takes values in $(1/\mu)\mathbb{Z}_{&amp;gt;0}\text{,}$ creating an irreducible $\Omega(p)$ lattice error (Proposition &lt;a href="#S4.Thmtheorem16" title="Proposition 4.16 (Counterexample: 𝑝 cannot be dropped). ‣ 4.4 The Sharp Two-Sided Bound ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.16&lt;/span&gt;&lt;/a&gt;). In continuous time, this error vanishes. When $|\alpha|/p\to\infty\text{,}$ the dominant error source is the successful-attempt perturbation encoded by $\alpha\text{;}$ when $\alpha\approx 0\text{,}$ a residual $O(p)$ error from higher-order terms persists.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S5.SS6" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="worked-example-brownian-first-passage"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.6 &lt;/span&gt;Worked Example: Brownian First Passage&lt;/h3&gt;
&lt;div id="S5.SS6.p1" class="ltx_para"&gt;
&lt;p id="S5.SS6.p1.1" class="ltx_p"&gt;To illustrate the continuous-time theory concretely, consider a Brownian particle starting at $x_{0}&amp;gt;0$ with an absorbing barrier at the origin, subject to Poisson resetting at rate $r\text{.}$ This is the original model of &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib15" title="" class="ltx_ref"&gt;16&lt;/a&gt;]&lt;/cite&gt;. The base first-passage time has Laplace transform $\hat{f}_{0}(\lambda)=e^{-x_{0}\sqrt{2\lambda}}\text{,}$ giving&lt;/p&gt;
&lt;table id="S5.Ex49" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$p=e^{-x_{0}\sqrt{2r}},\qquad E[T]=\frac{e^{x_{0}\sqrt{2r}}-1}{r},\qquad D_{1}=-\frac{x_{0}}{\sqrt{2r}}\,e^{-x_{0}\sqrt{2r}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS6.p1.2" class="ltx_p"&gt;The perturbation parameter:&lt;/p&gt;
&lt;table id="S5.E46" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\alpha=\frac{(1-x_{0}\sqrt{r/2})\,e^{-x_{0}\sqrt{2r}}}{1-e^{-x_{0}\sqrt{2r}}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(46)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS6.p1.3" class="ltx_p"&gt;As $x_{0}\sqrt{r}\to\infty\text{:}$ $|\alpha|\sim x_{0}\sqrt{r/2}\cdot p\text{,}$ so $|\alpha|/p\to\infty$—the perturbation term dominates, and Theorem &lt;a href="#S5.Thmtheorem12" title="Theorem 5.12 (Continuous-time sharp bound). ‣ 5.5 Exponential Approximation ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.12&lt;/span&gt;&lt;/a&gt; gives $d_{\mathrm{K}}\in[1-o(1),2+o(1)]\cdot|\alpha|\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS6.p2" class="ltx_para"&gt;
&lt;p id="S5.SS6.p2.1" class="ltx_p"&gt;At the critical point $x_{0}\sqrt{r/2}=1\text{,}$ the perturbation parameter $\alpha$ vanishes exactly: the leading $\alpha\theta^{2}/(1+\theta)^{2}$ term in (&lt;a href="#S5.E44" title="In Theorem 5.9 (Continuous-time Laplace expansion). ‣ 5.5 Exponential Approximation ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;44&lt;/span&gt;&lt;/a&gt;) disappears, leaving only higher-order contributions. This does not imply distributional proximity to $\operatorname{Exp}(1)\text{:}$ at the critical point $p=e^{-2}$ is a fixed constant (not tending to zero), so the exponential limit theorem does not apply.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S5.SS7" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="discretecontinuous-correspondence"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.7 &lt;/span&gt;Discrete–Continuous Correspondence&lt;/h3&gt;
&lt;div id="S5.SS7.p1" class="ltx_para"&gt;
&lt;p id="S5.SS7.p1.1" class="ltx_p"&gt;Table &lt;a href="#S5.T1" title="Table 1 ‣ 5.7 Discrete–Continuous Correspondence ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; summarizes the parallel between the discrete and continuous theories. Every structural feature—affine form, coefficient matching, DRP, perturbation identity, Laplace expansion, sharp rate—carries over. The sole qualitative difference lies in the characterization’s scope and the sharp-rate template.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="S5.T1" class="ltx_table"&gt;
&lt;table id="S5.T1.2" class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle"&gt;
&lt;tbody class="ltx_tbody"&gt;
&lt;tr id="S5.T1.2.1" class="ltx_tr"&gt;
&lt;th id="S5.T1.2.1.1" class="ltx_td ltx_th ltx_th_row ltx_border_tt" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;/th&gt;
&lt;td id="S5.T1.2.1.2" class="ltx_td ltx_align_left ltx_border_tt" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;span id="S5.T1.2.1.2.1" class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Discrete time&lt;/span&gt;&lt;/td&gt;
&lt;td id="S5.T1.2.1.3" class="ltx_td ltx_align_left ltx_border_tt" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;span id="S5.T1.2.1.3.1" class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Continuous time&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S5.T1.2.2" class="ltx_tr"&gt;
&lt;th id="S5.T1.2.2.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;em id="S5.T1.2.2.1.1" class="ltx_emph ltx_font_italic" style="font-size:90%;"&gt;Transform&lt;/em&gt;&lt;/th&gt;
&lt;td id="S5.T1.2.2.2" class="ltx_td ltx_align_left ltx_border_t" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;span id="S5.T1.2.2.2.1" class="ltx_text" style="font-size:90%;"&gt;PGF $G_{T}(w)=E[w^{T}]$&lt;/span&gt;&lt;/td&gt;
&lt;td id="S5.T1.2.2.3" class="ltx_td ltx_align_left ltx_border_t" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;span id="S5.T1.2.2.3.1" class="ltx_text" style="font-size:90%;"&gt;Laplace $\hat{f}_{T}(\lambda)=E[e^{-\lambda T}]$&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S5.T1.2.3" class="ltx_tr"&gt;
&lt;th id="S5.T1.2.3.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;em id="S5.T1.2.3.1.1" class="ltx_emph ltx_font_italic" style="font-size:90%;"&gt;Normalization point&lt;/em&gt;&lt;/th&gt;
&lt;td id="S5.T1.2.3.2" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$w=1$&lt;/td&gt;
&lt;td id="S5.T1.2.3.3" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$\lambda=0$&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S5.T1.2.4" class="ltx_tr"&gt;
&lt;th id="S5.T1.2.4.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;em id="S5.T1.2.4.1.1" class="ltx_emph ltx_font_italic" style="font-size:90%;"&gt;Shift&lt;/em&gt;&lt;/th&gt;
&lt;td id="S5.T1.2.4.2" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$u=ws$&lt;span id="S5.T1.2.4.2.1" class="ltx_text" style="font-size:90%;"&gt; (multiplicative)&lt;/span&gt;&lt;/td&gt;
&lt;td id="S5.T1.2.4.3" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$\sigma=\lambda+r$&lt;span id="S5.T1.2.4.3.1" class="ltx_text" style="font-size:90%;"&gt; (additive)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S5.T1.2.5" class="ltx_tr"&gt;
&lt;th id="S5.T1.2.5.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;em id="S5.T1.2.5.1.1" class="ltx_emph ltx_font_italic" style="font-size:90%;"&gt;Catastrophe parameter&lt;/em&gt;&lt;/th&gt;
&lt;td id="S5.T1.2.5.2" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$q\in(0,1)$&lt;/td&gt;
&lt;td id="S5.T1.2.5.3" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$r&amp;gt;0$&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S5.T1.2.6" class="ltx_tr"&gt;
&lt;th id="S5.T1.2.6.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;em id="S5.T1.2.6.1.1" class="ltx_emph ltx_font_italic" style="font-size:90%;"&gt;Success probability&lt;/em&gt;&lt;/th&gt;
&lt;td id="S5.T1.2.6.2" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$p=g(s)$&lt;/td&gt;
&lt;td id="S5.T1.2.6.3" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$p=\hat{f}_{0}(r)$&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S5.T1.2.7" class="ltx_tr"&gt;
&lt;th id="S5.T1.2.7.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;em id="S5.T1.2.7.1.1" class="ltx_emph ltx_font_italic" style="font-size:90%;"&gt;$E[T]$&lt;/em&gt;&lt;/th&gt;
&lt;td id="S5.T1.2.7.2" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$(1-p)/(qp)$&lt;/td&gt;
&lt;td id="S5.T1.2.7.3" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$(1-p)/(rp)$&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S5.T1.2.8" class="ltx_tr"&gt;
&lt;th id="S5.T1.2.8.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;em id="S5.T1.2.8.1.1" class="ltx_emph ltx_font_italic" style="font-size:90%;"&gt;Coefficient match&lt;/em&gt;&lt;/th&gt;
&lt;td id="S5.T1.2.8.2" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$\alpha_{N}(1)=\alpha_{D}(1)=q$&lt;/td&gt;
&lt;td id="S5.T1.2.8.3" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$\alpha_{N}(0)=\alpha_{D}(0)=r$&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S5.T1.2.9" class="ltx_tr"&gt;
&lt;th id="S5.T1.2.9.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;em id="S5.T1.2.9.1.1" class="ltx_emph ltx_font_italic" style="font-size:90%;"&gt;DRP ($k\geq 2$)&lt;/em&gt;&lt;/th&gt;
&lt;td id="S5.T1.2.9.2" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$\Delta_{k}=-ks^{k-1}D_{k-1}$&lt;/td&gt;
&lt;td id="S5.T1.2.9.3" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$\Delta_{k}=kD_{k-1}$&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S5.T1.2.10" class="ltx_tr"&gt;
&lt;th id="S5.T1.2.10.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;em id="S5.T1.2.10.1.1" class="ltx_emph ltx_font_italic" style="font-size:90%;"&gt;Perturbation $\alpha$&lt;/em&gt;&lt;/th&gt;
&lt;td id="S5.T1.2.10.2" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$s(p-qD_{1})/(1-p)$&lt;/td&gt;
&lt;td id="S5.T1.2.10.3" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$(p+rD_{1})/(1-p)$&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S5.T1.2.11" class="ltx_tr"&gt;
&lt;th id="S5.T1.2.11.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;em id="S5.T1.2.11.1.1" class="ltx_emph ltx_font_italic" style="font-size:90%;"&gt;Fundamental identity&lt;/em&gt;&lt;/th&gt;
&lt;td id="S5.T1.2.11.2" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$1+\alpha-\beta=0$&lt;/td&gt;
&lt;td id="S5.T1.2.11.3" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$1+\alpha-\beta=0$&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S5.T1.2.12" class="ltx_tr"&gt;
&lt;th id="S5.T1.2.12.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;em id="S5.T1.2.12.1.1" class="ltx_emph ltx_font_italic" style="font-size:90%;"&gt;Laplace expansion&lt;/em&gt;&lt;/th&gt;
&lt;td id="S5.T1.2.12.2" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$\alpha\theta^{2}/(1+\theta)^{2}+\text{h.o.t.}$&lt;/td&gt;
&lt;td id="S5.T1.2.12.3" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$\alpha\theta^{2}/(1+\theta)^{2}+\text{h.o.t.}$&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S5.T1.2.13" class="ltx_tr"&gt;
&lt;th id="S5.T1.2.13.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;em id="S5.T1.2.13.1.1" class="ltx_emph ltx_font_italic" style="font-size:90%;"&gt;Bridge Theorem&lt;/em&gt;&lt;/th&gt;
&lt;td id="S5.T1.2.13.2" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$d_{\mathrm{K}}\leq C_{1}p+2b/\mu$&lt;/td&gt;
&lt;td id="S5.T1.2.13.3" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$d_{\mathrm{K}}\leq C_{1}p+2b/\mu$&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S5.T1.2.14" class="ltx_tr"&gt;
&lt;th id="S5.T1.2.14.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;em id="S5.T1.2.14.1.1" class="ltx_emph ltx_font_italic" style="font-size:90%;"&gt;Sharp-rate template&lt;/em&gt;&lt;/th&gt;
&lt;td id="S5.T1.2.14.2" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$p+|\alpha|$&lt;/td&gt;
&lt;td id="S5.T1.2.14.3" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$|\alpha|$&lt;span id="S5.T1.2.14.3.1" class="ltx_text" style="font-size:90%;"&gt; (no lattice error)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S5.T1.2.15" class="ltx_tr"&gt;
&lt;th id="S5.T1.2.15.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;em id="S5.T1.2.15.1.1" class="ltx_emph ltx_font_italic" style="font-size:90%;"&gt;Characterizes&lt;/em&gt;&lt;/th&gt;
&lt;td id="S5.T1.2.15.2" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;span id="S5.T1.2.15.2.1" class="ltx_text" style="font-size:90%;"&gt;geometric tail&lt;/span&gt;&lt;/td&gt;
&lt;td id="S5.T1.2.15.3" class="ltx_td ltx_align_left" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;span id="S5.T1.2.15.3.1" class="ltx_text" style="font-size:90%;"&gt;Poisson (full memoryless)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S5.T1.2.16" class="ltx_tr"&gt;
&lt;th id="S5.T1.2.16.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;em id="S5.T1.2.16.1.1" class="ltx_emph ltx_font_italic" style="font-size:90%;"&gt;Gap&lt;/em&gt;&lt;/th&gt;
&lt;td id="S5.T1.2.16.2" class="ltx_td ltx_align_left ltx_border_bb" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;$h_{1}$&lt;span id="S5.T1.2.16.2.1" class="ltx_text" style="font-size:90%;"&gt; free&lt;/span&gt;&lt;/td&gt;
&lt;td id="S5.T1.2.16.3" class="ltx_td ltx_align_left ltx_border_bb" style="padding-top:1.15pt;padding-bottom:1.15pt;"&gt;&lt;span id="S5.T1.2.16.3.1" class="ltx_text" style="font-size:90%;"&gt;none&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;figcaption class="ltx_caption ltx_centering" style="font-size:90%;"&gt;&lt;span class="ltx_tag ltx_tag_table"&gt;Table 1: &lt;/span&gt;Discrete–continuous correspondence. The two theories share every structural feature. The characterization sharpens in continuous time (the geometric-tail gap closes, Remark &lt;a href="#S5.Thmtheorem8" title="Remark 5.8 (Why the geometric-tail gap closes). ‣ 5.4 Characterization: Affine Laplace Structure Is Poisson ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.8&lt;/span&gt;&lt;/a&gt;), and the sharp-rate template simplifies (the lattice error vanishes for continuous $T_{0}\text{,}$ Remark &lt;a href="#S5.Thmtheorem13" title="Remark 5.13 (Disappearance of the lattice error). ‣ 5.5 Exponential Approximation ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.13&lt;/span&gt;&lt;/a&gt;).&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S6" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="application-coupon-collector-with-reset"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;6 &lt;/span&gt;Application: Coupon Collector with Reset&lt;/h2&gt;
&lt;div id="S6.p1" class="ltx_para"&gt;
&lt;p id="S6.p1.1" class="ltx_p"&gt;The general theory of §§&lt;a href="#S2" title="2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;–&lt;a href="#S4" title="4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; applies to any base process $T_{0}\text{.}$ We now instantiate it to the coupon collector problem with reset, obtaining closed-form moments, a sharp Kolmogorov bound that closes the logarithmic gap, and a discontinuous phase transition in the limit law. The pattern throughout is: compute CCP-specific quantities ($p\text{,}$ $D_{1}\text{,}$ $D_{2}\text{,}$ $\alpha$), then substitute into general formulas. The sole exception is the lower bound in the sharp Kolmogorov estimate (§&lt;a href="#S6.SS4" title="6.4 Phase Transition and Sharp Kolmogorov Bound ‣ 6 Application: Coupon Collector with Reset ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6.4&lt;/span&gt;&lt;/a&gt;), which requires a product-structure argument specific to the CCP.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S6.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="model"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;6.1 &lt;/span&gt;Model&lt;/h3&gt;
&lt;div id="S6.SS1.p1" class="ltx_para"&gt;
&lt;p id="S6.SS1.p1.1" class="ltx_p"&gt;A deck contains $n+m$ coupon types: types $1,\ldots,n$ are &lt;em id="S6.SS1.p1.1.1" class="ltx_emph ltx_font_italic"&gt;standard&lt;/em&gt;, and types $n+1,\ldots,n+m$ are &lt;em id="S6.SS1.p1.1.2" class="ltx_emph ltx_font_italic"&gt;reset&lt;/em&gt;. At each step, one type is drawn uniformly at random with replacement. Standard draws accumulate; any reset draw erases all collected coupons. The game ends when all $n$ standard types have been collected. This is the framework of §&lt;a href="#S2.SS1" title="2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt; with $T_{0}$ the classical coupon collector completion time and&lt;/p&gt;
&lt;table id="S6.Ex50" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$q=\frac{m}{n+m},\qquad s=\frac{n}{n+m}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS1.p1.2" class="ltx_p"&gt;A closely related model was studied by &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib24" title="" class="ltx_ref"&gt;24&lt;/a&gt;]&lt;/cite&gt;, who derived expected values via Markov chain methods; our contribution is the distributional theory.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS1.p2" class="ltx_para"&gt;
&lt;p id="S6.SS1.p2.1" class="ltx_p"&gt;&lt;span id="S6.SS1.p2.1.1" class="ltx_text ltx_font_bold"&gt;Notation.&lt;/span&gt;  $C=\binom{n+m}{n}\text{;}$  $H=\sum_{j=m+1}^{n+m}1/j=H_{n+m}-H_{m}\text{;}$  $H^{(r)}=\sum_{j=m+1}^{n+m}1/j^{r}=H^{(r)}_{n+m}-H^{(r)}_{m}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S6.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="specialization-of-the-pgf-data"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;6.2 &lt;/span&gt;Specialization of the PGF Data&lt;/h3&gt;
&lt;div id="S6.SS2.p1" class="ltx_para"&gt;
&lt;p id="S6.SS2.p1.1" class="ltx_p"&gt;The classical CCP has $T_{0}=X_{1}+\cdots+X_{n}$ with $X_{k}\sim\operatorname{Geom}_{1}((n{-}k{+}1)/n)$ independent, giving&lt;/p&gt;
&lt;table id="S6.E47" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$g(z)=\prod_{k=1}^{n}\frac{(n{-}k{+}1)z/n}{1-(k{-}1)z/n}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(47)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS2.p1.2" class="ltx_p"&gt;The general theory requires three inputs: $p=g(s)\text{,}$ $D_{1}=g^{\prime}(s)\text{,}$ and $D_{2}=g^{\prime\prime}(s)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.Thmtheorem1" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S6.Thmtheorem1.2" class="ltx_text ltx_font_bold"&gt;Lemma 6.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S6.Thmtheorem1.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Success probability)&lt;span id="S6.Thmtheorem1.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S6.Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p id="S6.Thmtheorem1.p1.1" class="ltx_p"&gt;$p=g(s)=1/C=1/\binom{n+m}{n}$&lt;span id="S6.Thmtheorem1.p1.1.1" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S6.SS2.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S6.SS2.p2" class="ltx_para"&gt;
&lt;p id="S6.SS2.p2.1" class="ltx_p"&gt;&lt;em id="S6.SS2.p2.1.1" class="ltx_emph ltx_font_italic"&gt;Algebraic.&lt;/em&gt;&lt;span id="S6.SS2.p2.1.2" class="ltx_text"&gt;  At $z=s=n/(n+m)\text{,}$ each factor of (&lt;a href="#S6.E47" title="In 6.2 Specialization of the PGF Data ‣ 6 Application: Coupon Collector with Reset ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;47&lt;/span&gt;&lt;/a&gt;) evaluates to $(n{-}k{+}1)/(n{+}m{-}k{+}1)\text{.}$ The product telescopes: $\prod_{k=1}^{n}(n{-}k{+}1)/(n{+}m{-}k{+}1)=n!\,m!/(n{+}m)!=1/C\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS2.p3" class="ltx_para"&gt;
&lt;p id="S6.SS2.p3.1" class="ltx_p"&gt;&lt;em id="S6.SS2.p3.1.1" class="ltx_emph ltx_font_italic"&gt;Combinatorial.&lt;/em&gt;&lt;span id="S6.SS2.p3.1.2" class="ltx_text"&gt;  An attempt succeeds if and only if all $n$ standard types appear before any reset type in the first-appearance permutation. By symmetry of i.i.d. uniform draws, this probability is $n!\,m!/(n+m)!=1/C\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S6.SS2.p4" class="ltx_para"&gt;
&lt;p id="S6.SS2.p4.1" class="ltx_p"&gt;The derivatives are computed by logarithmic differentiation, exploiting the product structure $\log g=\sum_{k=1}^{n}\log G_{X_{k}}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.Thmtheorem2" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S6.Thmtheorem2.2" class="ltx_text ltx_font_bold"&gt;Lemma 6.2&lt;/span&gt;&lt;/span&gt;&lt;span id="S6.Thmtheorem2.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(PGF derivatives at $z=s$)&lt;span id="S6.Thmtheorem2.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S6.Thmtheorem2.p1" class="ltx_para"&gt;
&lt;table id="S6.E48" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$D_{1}=g^{\prime}(s)=\frac{(n+m)^{2}\,H}{n\,C},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(48)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;table id="S6.E49" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$D_{2}=g^{\prime\prime}(s)=\frac{(n+m)^{3}}{n^{2}\,C}\bigl((n+m)(H^{2}+H^{(2)})-2H\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(49)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.Thmtheorem2.p1.1" class="ltx_p"&gt;&lt;span id="S6.Thmtheorem2.p1.1.1" class="ltx_text ltx_font_italic"&gt;More generally, the $r$-th logarithmic derivative of $g$ at $z=s$ is a polynomial in $H,H^{(2)},\ldots,H^{(r)}$ with rational coefficients in $(n,m)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S6.SS2.3" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof sketch.&lt;/h6&gt;
&lt;div id="S6.SS2.p5" class="ltx_para"&gt;
&lt;p id="S6.SS2.p5.1" class="ltx_p"&gt;&lt;span id="S6.SS2.p5.1.1" class="ltx_text"&gt;Write $r_{k}(z)=G^{\prime}_{X_{k}}(z)/G_{X_{k}}(z)=1/(z\varphi_{k}(z))$ with $\varphi_{k}(z)=1-(k{-}1)z/n\text{.}$ At $z=s\text{:}$ $\varphi_{k}(s)=(n{+}m{-}k{+}1)/(n{+}m)\text{,}$ so $r_{k}(s)=(n{+}m)^{2}/(n(n{+}m{-}k{+}1))\text{.}$ Setting $j=n{+}m{-}k{+}1\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex51" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(\log g)^{\prime}(s)=\sum_{k=1}^{n}r_{k}(s)=\frac{(n+m)^{2}}{n}\sum_{j=m+1}^{n+m}\frac{1}{j}=\frac{(n+m)^{2}\,H}{n}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS2.p5.2" class="ltx_p"&gt;&lt;span id="S6.SS2.p5.2.1" class="ltx_text"&gt;Then $D_{1}=g(s)\cdot(\log g)^{\prime}(s)\text{.}$ The second derivative follows from $g^{\prime\prime}=g[(\log g)^{\prime\prime}+((\log g)^{\prime})^{2}]$ and an analogous computation of $(\log g)^{\prime\prime}(s)\text{,}$ which introduces $H^{(2)}$ via the partial fractions of $r^{\prime}_{k}(s)\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S6.SS2.p6" class="ltx_para"&gt;
&lt;p id="S6.SS2.p6.1" class="ltx_p"&gt;The pattern is transparent: the $r$-th logarithmic derivative introduces $H^{(r)}$ because each differentiation of $r_{k}(z)=1/(z\varphi_{k}(z))$ adds one power of $1/\varphi_{k}(s)=(n{+}m)/j\text{,}$ and summing over $k$ produces $\sum j^{-r}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S6.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="moments"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;6.3 &lt;/span&gt;Moments&lt;/h3&gt;
&lt;div id="S6.SS3.p1" class="ltx_para"&gt;
&lt;p id="S6.SS3.p1.1" class="ltx_p"&gt;Substituting the CCP data $(p,q,D_{1})$ into the general formulas of §&lt;a href="#S2.SS2" title="2.2 Affine Structure and the Derivative Reduction Principle ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt; gives closed-form first two moments:&lt;/p&gt;
&lt;table id="S6.E50" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$E[T]=\frac{n+m}{m}(C-1),\qquad\operatorname{Var}(T)=\frac{n+m}{m^{2}}\bigl((C-1)((n{+}m)C+n)-2m(n{+}m)CH\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(50)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS3.p1.2" class="ltx_p"&gt;For $m=1\text{:}$ $E[T]=n(n+1)\text{.}$ For fixed $m$ as $n\to\infty\text{:}$ $E[T]\sim n^{m+1}/(m\cdot m!)\text{.}$ The variance involves both $p=1/C$ and $D_{1}$—but not $D_{2}$—exactly as the DRP guarantees. Higher moments follow analogously from the recursion (&lt;a href="#S2.E15" title="In Corollary 2.8 (Moment recursion). ‣ 2.3 Moment Recursion and the Complexity Staircase ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;15&lt;/span&gt;&lt;/a&gt;). In particular, the third centered moment is the first level at which $D_{2}\text{,}$ and hence $H^{(2)}\text{,}$ enters; more generally, the $k$-th centered moment first involves the new harmonic statistic $H^{(k-1)}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS3.p2" class="ltx_para"&gt;
&lt;p id="S6.SS3.p2.1" class="ltx_p"&gt;The staircase of §&lt;a href="#S2.SS3" title="2.3 Moment Recursion and the Complexity Staircase ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt; takes a particularly illuminating form:&lt;/p&gt;
&lt;table id="S6.SS3.p2.2" class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle"&gt;
&lt;thead class="ltx_thead"&gt;
&lt;tr id="S6.SS3.p2.2.1" class="ltx_tr"&gt;
&lt;th id="S6.SS3.p2.2.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_border_tt"&gt;&lt;span id="S6.SS3.p2.2.1.1.1" class="ltx_text ltx_font_bold"&gt;Moment of $T$&lt;/span&gt;&lt;/th&gt;
&lt;th id="S6.SS3.p2.2.1.2" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt"&gt;&lt;span id="S6.SS3.p2.2.1.2.1" class="ltx_text ltx_font_bold"&gt;New input (DRP)&lt;/span&gt;&lt;/th&gt;
&lt;th id="S6.SS3.p2.2.1.3" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt"&gt;&lt;span id="S6.SS3.p2.2.1.3.1" class="ltx_text ltx_font_bold"&gt;CCP realization&lt;/span&gt;&lt;/th&gt;
&lt;th id="S6.SS3.p2.2.1.4" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt"&gt;&lt;span id="S6.SS3.p2.2.1.4.1" class="ltx_text ltx_font_bold"&gt;Origin&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody class="ltx_tbody"&gt;
&lt;tr id="S6.SS3.p2.2.2" class="ltx_tr"&gt;
&lt;td id="S6.SS3.p2.2.2.1" class="ltx_td ltx_align_left ltx_border_t" style="padding-bottom: 2.0pt;"&gt;$E[T]$&lt;/td&gt;
&lt;td id="S6.SS3.p2.2.2.2" class="ltx_td ltx_align_center ltx_border_t" style="padding-bottom: 2.0pt;"&gt;$g(s)$&lt;/td&gt;
&lt;td id="S6.SS3.p2.2.2.3" class="ltx_td ltx_align_center ltx_border_t" style="padding-bottom: 2.0pt;"&gt;$C=\binom{n+m}{n}$&lt;/td&gt;
&lt;td id="S6.SS3.p2.2.2.4" class="ltx_td ltx_align_center ltx_border_t" style="padding-bottom: 2.0pt;"&gt;product telescope&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S6.SS3.p2.2.3" class="ltx_tr"&gt;
&lt;td id="S6.SS3.p2.2.3.1" class="ltx_td ltx_align_left" style="padding-bottom: 2.0pt;"&gt;$\operatorname{Var}(T)$&lt;/td&gt;
&lt;td id="S6.SS3.p2.2.3.2" class="ltx_td ltx_align_center" style="padding-bottom: 2.0pt;"&gt;$+g^{\prime}(s)$&lt;/td&gt;
&lt;td id="S6.SS3.p2.2.3.3" class="ltx_td ltx_align_center" style="padding-bottom: 2.0pt;"&gt;$+H=\sum 1/j$&lt;/td&gt;
&lt;td id="S6.SS3.p2.2.3.4" class="ltx_td ltx_align_center" style="padding-bottom: 2.0pt;"&gt;1st log-derivative&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S6.SS3.p2.2.4" class="ltx_tr"&gt;
&lt;td id="S6.SS3.p2.2.4.1" class="ltx_td ltx_align_left" style="padding-bottom: 2.0pt;"&gt;$\mu_{3}(T)$&lt;/td&gt;
&lt;td id="S6.SS3.p2.2.4.2" class="ltx_td ltx_align_center" style="padding-bottom: 2.0pt;"&gt;$+g^{\prime\prime}(s)$&lt;/td&gt;
&lt;td id="S6.SS3.p2.2.4.3" class="ltx_td ltx_align_center" style="padding-bottom: 2.0pt;"&gt;$+H^{(2)}=\sum 1/j^{2}$&lt;/td&gt;
&lt;td id="S6.SS3.p2.2.4.4" class="ltx_td ltx_align_center" style="padding-bottom: 2.0pt;"&gt;2nd log-derivative&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S6.SS3.p2.2.5" class="ltx_tr"&gt;
&lt;td id="S6.SS3.p2.2.5.1" class="ltx_td ltx_align_left ltx_border_bb"&gt;$\mu_{k}(T)$&lt;/td&gt;
&lt;td id="S6.SS3.p2.2.5.2" class="ltx_td ltx_align_center ltx_border_bb"&gt;$+g^{(k-1)}(s)$&lt;/td&gt;
&lt;td id="S6.SS3.p2.2.5.3" class="ltx_td ltx_align_center ltx_border_bb"&gt;$+H^{(k-1)}=\sum 1/j^{k-1}$&lt;/td&gt;
&lt;td id="S6.SS3.p2.2.5.4" class="ltx_td ltx_align_center ltx_border_bb"&gt;$(k{-}1)$-th log-deriv.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS3.p2.3" class="ltx_p"&gt;Each row adds exactly one new finite harmonic sum: $H^{(k-1)}=\sum_{j=m+1}^{n+m}j^{-(k-1)}\text{.}$ The CCP thus provides the sharpest illustration of the harmonic complexity staircase—a feature absent in base processes with rational PGF structure (§&lt;a href="#S7" title="7 Application: Multi-Phase Task with Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S6.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="phase-transition-and-sharp-kolmogorov-bound"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;6.4 &lt;/span&gt;Phase Transition and Sharp Kolmogorov Bound&lt;/h3&gt;
&lt;div id="S6.SS4.p1" class="ltx_para"&gt;
&lt;p id="S6.SS4.p1.1" class="ltx_p"&gt;The CCP perturbation parameter, obtained by substituting $p=1/C$ and $qD_{1}=m(n+m)H/(nC)$ into Definition &lt;a href="#S4.Thmtheorem1" title="Definition 4.1 (Perturbation parameters). ‣ 4.1 The Perturbation Parameter ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.1&lt;/span&gt;&lt;/a&gt;, is&lt;/p&gt;
&lt;table id="S6.E51" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\alpha=\frac{s-mH}{C-1},\qquad|\alpha|\sim\frac{m!\,m\ln n}{n^{m}}\quad\text{as }n\to\infty.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(51)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS4.p1.2" class="ltx_p"&gt;Since $p=1/C\sim m!/n^{m}$ and $|\alpha|\sim m!\,m\ln n/n^{m}\text{,}$ the ratio $p/|\alpha|\sim 1/(m\ln n)\to 0\text{:}$ the perturbation term dominates.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS4.p2" class="ltx_para ltx_noindent"&gt;
&lt;p id="S6.SS4.p2.1" class="ltx_p"&gt;&lt;span id="S6.SS4.p2.1.1" class="ltx_text ltx_font_bold"&gt;The Gumbel-to-Exponential phase transition.&lt;/span&gt; 
For the classical CCP ($m=0$), the limit law is Gumbel: $(T_{0}-n\ln n)/n\xrightarrow{d}\text{Gumbel}$ (&lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib13" title="" class="ltx_ref"&gt;13&lt;/a&gt;, &lt;a href="#bib.bib3" title="" class="ltx_ref"&gt;3&lt;/a&gt;]&lt;/cite&gt;). For $m\geq 1\text{,}$ the general theory (applied via the Bridge Theorem, Theorem &lt;a href="#S4.Thmtheorem13" title="Theorem 4.13 (Bridge Theorem). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.13&lt;/span&gt;&lt;/a&gt;) gives $T/E[T]\xrightarrow{d}\operatorname{Exp}(1)\text{.}$ The transition at $m=0\to m\geq 1$ is discontinuous:&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS4.p3" class="ltx_para"&gt;
&lt;table id="S6.SS4.p3.1" class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle"&gt;
&lt;tbody class="ltx_tbody"&gt;
&lt;tr id="S6.SS4.p3.1.1" class="ltx_tr"&gt;
&lt;th id="S6.SS4.p3.1.1.1" class="ltx_td ltx_th ltx_th_row ltx_border_tt" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;/th&gt;
&lt;td id="S6.SS4.p3.1.1.2" class="ltx_td ltx_align_left ltx_border_tt" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S6.SS4.p3.1.1.2.1" class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Classical ($m=0$)&lt;/span&gt;&lt;/td&gt;
&lt;td id="S6.SS4.p3.1.1.3" class="ltx_td ltx_align_left ltx_border_tt" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S6.SS4.p3.1.1.3.1" class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Reset ($m\geq 1$)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S6.SS4.p3.1.2" class="ltx_tr"&gt;
&lt;th id="S6.SS4.p3.1.2.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S6.SS4.p3.1.2.1.1" class="ltx_text" style="font-size:90%;"&gt;Scale&lt;/span&gt;&lt;/th&gt;
&lt;td id="S6.SS4.p3.1.2.2" class="ltx_td ltx_align_left ltx_border_t" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$\Theta(n\log n)$&lt;/td&gt;
&lt;td id="S6.SS4.p3.1.2.3" class="ltx_td ltx_align_left ltx_border_t" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$\sim n^{m+1}/(m\cdot m!)$&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S6.SS4.p3.1.3" class="ltx_tr"&gt;
&lt;th id="S6.SS4.p3.1.3.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S6.SS4.p3.1.3.1.1" class="ltx_text" style="font-size:90%;"&gt;Fluctuations&lt;/span&gt;&lt;/th&gt;
&lt;td id="S6.SS4.p3.1.3.2" class="ltx_td ltx_align_left" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$\Theta(n)\ll E[T]$&lt;/td&gt;
&lt;td id="S6.SS4.p3.1.3.3" class="ltx_td ltx_align_left" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$\Theta(E[T])$&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S6.SS4.p3.1.4" class="ltx_tr"&gt;
&lt;th id="S6.SS4.p3.1.4.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S6.SS4.p3.1.4.1.1" class="ltx_text" style="font-size:90%;"&gt;Coefficient of variation&lt;/span&gt;&lt;/th&gt;
&lt;td id="S6.SS4.p3.1.4.2" class="ltx_td ltx_align_left" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$\to 0$&lt;/td&gt;
&lt;td id="S6.SS4.p3.1.4.3" class="ltx_td ltx_align_left" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$\to 1$&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S6.SS4.p3.1.5" class="ltx_tr"&gt;
&lt;th id="S6.SS4.p3.1.5.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S6.SS4.p3.1.5.1.1" class="ltx_text" style="font-size:90%;"&gt;Limit law&lt;/span&gt;&lt;/th&gt;
&lt;td id="S6.SS4.p3.1.5.2" class="ltx_td ltx_align_left" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S6.SS4.p3.1.5.2.1" class="ltx_text" style="font-size:90%;"&gt;Gumbel&lt;/span&gt;&lt;/td&gt;
&lt;td id="S6.SS4.p3.1.5.3" class="ltx_td ltx_align_left" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S6.SS4.p3.1.5.3.1" class="ltx_text" style="font-size:90%;"&gt;Exponential&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S6.SS4.p3.1.6" class="ltx_tr"&gt;
&lt;th id="S6.SS4.p3.1.6.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S6.SS4.p3.1.6.1.1" class="ltx_text" style="font-size:90%;"&gt;Mechanism&lt;/span&gt;&lt;/th&gt;
&lt;td id="S6.SS4.p3.1.6.2" class="ltx_td ltx_align_left ltx_border_bb" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S6.SS4.p3.1.6.2.1" class="ltx_text" style="font-size:90%;"&gt;last coupon (extreme value)&lt;/span&gt;&lt;/td&gt;
&lt;td id="S6.SS4.p3.1.6.3" class="ltx_td ltx_align_left ltx_border_bb" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S6.SS4.p3.1.6.3.1" class="ltx_text" style="font-size:90%;"&gt;lucky streak (geometric)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S6.SS4.p4" class="ltx_para"&gt;
&lt;p id="S6.SS4.p4.1" class="ltx_p"&gt;In the classical CCP, the bottleneck is the last missing coupon—an extreme value problem yielding the Gumbel law. A single reset coupon destroys this mechanism: completion now requires a lucky streak (an attempt succeeding without catastrophe), and the number of attempts is geometric. The geometric waiting time’s memorylessness propagates to $T/E[T]\to\operatorname{Exp}(1)\text{,}$ making the completion time fundamentally unpredictable.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.Thmtheorem3" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S6.Thmtheorem3.2" class="ltx_text ltx_font_italic"&gt;Remark 6.3&lt;/span&gt;&lt;/span&gt;&lt;span id="S6.Thmtheorem3.3" class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;(CCP convergence via the Bridge Theorem)&lt;span id="S6.Thmtheorem3.4" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S6.Thmtheorem3.p1" class="ltx_para"&gt;
&lt;p id="S6.Thmtheorem3.p1.1" class="ltx_p"&gt;The CCP has $q=m/(n+m)\to 0$ as $n\to\infty\text{,}$ so Corollary &lt;a href="#S4.Thmtheorem6" title="Corollary 4.6 (Exponential limit). ‣ 4.2 The Laplace Expansion ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.6&lt;/span&gt;&lt;/a&gt; (which assumes fixed $q$) does not apply directly. Instead, CCP convergence follows from the Bridge Theorem (Theorem &lt;a href="#S4.Thmtheorem13" title="Theorem 4.13 (Bridge Theorem). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.13&lt;/span&gt;&lt;/a&gt;): the conditions $p\to 0$ and uniform boundedness of moment ratios of $A$ are verified below in the proof of Theorem &lt;a href="#S6.Thmtheorem4" title="Theorem 6.4 (CCP sharp bound). ‣ 6.4 Phase Transition and Sharp Kolmogorov Bound ‣ 6 Application: Coupon Collector with Reset ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6.4&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S6.Thmtheorem4" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S6.Thmtheorem4.2" class="ltx_text ltx_font_bold"&gt;Theorem 6.4&lt;/span&gt;&lt;/span&gt;&lt;span id="S6.Thmtheorem4.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(CCP sharp bound)&lt;span id="S6.Thmtheorem4.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S6.Thmtheorem4.p1" class="ltx_para"&gt;
&lt;p id="S6.Thmtheorem4.p1.1" class="ltx_p"&gt;&lt;span id="S6.Thmtheorem4.p1.1.1" class="ltx_text ltx_font_italic"&gt;For the coupon collector with $n$ standard and $m\geq 1$ reset coupons, $m$ fixed, $n\to\infty\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.E52" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{\mathrm{K}}\!\left(\frac{T}{E[T]},\,\operatorname{Exp}(1)\right)\in\bigl[1-o(1),\;2+o(1)\bigr]\cdot|\alpha|.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(52)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S6.SS4.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of the upper bound.&lt;/h6&gt;
&lt;div id="S6.SS4.p5" class="ltx_para"&gt;
&lt;p id="S6.SS4.p5.1" class="ltx_p"&gt;&lt;span id="S6.SS4.p5.1.1" class="ltx_text"&gt;To apply the Bridge Theorem (Theorem &lt;a href="#S4.Thmtheorem13" title="Theorem 4.13 (Bridge Theorem). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.13&lt;/span&gt;&lt;/a&gt;), it suffices to show
that the moment ratios
$\rho_{j}:=\frac{E[A^{j}]}{E[A]^{j}},j=2,3\text{,}$ are bounded uniformly in $n$ for each fixed $m\geq 1\text{.}$ We first bound the numerator. By Lemma &lt;a href="#S4.Thmtheorem8" title="Lemma 4.8 (Failed-attempt tail bound). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.8&lt;/span&gt;&lt;/a&gt;,
$P(A\geq t)\leq s^{t-1},t\geq 1\text{.}$
Hence, by the tail-sum formula,&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex52" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$E[A^{k}]=\sum_{t\geq 1}\bigl(t^{k}-(t-1)^{k}\bigr)P(A\geq t)\leq k\sum_{t\geq 1}t^{k-1}s^{t-1}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS4.p5.2" class="ltx_p"&gt;&lt;span id="S6.SS4.p5.2.1" class="ltx_text"&gt;Since $s=1-q\leq e^{-q}\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex53" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{t\geq 1}t^{k-1}s^{t-1}\leq 2\sum_{t\geq 1}t^{k-1}e^{-qt}\leq C_{k}q^{-k},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS4.p5.3" class="ltx_p"&gt;&lt;span id="S6.SS4.p5.3.1" class="ltx_text"&gt;for a constant $C_{k}$ depending only on $k\text{.}$ Therefore, $E[A^{k}]\leq C_{k}q^{-k}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS4.p6" class="ltx_para"&gt;
&lt;p id="S6.SS4.p6.1" class="ltx_p"&gt;&lt;span id="S6.SS4.p6.1.1" class="ltx_text"&gt;For the lower bound on $E[A]\text{,}$ use the explicit failed-attempt law
$P(A=j)=\frac{q\,s^{j-1}P(T_{0}&amp;gt;j)}{1-p},j\geq 1\text{.}$
In the CCP, $T_{0}\geq n$ almost surely, so $P(T_{0}&amp;gt;j)=1$ for $1\leq j\leq n-1\text{.}$
Hence&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex54" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$E[A]=\frac{1}{1-p}\sum_{j\geq 1}jqs^{j-1}P(T_{0}&amp;gt;j)\geq\sum_{j=1}^{n-1}jqs^{j-1}=\frac{1-ns^{\,n-1}+(n-1)s^{n}}{q}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS4.p6.2" class="ltx_p"&gt;&lt;span id="S6.SS4.p6.2.1" class="ltx_text"&gt;Since $q=m/(n+m)$ and $s=n/(n+m)\text{,}$ for each fixed $m\geq 1\text{,}$
$1-ns^{\,n-1}+(n-1)s^{n}\to 1-(m+1)e^{-m}&amp;gt;0\text{,}$
so there exists $c_{m}&amp;gt;0$ such that
$E[A]\geq\frac{c_{m}}{q}$ for all sufficiently large $n\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS4.p7" class="ltx_para"&gt;
&lt;p id="S6.SS4.p7.1" class="ltx_p"&gt;&lt;span id="S6.SS4.p7.1.1" class="ltx_text"&gt;Combining the two estimates gives&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex55" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{E[A^{k}]}{E[A]^{k}}\leq\frac{C_{k}q^{-k}}{(c_{m}q^{-1})^{k}}=\frac{C_{k}}{c_{m}^{k}}=O_{m}(1).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS4.p7.2" class="ltx_p"&gt;&lt;span id="S6.SS4.p7.2.1" class="ltx_text"&gt;Hence $\rho_{2},\rho_{3}=O_{m}(1)\text{,}$ and Brown’s constant in
Theorem &lt;a href="#S4.Thmtheorem13" title="Theorem 4.13 (Bridge Theorem). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.13&lt;/span&gt;&lt;/a&gt; satisfies $C_{1}=O_{m}(1)\text{.}$ Thus, from (&lt;a href="#S6.E51" title="In 6.4 Phase Transition and Sharp Kolmogorov Bound ‣ 6 Application: Coupon Collector with Reset ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;51&lt;/span&gt;&lt;/a&gt;) and Proposition &lt;a href="#S4.Thmtheorem2" title="Proposition 4.2 (Properties of the perturbation parameters). ‣ 4.1 The Perturbation Parameter ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt; (&lt;a href="#S4.I2.i2" title="item b ‣ Proposition 4.2 (Properties of the perturbation parameters). ‣ 4.1 The Perturbation Parameter ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;b&lt;/span&gt;&lt;/a&gt;): $b/\mu=\frac{mH}{C-1}=|\alpha|+\frac{s}{C-1}\text{,}$ and $\frac{s}{C-1}=O(p)\text{.}$ Finally, $d_{\mathrm{K}}\leq O_{m}(p)+2|\alpha|+O(p)=(2+o(1))|\alpha|\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S6.SS4.3" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of the lower bound.&lt;/h6&gt;
&lt;div id="S6.SS4.p8" class="ltx_para"&gt;
&lt;p id="S6.SS4.p8.1" class="ltx_p"&gt;&lt;span id="S6.SS4.p8.1.1" class="ltx_text"&gt;This is the one point where CCP-specific structure goes beyond substitution into general formulas. Choose $\theta=\theta_{n}=(\ln n)^{1/2}$ and set $w=e^{-\theta/\mu}\text{,}$ $u=ws\text{,}$ $\epsilon=\theta/\mu\text{.}$ By (&lt;a href="#S4.E33" title="In Proof of the lower bound. ‣ 4.4 The Sharp Two-Sided Bound ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;33&lt;/span&gt;&lt;/a&gt;), $d_{\mathrm{K}}\geq|G_{T}(w)-1/(1+\theta)|\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS4.p9" class="ltx_para"&gt;
&lt;p id="S6.SS4.p9.1" class="ltx_p"&gt;&lt;em id="S6.SS4.p9.1.1" class="ltx_emph ltx_font_italic"&gt;Step 1: PGF reduction.&lt;/em&gt;&lt;span id="S6.SS4.p9.1.2" class="ltx_text"&gt; 
From (&lt;a href="#S2.E9" title="In Theorem 2.2 (PGF formula). ‣ 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;9&lt;/span&gt;&lt;/a&gt;), setting $c=g(u)/p\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex56" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$G_{T}(w)=\frac{c+O_{m}(\theta p)}{c+\theta+O_{m}(\theta p)}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS4.p9.2" class="ltx_p"&gt;&lt;span id="S6.SS4.p9.2.1" class="ltx_text"&gt;Hence $G_{T}(w)-1/(1+\theta)=(c-1)\theta/((c+\theta)(1+\theta))+O_{m}(\theta p)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS4.p10" class="ltx_para"&gt;
&lt;p id="S6.SS4.p10.1" class="ltx_p"&gt;&lt;em id="S6.SS4.p10.1.1" class="ltx_emph ltx_font_italic"&gt;Step 2: Product-structure evaluation of $\log c\text{.}$&lt;/em&gt;&lt;span id="S6.SS4.p10.1.2" class="ltx_text"&gt; 
The product structure $g=\prod_{k=1}^{n}G_{X_{k}}$ gives&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex57" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log c=\sum_{k=1}^{n}\log(G_{X_{k}}(u)/G_{X_{k}}(s)).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS4.p10.2" class="ltx_p"&gt;&lt;span id="S6.SS4.p10.2.1" class="ltx_text"&gt;Each ratio $G_{X_{k}}(u)/G_{X_{k}}(s)$ expands as&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex58" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{G_{X_{k}}(u)}{G_{X_{k}}(s)}=\frac{w(1-a_{k})}{1-a_{k}w}=\frac{1-\delta}{1+x_{k}},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS4.p10.3" class="ltx_p"&gt;&lt;span id="S6.SS4.p10.3.1" class="ltx_text"&gt;where $x_{k}=a_{k}\delta/(1-a_{k})$ with $a_{k}=(k{-}1)/(n{+}m)$ and $\delta=1-w\text{.}$ Since $\sup_{k}x_{k}=O_{m}(\sqrt{\ln n}/n^{m})\to 0\text{,}$ the expansion $\log(1+x_{k})=x_{k}+O(x_{k}^{2})$ is uniformly valid. Summing and using the identity $\sum_{k=1}^{n}a_{k}/(1-a_{k})=(n+m)H-n\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex59" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log c=-\delta(n+m)H+O(\delta^{2}S_{2}),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS4.p10.4" class="ltx_p"&gt;&lt;span id="S6.SS4.p10.4.1" class="ltx_text"&gt;where $S_{2}=\sum_{k=2}^{n}a_{k}^{2}/(1-a_{k})^{2}=O_{m}(n^{2})\text{.}$ Converting $\delta(n+m)H$ to $\theta|\alpha|(1+o(1))$ and verifying $\delta^{2}S_{2}=o(\theta|\alpha|)\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex60" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log c=-\theta|\alpha|(1+o(1)).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS4.p10.5" class="ltx_p"&gt;&lt;span id="S6.SS4.p10.5.1" class="ltx_text"&gt;Since $\theta|\alpha|\to 0\text{,}$ this gives $c=1-\theta|\alpha|(1+o(1))\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS4.p11" class="ltx_para"&gt;
&lt;p id="S6.SS4.p11.1" class="ltx_p"&gt;&lt;em id="S6.SS4.p11.1.1" class="ltx_emph ltx_font_italic"&gt;Step 3: Assembly.&lt;/em&gt;&lt;span id="S6.SS4.p11.1.2" class="ltx_text"&gt; 
$(c-1)\theta/((c+\theta)(1+\theta))=-(1+o(1))\theta^{2}|\alpha|/(1+\theta)^{2}\text{,}$ and the correction $O_{m}(\theta p)=o(|\alpha|)\text{.}$ Hence $d_{\mathrm{K}}\geq(1+o(1))\theta^{2}|\alpha|/(1+\theta)^{2}=(1-o(1))|\alpha|\text{,}$ using $\theta^{2}/(1+\theta)^{2}=1-O(1/\sqrt{\ln n})\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S7" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="application-multi-phase-task-with-catastrophe"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;7 &lt;/span&gt;Application: Multi-Phase Task with Catastrophe&lt;/h2&gt;
&lt;div id="S7.p1" class="ltx_para"&gt;
&lt;p id="S7.p1.1" class="ltx_p"&gt;The CCP of §&lt;a href="#S6" title="6 Application: Coupon Collector with Reset ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt; features a base PGF that is a product of $n$ distinct Möbius factors, producing a &lt;em id="S7.p1.1.1" class="ltx_emph ltx_font_italic"&gt;harmonic complexity staircase&lt;/em&gt; whose successive levels introduce new finite harmonic sums $H^{(r)}\text{.}$ We now present a structurally contrasting application: a base process whose PGF is a &lt;em id="S7.p1.1.2" class="ltx_emph ltx_font_italic"&gt;power&lt;/em&gt; of a single Möbius factor, yielding a purely &lt;em id="S7.p1.1.3" class="ltx_emph ltx_font_italic"&gt;algebraic&lt;/em&gt; staircase. The DRP applies identically in both cases; the difference lies entirely in what it saves.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S7.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="model-and-the-algebraic-staircase"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;7.1 &lt;/span&gt;Model and the Algebraic Staircase&lt;/h3&gt;
&lt;div id="S7.SS1.p1" class="ltx_para"&gt;
&lt;p id="S7.SS1.p1.1" class="ltx_p"&gt;A task consists of $r\geq 2$ sequential phases, each requiring $\operatorname{Geom}_{1}(\pi)$ steps independently. The base completion time is $T_{0}=X_{1}+\cdots+X_{r}\text{,}$ $X_{i}\stackrel{{\scriptstyle\text{i.i.d.}}}{{\sim}}\operatorname{Geom}_{1}(\pi)\text{,}$ with PGF&lt;/p&gt;
&lt;table id="S7.E53" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$g(z)=\left[\frac{\pi z}{1-(1-\pi)z}\right]^{\!r}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(53)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.SS1.p1.2" class="ltx_p"&gt;Catastrophe at each step (probability $q\text{,}$ independent) destroys all accumulated progress, resetting the phase counter to zero. Define $\sigma=1-(1-\pi)s=\pi+q(1-\pi)$ and $\rho=\pi s/\sigma\text{.}$ Then&lt;/p&gt;
&lt;table id="S7.E54" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$p=g(s)=\rho^{r},\qquad E[T]=\frac{1-\rho^{r}}{q\rho^{r}},\qquad D_{1}=g^{\prime}(s)=\frac{r\rho^{r}}{s\sigma},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(54)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.SS1.p1.3" class="ltx_p"&gt;and the variance, obtained from (&lt;a href="#S2.E17" title="In Example 2.9 (First two moments). ‣ 2.3 Moment Recursion and the Complexity Staircase ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;17&lt;/span&gt;&lt;/a&gt;), depends on $p$ and $D_{1}$ but not on $D_{2}$—exactly as the DRP guarantees.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.SS1.p2" class="ltx_para"&gt;
&lt;p id="S7.SS1.p2.1" class="ltx_p"&gt;The key structural feature is that $\log g=r\log f$ with $f(z)=\pi z/(1-(1-\pi)z)\text{,}$ so every logarithmic derivative&lt;/p&gt;
&lt;table id="S7.E55" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(\log g)^{(k)}(s)=r(k-1)!\left[\frac{(-1)^{k-1}}{s^{k}}+\frac{(1-\pi)^{k}}{\sigma^{k}}\right]$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(55)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.SS1.p2.2" class="ltx_p"&gt;is a &lt;em id="S7.SS1.p2.2.1" class="ltx_emph ltx_font_italic"&gt;rational function&lt;/em&gt; of $(s,\pi,r)$—no new generalized harmonic statistic appears at any level. Displayed alongside the CCP realization:&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.SS1.p3" class="ltx_para"&gt;
&lt;table id="S7.SS1.p3.1" class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle"&gt;
&lt;thead class="ltx_thead"&gt;
&lt;tr id="S7.SS1.p3.1.1" class="ltx_tr"&gt;
&lt;th id="S7.SS1.p3.1.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_th_row ltx_border_tt" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S7.SS1.p3.1.1.1.1" class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Moment of $T$&lt;/span&gt;&lt;/th&gt;
&lt;th id="S7.SS1.p3.1.1.2" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S7.SS1.p3.1.1.2.1" class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;New input (DRP)&lt;/span&gt;&lt;/th&gt;
&lt;th id="S7.SS1.p3.1.1.3" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S7.SS1.p3.1.1.3.1" class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;CCP realization&lt;/span&gt;&lt;/th&gt;
&lt;th id="S7.SS1.p3.1.1.4" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S7.SS1.p3.1.1.4.1" class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Multi-phase realization&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody class="ltx_tbody"&gt;
&lt;tr id="S7.SS1.p3.1.2" class="ltx_tr"&gt;
&lt;th id="S7.SS1.p3.1.2.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t" style="padding-bottom: 2.0pt;padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$E[T]$&lt;/th&gt;
&lt;td id="S7.SS1.p3.1.2.2" class="ltx_td ltx_align_center ltx_border_t" style="padding-bottom: 2.0pt;padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$g(s)$&lt;/td&gt;
&lt;td id="S7.SS1.p3.1.2.3" class="ltx_td ltx_align_center ltx_border_t" style="padding-bottom: 2.0pt;padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$C=\binom{n+m}{n}$&lt;/td&gt;
&lt;td id="S7.SS1.p3.1.2.4" class="ltx_td ltx_align_center ltx_border_t" style="padding-bottom: 2.0pt;padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$\rho^{r}$&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S7.SS1.p3.1.3" class="ltx_tr"&gt;
&lt;th id="S7.SS1.p3.1.3.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-bottom: 2.0pt;padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$\operatorname{Var}(T)$&lt;/th&gt;
&lt;td id="S7.SS1.p3.1.3.2" class="ltx_td ltx_align_center" style="padding-bottom: 2.0pt;padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$+g^{\prime}(s)$&lt;/td&gt;
&lt;td id="S7.SS1.p3.1.3.3" class="ltx_td ltx_align_center" style="padding-bottom: 2.0pt;padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$+H=\sum 1/j$&lt;/td&gt;
&lt;td id="S7.SS1.p3.1.3.4" class="ltx_td ltx_align_center" style="padding-bottom: 2.0pt;padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$+r/(s\sigma)$&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S7.SS1.p3.1.4" class="ltx_tr"&gt;
&lt;th id="S7.SS1.p3.1.4.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-bottom: 2.0pt;padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$\mu_{3}(T)$&lt;/th&gt;
&lt;td id="S7.SS1.p3.1.4.2" class="ltx_td ltx_align_center" style="padding-bottom: 2.0pt;padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$+g^{\prime\prime}(s)$&lt;/td&gt;
&lt;td id="S7.SS1.p3.1.4.3" class="ltx_td ltx_align_center" style="padding-bottom: 2.0pt;padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$+H^{(2)}=\sum 1/j^{2}$&lt;/td&gt;
&lt;td id="S7.SS1.p3.1.4.4" class="ltx_td ltx_align_center" style="padding-bottom: 2.0pt;padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$+\,r\cdot[\text{rational in }s,\sigma,\pi]$&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S7.SS1.p3.1.5" class="ltx_tr"&gt;
&lt;th id="S7.SS1.p3.1.5.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$\mu_{k}(T)$&lt;/th&gt;
&lt;td id="S7.SS1.p3.1.5.2" class="ltx_td ltx_align_center ltx_border_bb" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$+g^{(k-1)}(s)$&lt;/td&gt;
&lt;td id="S7.SS1.p3.1.5.3" class="ltx_td ltx_align_center ltx_border_bb" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$+H^{(k-1)}$&lt;/td&gt;
&lt;td id="S7.SS1.p3.1.5.4" class="ltx_td ltx_align_center ltx_border_bb" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$+r\cdot[\text{rational}]$&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S7.SS1.p4" class="ltx_para"&gt;
&lt;p id="S7.SS1.p4.1" class="ltx_p"&gt;The contrast traces to the PGF’s analytic structure: the CCP’s $n$ distinct poles produce new power sums $\sum j^{-k}$ at each level, while the multi-phase model’s single pole with multiplicity $r$ cycles through powers of the same two quantities $1/s$ and $(1-\pi)/\sigma\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.Thmtheorem1" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S7.Thmtheorem1.2" class="ltx_text ltx_font_italic"&gt;Remark 7.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S7.Thmtheorem1.3" class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;(What the DRP saves)&lt;span id="S7.Thmtheorem1.4" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S7.Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p id="S7.Thmtheorem1.p1.1" class="ltx_p"&gt;In the CCP, the DRP eliminates one new harmonic statistic at each level; here, it eliminates a routine rational computation. The mechanism—$\alpha_{N}(1)=\alpha_{D}(1)$ forcing cancellation of $g^{(k)}$ in $\Delta_{k}$—is identical. The DRP is a property of the catastrophe mechanism, not of the base process.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S7.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="phase-transition-and-convergence-rate"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;7.2 &lt;/span&gt;Phase Transition and Convergence Rate&lt;/h3&gt;
&lt;div id="S7.SS2.p1" class="ltx_para"&gt;
&lt;p id="S7.SS2.p1.1" class="ltx_p"&gt;Specializing Definition &lt;a href="#S4.Thmtheorem1" title="Definition 4.1 (Perturbation parameters). ‣ 4.1 The Perturbation Parameter ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.1&lt;/span&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;table id="S7.E56" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\alpha=\frac{\rho^{r}(s\sigma-qr)}{\sigma(1-\rho^{r})},\qquad|\alpha|\sim\frac{qr}{\sigma}\,\rho^{r},\quad p=\rho^{r}\qquad(r\to\infty).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(56)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.SS2.p1.2" class="ltx_p"&gt;Since $q$ is fixed, Corollary &lt;a href="#S4.Thmtheorem6" title="Corollary 4.6 (Exponential limit). ‣ 4.2 The Laplace Expansion ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.6&lt;/span&gt;&lt;/a&gt; applies directly: $T/E[T]\xrightarrow{d}\operatorname{Exp}(1)$ as $r\to\infty\text{.}$ Without catastrophe, $T_{0}\sim\mathrm{NegBin}(r,\pi)$ satisfies a CLT: $(T_{0}-r/\pi)/\sqrt{r(1-\pi)/\pi^{2}}\xrightarrow{d}N(0,1)\text{.}$ A single catastrophe mechanism thus induces a &lt;span id="S7.SS2.p1.2.1" class="ltx_text ltx_font_bold"&gt;Gaussian-to-exponential phase transition&lt;/span&gt;—distinct from the CCP’s Gumbel-to-Exponential transition, but driven by the same algebraic cause: the coefficient equality $\alpha_{N}(1)=\alpha_{D}(1)$ forces the $\theta^{1}$-coefficient in the Laplace expansion to vanish exactly (Proposition &lt;a href="#S4.Thmtheorem2" title="Proposition 4.2 (Properties of the perturbation parameters). ‣ 4.1 The Perturbation Parameter ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt; (&lt;a href="#S4.I2.i1" title="item a ‣ Proposition 4.2 (Properties of the perturbation parameters). ‣ 4.1 The Perturbation Parameter ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;a&lt;/span&gt;&lt;/a&gt;)).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.SS2.p2" class="ltx_para"&gt;
&lt;p id="S7.SS2.p2.1" class="ltx_p"&gt;The sharp two-sided bound (Theorem &lt;a href="#S4.Thmtheorem15" title="Theorem 4.15 (Two-sided bound). ‣ 4.4 The Sharp Two-Sided Bound ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.15&lt;/span&gt;&lt;/a&gt;) gives $d_{\mathrm{K}}(T/E[T],\,\operatorname{Exp}(1))\asymp p+|\alpha|\asymp r\rho^{r}$ as $r\to\infty\text{:}$ convergence is &lt;em id="S7.SS2.p2.1.1" class="ltx_emph ltx_font_italic"&gt;exponentially fast&lt;/em&gt; in $r$ with a linear prefactor, contrasting with the CCP’s polynomial rate $\Theta(m!\,m\ln n/n^{m})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.SS2.p3" class="ltx_para"&gt;
&lt;table id="S7.SS2.p3.1" class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle"&gt;
&lt;tbody class="ltx_tbody"&gt;
&lt;tr id="S7.SS2.p3.1.1" class="ltx_tr"&gt;
&lt;th id="S7.SS2.p3.1.1.1" class="ltx_td ltx_th ltx_th_row ltx_border_tt" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;/th&gt;
&lt;td id="S7.SS2.p3.1.1.2" class="ltx_td ltx_align_left ltx_border_tt" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S7.SS2.p3.1.1.2.1" class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;CCP ($n\to\infty\text{,}$ $m$ fixed)&lt;/span&gt;&lt;/td&gt;
&lt;td id="S7.SS2.p3.1.1.3" class="ltx_td ltx_align_left ltx_border_tt" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S7.SS2.p3.1.1.3.1" class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Multi-phase ($r\to\infty\text{,}$ $\pi,q$ fixed)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S7.SS2.p3.1.2" class="ltx_tr"&gt;
&lt;th id="S7.SS2.p3.1.2.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S7.SS2.p3.1.2.1.1" class="ltx_text" style="font-size:90%;"&gt;Without catastrophe&lt;/span&gt;&lt;/th&gt;
&lt;td id="S7.SS2.p3.1.2.2" class="ltx_td ltx_align_left ltx_border_t" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S7.SS2.p3.1.2.2.1" class="ltx_text" style="font-size:90%;"&gt;Gumbel&lt;/span&gt;&lt;/td&gt;
&lt;td id="S7.SS2.p3.1.2.3" class="ltx_td ltx_align_left ltx_border_t" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S7.SS2.p3.1.2.3.1" class="ltx_text" style="font-size:90%;"&gt;Gaussian&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S7.SS2.p3.1.3" class="ltx_tr"&gt;
&lt;th id="S7.SS2.p3.1.3.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S7.SS2.p3.1.3.1.1" class="ltx_text" style="font-size:90%;"&gt;With catastrophe&lt;/span&gt;&lt;/th&gt;
&lt;td id="S7.SS2.p3.1.3.2" class="ltx_td ltx_align_left" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S7.SS2.p3.1.3.2.1" class="ltx_text" style="font-size:90%;"&gt;Exponential&lt;/span&gt;&lt;/td&gt;
&lt;td id="S7.SS2.p3.1.3.3" class="ltx_td ltx_align_left" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S7.SS2.p3.1.3.3.1" class="ltx_text" style="font-size:90%;"&gt;Exponential&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S7.SS2.p3.1.4" class="ltx_tr"&gt;
&lt;th id="S7.SS2.p3.1.4.1" class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S7.SS2.p3.1.4.1.1" class="ltx_text" style="font-size:90%;"&gt;Rate template&lt;/span&gt;&lt;/th&gt;
&lt;td id="S7.SS2.p3.1.4.2" class="ltx_td ltx_align_left" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$p+|\alpha|\asymp m!\,m\ln n/n^{m}$&lt;/td&gt;
&lt;td id="S7.SS2.p3.1.4.3" class="ltx_td ltx_align_left" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;$p+|\alpha|\asymp r\rho^{r}$&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S7.SS2.p3.1.5" class="ltx_tr"&gt;
&lt;th id="S7.SS2.p3.1.5.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S7.SS2.p3.1.5.1.1" class="ltx_text" style="font-size:90%;"&gt;Rate type&lt;/span&gt;&lt;/th&gt;
&lt;td id="S7.SS2.p3.1.5.2" class="ltx_td ltx_align_left ltx_border_bb" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S7.SS2.p3.1.5.2.1" class="ltx_text" style="font-size:90%;"&gt;polynomial in $n$&lt;/span&gt;&lt;/td&gt;
&lt;td id="S7.SS2.p3.1.5.3" class="ltx_td ltx_align_left ltx_border_bb" style="padding-top:0.9pt;padding-bottom:0.9pt;"&gt;&lt;span id="S7.SS2.p3.1.5.3.1" class="ltx_text" style="font-size:90%;"&gt;exponential in $r$&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S7.Thmtheorem2" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S7.Thmtheorem2.2" class="ltx_text ltx_font_italic"&gt;Remark 7.2&lt;/span&gt;&lt;/span&gt;&lt;span id="S7.Thmtheorem2.3" class="ltx_text ltx_font_italic"&gt; &lt;/span&gt;(CV criterion and forced catastrophe)&lt;span id="S7.Thmtheorem2.4" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S7.Thmtheorem2.p1" class="ltx_para"&gt;
&lt;p id="S7.Thmtheorem2.p1.1" class="ltx_p"&gt;The coefficient of variation of $T_{0}\sim\mathrm{NegBin}(r,\pi)$ satisfies $\operatorname{CV}^{2}=(1-\pi)/r&amp;lt;1$ for $r\geq 2\text{.}$ By the Pal–Reuveni criterion (&lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib37" title="" class="ltx_ref"&gt;37&lt;/a&gt;]&lt;/cite&gt;), adding voluntary restart to this base process is always detrimental. The present application demonstrates that the DRP framework remains fully operative—and produces non-trivial distributional information—even when catastrophe is imposed against the process’s interest. The algebraic structure does not consult the CV criterion.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S8" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="related-work"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;8 &lt;/span&gt;Related Work&lt;/h2&gt;
&lt;section id="S8.SS0.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h4 class="ltx_title ltx_title_paragraph" id="stochastic-resetting-and-the-pgf-formula"&gt;Stochastic Resetting and the PGF Formula.&lt;/h4&gt;
&lt;div id="S8.SS0.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p id="S8.SS0.SSS0.Px1.p1.1" class="ltx_p"&gt;The renewal framework for stochastic resetting—developed in &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib15" title="" class="ltx_ref"&gt;16&lt;/a&gt;, &lt;a href="#bib.bib37" title="" class="ltx_ref"&gt;37&lt;/a&gt;, &lt;a href="#bib.bib33" title="" class="ltx_ref"&gt;33&lt;/a&gt;, &lt;a href="#bib.bib8" title="" class="ltx_ref"&gt;8&lt;/a&gt;]&lt;/cite&gt; and surveyed in &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib16" title="" class="ltx_ref"&gt;15&lt;/a&gt;]&lt;/cite&gt;—provides the attempt decomposition underlying Theorem &lt;a href="#S2.Thmtheorem2" title="Theorem 2.2 (PGF formula). ‣ 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt;. The PGF formula was derived independently by &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib19" title="" class="ltx_ref"&gt;19&lt;/a&gt;]&lt;/cite&gt; and &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib4" title="" class="ltx_ref"&gt;4&lt;/a&gt;]&lt;/cite&gt;. These works primarily use the resulting transform for computation or restart optimization, without identifying the affine structure or establishing convergence rates. Our framework places the CV-unity criterion of &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib37" title="" class="ltx_ref"&gt;37&lt;/a&gt;]&lt;/cite&gt;
in a broader structural context: the dependence on first and second moments appears as the $k=2$ shadow of the derivative reduction principle. Non-memoryless protocols &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib14" title="" class="ltx_ref"&gt;14&lt;/a&gt;, &lt;a href="#bib.bib9" title="" class="ltx_ref"&gt;9&lt;/a&gt;, &lt;a href="#bib.bib26" title="" class="ltx_ref"&gt;26&lt;/a&gt;]&lt;/cite&gt; fall outside this affine transform class; our characterization theorems (Theorems &lt;a href="#S3.Thmtheorem6" title="Theorem 3.6 (Characterization). ‣ 3.3 The Characterization Theorem ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.6&lt;/span&gt;&lt;/a&gt;, &lt;a href="#S5.Thmtheorem7" title="Theorem 5.7 (Continuous-time characterization). ‣ 5.4 Characterization: Affine Laplace Structure Is Poisson ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.7&lt;/span&gt;&lt;/a&gt;) identify the precise algebraic boundary.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S8.SS0.SSS0.Px2" class="ltx_paragraph"&gt;
&lt;h4 class="ltx_title ltx_title_paragraph" id="linear-fractional-structure-across-domains"&gt;Linear-Fractional Structure across Domains.&lt;/h4&gt;
&lt;div id="S8.SS0.SSS0.Px2.p1" class="ltx_para"&gt;
&lt;p id="S8.SS0.SSS0.Px2.p1.1" class="ltx_p"&gt;Geometric compounding inherently produces linear-fractional PGFs, exploited in branching process theory by &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib1" title="" class="ltx_ref"&gt;1&lt;/a&gt;, &lt;a href="#bib.bib38" title="" class="ltx_ref"&gt;38&lt;/a&gt;]&lt;/cite&gt; (see also &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib23" title="" class="ltx_ref"&gt;23&lt;/a&gt;, &lt;a href="#bib.bib28" title="" class="ltx_ref"&gt;28&lt;/a&gt;]&lt;/cite&gt;), in catastrophe queueing by &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib5" title="" class="ltx_ref"&gt;5&lt;/a&gt;, &lt;a href="#bib.bib20" title="" class="ltx_ref"&gt;20&lt;/a&gt;]&lt;/cite&gt; (see &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib27" title="" class="ltx_ref"&gt;27&lt;/a&gt;, &lt;a href="#bib.bib12" title="" class="ltx_ref"&gt;12&lt;/a&gt;, &lt;a href="#bib.bib2" title="" class="ltx_ref"&gt;2&lt;/a&gt;]&lt;/cite&gt; for extensions), and observed empirically in algorithmic restart, where &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib22" title="" class="ltx_ref"&gt;22&lt;/a&gt;]&lt;/cite&gt; noted that restart converts heavy-tailed SAT runtimes into geometric-like distributions (see &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib29" title="" class="ltx_ref"&gt;29&lt;/a&gt;, &lt;a href="#bib.bib39" title="" class="ltx_ref"&gt;39&lt;/a&gt;, &lt;a href="#bib.bib40" title="" class="ltx_ref"&gt;40&lt;/a&gt;]&lt;/cite&gt;). All these works treat linear-fractional structure as a convenient tractable family or an empirical regularity. Our characterization theorem reveals the complementary perspective: this structure is &lt;em id="S8.SS0.SSS0.Px2.p1.1.1" class="ltx_emph ltx_font_italic"&gt;diagnostic&lt;/em&gt;—it identifies the geometric-tail class among all age-based catastrophe mechanisms—and the Möbius-rigidity argument applies it as a characterization tool rather than a model assumption.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S8.SS0.SSS0.Px3" class="ltx_paragraph"&gt;
&lt;h4 class="ltx_title ltx_title_paragraph" id="exponential-approximation-of-geometric-sums"&gt;Exponential Approximation of Geometric Sums.&lt;/h4&gt;
&lt;div id="S8.SS0.SSS0.Px3.p1" class="ltx_para"&gt;
&lt;p id="S8.SS0.SSS0.Px3.p1.1" class="ltx_p"&gt;&lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib36" title="" class="ltx_ref"&gt;36&lt;/a&gt;]&lt;/cite&gt; proved that normalized geometric sums converge to $\operatorname{Exp}(1)\text{.}$ &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib6" title="" class="ltx_ref"&gt;6&lt;/a&gt;]&lt;/cite&gt; obtained optimal-order Kolmogorov bounds $d_{K}\leq C_{1}p\text{;}$ &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib34" title="" class="ltx_ref"&gt;35&lt;/a&gt;]&lt;/cite&gt; introduced Stein’s method for this setting, achieving $O(p)$ Wasserstein and $O(\sqrt{p})$ Kolmogorov bounds (see &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib7" title="" class="ltx_ref"&gt;7&lt;/a&gt;, &lt;a href="#bib.bib35" title="" class="ltx_ref"&gt;34&lt;/a&gt;]&lt;/cite&gt; for refinements, and &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib21" title="" class="ltx_ref"&gt;21&lt;/a&gt;, &lt;a href="#bib.bib25" title="" class="ltx_ref"&gt;25&lt;/a&gt;]&lt;/cite&gt; for comprehensive treatments). Our Bridge Theorem matches Brown’s $O(p)$ rate for the geometric-sum component; the sharp two-sided bound $d_{\mathrm{K}}\asymp p+|\alpha|$ (Theorem &lt;a href="#S4.Thmtheorem15" title="Theorem 4.15 (Two-sided bound). ‣ 4.4 The Sharp Two-Sided Bound ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.15&lt;/span&gt;&lt;/a&gt;) closes a logarithmic gap from the smoothing inequality by exploiting the specific two-parameter structure produced by the affine PGF analysis. Stein’s method does not directly yield this two-parameter template: existing Stein bounds apply to the pure geometric sum $U$ (achieving $O(\sqrt{p})$ in Kolmogorov distance &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib34" title="" class="ltx_ref"&gt;35&lt;/a&gt;]&lt;/cite&gt;, weaker than Brown’s $O(p)$), while the $|\alpha|$-term arises from the successful-attempt perturbation $B$—an additive component outside the geometric-sum framework that the Bridge Theorem handles via direct probabilistic arguments (Lemmas &lt;a href="#S4.Thmtheorem10" title="Lemma 4.10 (Scaling perturbation). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.10&lt;/span&gt;&lt;/a&gt;–&lt;a href="#S4.Thmtheorem11" title="Lemma 4.11 (Additive perturbation). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4.11&lt;/span&gt;&lt;/a&gt;). The matching lower bound, obtained by evaluating the Laplace expansion at a fixed $\theta\text{,}$ is likewise orthogonal to the Stein approach.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S8.SS0.SSS0.Px3.p2" class="ltx_para"&gt;
&lt;p id="S8.SS0.SSS0.Px3.p2.1" class="ltx_p"&gt;&lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib10" title="" class="ltx_ref"&gt;10&lt;/a&gt;]&lt;/cite&gt; develop Stein’s method for the Gumbel approximation and obtain a $(\log n/n)$ rate for the classical coupon collector in a smooth Wasserstein-$1$ metric.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S8.SS0.SSS0.Px4" class="ltx_paragraph"&gt;
&lt;h4 class="ltx_title ltx_title_paragraph" id="coupon-collector-variants-and-phase-transitions"&gt;Coupon Collector Variants and Phase Transitions.&lt;/h4&gt;
&lt;div id="S8.SS0.SSS0.Px4.p1" class="ltx_para"&gt;
&lt;p id="S8.SS0.SSS0.Px4.p1.1" class="ltx_p"&gt;The classical Gumbel limit was established by &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib13" title="" class="ltx_ref"&gt;13&lt;/a&gt;]&lt;/cite&gt; (see &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib3" title="" class="ltx_ref"&gt;3&lt;/a&gt;, &lt;a href="#bib.bib18" title="" class="ltx_ref"&gt;17&lt;/a&gt;, &lt;a href="#bib.bib17" title="" class="ltx_ref"&gt;18&lt;/a&gt;, &lt;a href="#bib.bib11" title="" class="ltx_ref"&gt;11&lt;/a&gt;, &lt;a href="#bib.bib31" title="" class="ltx_ref"&gt;31&lt;/a&gt;]&lt;/cite&gt; for refinements and extensions). The closest prior phase-transition result is &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib30" title="" class="ltx_ref"&gt;30&lt;/a&gt;]&lt;/cite&gt;, who identified a Gumbel-to-Gaussian transition in the CCP with bonuses. &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib24" title="" class="ltx_ref"&gt;24&lt;/a&gt;]&lt;/cite&gt; study a closely related reset-button CCP, deriving the waiting-time distribution in the unequal-probability setting and expected-value formulas with asymptotics in the equal-probability case. Our contribution is the structural theory (affine PGF framework, DRP, sharp exponential approximation), and the identification of the Gumbel-to-Exponential phase transition—which is qualitatively different from the Gumbel-to-Gaussian transition of &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib30" title="" class="ltx_ref"&gt;30&lt;/a&gt;]&lt;/cite&gt; (it reflects memoryless catastrophe, not a CLT effect).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S8.SS0.SSS0.Px4.p2" class="ltx_para"&gt;
&lt;p id="S8.SS0.SSS0.Px4.p2.1" class="ltx_p"&gt;Our phase transitions differ from those of &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib32" title="" class="ltx_ref"&gt;32&lt;/a&gt;]&lt;/cite&gt;, who study transitions in the &lt;em id="S8.SS0.SSS0.Px4.p2.1.1" class="ltx_emph ltx_font_italic"&gt;optimal restart rate&lt;/em&gt;. Ours are in the &lt;em id="S8.SS0.SSS0.Px4.p2.1.2" class="ltx_emph ltx_font_italic"&gt;universality class&lt;/em&gt; of the limit distribution—Gumbel $\to$ Exponential, Gaussian $\to$ Exponential—driven by the coefficient equality $\alpha_{N}(1)=\alpha_{D}(1)$ killing the first-order Laplace error.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S9" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="further-directions"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;9 &lt;/span&gt;Further Directions&lt;/h2&gt;
&lt;section id="S9.SS0.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h4 class="ltx_title ltx_title_paragraph" id="stability-and-refinement-of-affine-structure"&gt;Stability and Refinement of Affine Structure.&lt;/h4&gt;
&lt;div id="S9.SS0.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p id="S9.SS0.SSS0.Px1.p1.1" class="ltx_p"&gt;Theorem &lt;a href="#S3.Thmtheorem6" title="Theorem 3.6 (Characterization). ‣ 3.3 The Characterization Theorem ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.6&lt;/span&gt;&lt;/a&gt; characterizes affine PGF structure as equivalent to geometric-tail catastrophe, with full memorylessness singled out by $\lambda=1$ (Corollary &lt;a href="#S3.Thmtheorem8" title="Corollary 3.8 (Full memorylessness). ‣ 3.4 From Geometric Tail to Full Memorylessness ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.8&lt;/span&gt;&lt;/a&gt;). The gap—exactly one degree of freedom, the first-step hazard $h_{1}$—closes in continuous time (Theorem &lt;a href="#S5.Thmtheorem7" title="Theorem 5.7 (Continuous-time characterization). ‣ 5.4 Characterization: Affine Laplace Structure Is Poisson ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.7&lt;/span&gt;&lt;/a&gt;). In the discrete setting, supplementary algebraic conditions (e.g., requiring the successful-attempt PGF $G_{B}$ to also depend on $g$ at a single shifted point) may close this gap; formalizing this would strengthen the characterization.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S9.SS0.SSS0.Px1.p2" class="ltx_para"&gt;
&lt;p id="S9.SS0.SSS0.Px1.p2.1" class="ltx_p"&gt;A related stability question: for near-memoryless mechanisms with $|h_{t}-q|\leq\varepsilon$ for $t\geq 2\text{,}$ does the DRP cancellation error $|\Delta_{k}-(-ks^{k-1}D_{k-1})|$ admit an $O(\varepsilon)$ bound? More broadly, quantifying DRP degradation under Gamma-distributed inter-reset times (shape parameter near $1$) would connect the algebraic theory to the restart optimization literature. At the application level, the CCP sharp bound (Theorem &lt;a href="#S6.Thmtheorem4" title="Theorem 6.4 (CCP sharp bound). ‣ 6.4 Phase Transition and Sharp Kolmogorov Bound ‣ 6 Application: Coupon Collector with Reset ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6.4&lt;/span&gt;&lt;/a&gt;) gives leading constants in $[1,2]\text{;}$ numerical evidence suggests the exact constant is closer to $1\text{,}$ likely requiring a finer analysis of the additive perturbation step.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S9.SS0.SSS0.Px2" class="ltx_paragraph"&gt;
&lt;h4 class="ltx_title ltx_title_paragraph" id="partial-reset"&gt;Partial Reset.&lt;/h4&gt;
&lt;div id="S9.SS0.SSS0.Px2.p1" class="ltx_para"&gt;
&lt;p id="S9.SS0.SSS0.Px2.p1.1" class="ltx_p"&gt;When catastrophe clears each coupon independently with probability $r\in(0,1)\text{,}$ the i.i.d. attempt structure of (&lt;a href="#S2.E6" title="In 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;) breaks down: partial reset creates state-dependent catastrophe that cannot be described by a hazard sequence $(h_{t})_{t\geq 1}\text{.}$ Theorem &lt;a href="#S3.Thmtheorem6" title="Theorem 3.6 (Characterization). ‣ 3.3 The Characterization Theorem ‣ 3 Characterization of Geometric-Tail Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.6&lt;/span&gt;&lt;/a&gt; predicts that affine PGF structure is lost, but a quantitative understanding—what replaces the DRP, what the correct rate template is—remains open. Partial reset interpolates between the memoryless regime ($r=1\text{,}$ exponential limit) and the classical CCP ($r=0\text{,}$ Gumbel limit); understanding this interpolation would reveal whether the Gumbel-to-Exponential phase transition is sharp or admits a crossover regime. A probabilistic proof of the DRP—perhaps via coupling—might extend to this setting where the PGF algebra breaks down.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S9.SS0.SSS0.Px3" class="ltx_paragraph"&gt;
&lt;h4 class="ltx_title ltx_title_paragraph" id="non-uniform-coupon-probabilities"&gt;Non-Uniform Coupon Probabilities.&lt;/h4&gt;
&lt;div id="S9.SS0.SSS0.Px3.p1" class="ltx_para"&gt;
&lt;p id="S9.SS0.SSS0.Px3.p1.1" class="ltx_p"&gt;For non-uniform CCP with probabilities $p_{1},\ldots,p_{n}\text{,}$ the PGF no longer telescopes, but the general theory (Theorem &lt;a href="#S2.Thmtheorem2" title="Theorem 2.2 (PGF formula). ‣ 2.1 Model and PGF Formula ‣ 2 Completion Time under Memoryless Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt;, DRP, exponential approximation) applies unchanged to the non-uniform base process. The challenge is evaluating the CCP-specific quantities ($D_{1}\text{,}$ $\alpha$) in terms of the non-uniform parameters and understanding how the phase transition depends on the coupon probability vector.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S9.SS0.SSS0.Px4" class="ltx_paragraph"&gt;
&lt;h4 class="ltx_title ltx_title_paragraph" id="universality-classes-of-completion-time-limits"&gt;Universality Classes of Completion-Time Limits.&lt;/h4&gt;
&lt;div id="S9.SS0.SSS0.Px4.p1" class="ltx_para"&gt;
&lt;p id="S9.SS0.SSS0.Px4.p1.1" class="ltx_p"&gt;The present paper establishes that memoryless catastrophe (i.i.d. attempts, affine PGF structure) produces exponential limits. A structurally contrasting regime may arise in non-renewal recycling mechanisms with weakly dependent increments, where CLT-type arguments yield log-normal completion-time limits instead. This contrast raises a natural question: &lt;em id="S9.SS0.SSS0.Px4.p1.1.1" class="ltx_emph ltx_font_italic"&gt;what properties of the catastrophe or recycling mechanism determine the universality class of the completion-time limit law?&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="ltx_pagination ltx_role_newpage"&gt;&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="bib" class="ltx_bibliography"&gt;
&lt;h2 class="ltx_title ltx_title_bibliography" id="references"&gt;References&lt;/h2&gt;
&lt;ul id="bib.L1" class="ltx_biblist"&gt;
&lt;li id="bib.bib1" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[1]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;A. Agresti&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1974)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Bounds on the extinction time distribution of a branching process&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Adv. in Appl. Probab.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;6&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 322–335&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS1.p4.1" title="1.1 Motivation ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px2.p1.1" title="Linear-Fractional Structure across Domains. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib2" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[2]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;C. Banderier and M. Wallner&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2017)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Lattice paths with catastrophes&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Discrete Math. Theor. Comput. Sci.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;19&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;1&lt;/span&gt;).
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px2.p1.1" title="Linear-Fractional Structure across Domains. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib3" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[3]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;L. E. Baum and P. Billingsley&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1965)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Asymptotic distributions for the coupon collector’s problem&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Ann. Math. Statist.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;36&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 1835–1839&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S6.SS4.p2.1" title="6.4 Phase Transition and Sharp Kolmogorov Bound ‣ 6 Application: Coupon Collector with Reset ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§6.4&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px4.p1.1" title="Coupon Collector Variants and Phase Transitions. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib4" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[4]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;O. L. Bonomo and A. Pal&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2021)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;First passage under restart for discrete space and time: Application to one-dimensional confined lattice random walks&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Phys. Rev. E&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;103&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 052129&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS1.p4.1" title="1.1 Motivation ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS2.p2.2" title="1.2 Setup and the PGF Formula ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.2&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px1.p1.1" title="Stochastic Resetting and the PGF Formula. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib5" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[5]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;P. J. Brockwell, J. Gani, and S. I. Resnick&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1982)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Birth, immigration and catastrophe processes&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Adv. in Appl. Probab.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;14&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 709–731&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.I1.i2.p1.1" title="In 1.1 Motivation ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2nd item&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px2.p1.1" title="Linear-Fractional Structure across Domains. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib6" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[6]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. Brown&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1990)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Error bounds for exponential approximations of geometric convolutions&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Ann. Probab.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;18&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;3&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 1388–1402&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p10.1" title="1.3 Main Results ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S4.SS3.p9.1" title="4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§4.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S4.Thmtheorem12" title="Theorem 4.12 (Theorem 2.1 (ii), []). ‣ 4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem 4.12&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px3.p1.1" title="Exponential Approximation of Geometric Sums. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib7" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[7]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. Brown&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2015)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Sharp bounds for exponential approximations under a hazard rate upper bound&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;J. Appl. Probab.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;52&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 841–850&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px3.p1.1" title="Exponential Approximation of Geometric Sums. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib8" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[8]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;A. Chechkin and I. M. Sokolov&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2018)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Random search with resetting: A unified renewal approach&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Phys. Rev. Lett.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;121&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 050601&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS1.p2.1" title="1.1 Motivation ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S5.SS2.p1.1" title="5.2 The Laplace Transform Formula and Affine Structure ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§5.2&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px1.p1.1" title="Stochastic Resetting and the PGF Formula. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib9" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[9]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;H. Chen and Y. Ye&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2022)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Random walks on complex networks under time-dependent stochastic resetting&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Phys. Rev. E&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;106&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 044139&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px1.p1.1" title="Stochastic Resetting and the PGF Formula. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib10" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[10]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;B. Costacèque and L. Decreusefond&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2026)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Convergence rate for the coupon collector’s problem with Stein’s method&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Stochastic Process. Appl.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;193&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 104835&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px3.p2.1" title="Exponential Approximation of Geometric Sums. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib11" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[11]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;A. V. Doumas and V. G. Papanicolaou&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2012)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;The coupon collector’s problem revisited: Asymptotics of the variance&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Adv. in Appl. Probab.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;44&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 166–195&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px4.p1.1" title="Coupon Collector Variants and Phase Transitions. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib12" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[12]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;A. Economou and D. Fakinos&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2003)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;A continuous-time Markov chain under the influence of a regulating point process and applications in stochastic models with catastrophes&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;European J. Oper. Res.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;149&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 625–640&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px2.p1.1" title="Linear-Fractional Structure across Domains. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib13" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[13]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;P. Erdős and A. Rényi&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1961)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;On a classical problem of probability theory&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Magyar Tud. Akad. Mat. Kutató Int. Közl.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;6&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 215–220&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S6.SS4.p2.1" title="6.4 Phase Transition and Sharp Kolmogorov Bound ‣ 6 Application: Coupon Collector with Reset ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§6.4&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px4.p1.1" title="Coupon Collector Variants and Phase Transitions. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib14" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[14]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;S. Eule and J. J. Metzger&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2016)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Non-equilibrium steady states of stochastic processes with intermittent resetting&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;New J. Phys.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;18&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 033006&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px1.p1.1" title="Stochastic Resetting and the PGF Formula. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib16" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[15]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. R. Evans, S. N. Majumdar, and G. Schehr&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2020)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Stochastic resetting and applications&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;J. Phys. A&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;53&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 193001&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.I1.i3.p1.1" title="In 1.1 Motivation ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3rd item&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S5.SS2.p1.1" title="5.2 The Laplace Transform Formula and Affine Structure ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§5.2&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px1.p1.1" title="Stochastic Resetting and the PGF Formula. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib15" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[16]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. R. Evans and S. N. Majumdar&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2011)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Diffusion with stochastic resetting&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Phys. Rev. Lett.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;106&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 160601&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.I1.i3.p1.1" title="In 1.1 Motivation ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3rd item&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS3.p14.1" title="1.3 Main Results ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S5.SS6.p1.1" title="5.6 Worked Example: Brownian First Passage ‣ 5 Continuous-Time Theory ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§5.6&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px1.p1.1" title="Stochastic Resetting and the PGF Formula. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib18" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[17]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;P. Flajolet, D. Gardy, and L. Thimonier&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1992)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Birthday paradox, coupon collectors, caching algorithms and self-organizing search&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Discrete Appl. Math.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;39&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 207–229&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px4.p1.1" title="Coupon Collector Variants and Phase Transitions. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib17" class="ltx_bibitem ltx_bib_book"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[18]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;P. Flajolet and R. Sedgewick&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2009)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Analytic combinatorics&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; &lt;span class="ltx_text ltx_bib_publisher"&gt;Cambridge University Press&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px4.p1.1" title="Coupon Collector Variants and Phase Transitions. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib19" class="ltx_bibitem ltx_bib_misc"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[19]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;J. M. Flynn and S. S. Pilyugin&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2021)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;First passage with restart in discrete time: with applications to biased random walks on the half-line&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;arXiv:2108.11508&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS1.p4.1" title="1.1 Motivation ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS2.p2.2" title="1.2 Setup and the PGF Formula ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.2&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px1.p1.1" title="Stochastic Resetting and the PGF Formula. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib20" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[20]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;E. Gelenbe&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1991)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Product-form queueing networks with negative and positive customers&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;J. Appl. Probab.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;28&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 656–663&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.I1.i2.p1.1" title="In 1.1 Motivation ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2nd item&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px2.p1.1" title="Linear-Fractional Structure across Domains. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib21" class="ltx_bibitem ltx_bib_book"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[21]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;B. V. Gnedenko and V. Y. Korolev&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1996)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Random summation: limit theorems and applications&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; &lt;span class="ltx_text ltx_bib_publisher"&gt;CRC Press&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S4.SS2.p8.1.1" title="Proof. ‣ 4.2 The Laplace Expansion ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§4.2&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S4.p1.1" title="4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§4&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px3.p1.1" title="Exponential Approximation of Geometric Sums. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib22" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[22]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;C. P. Gomes, B. Selman, N. Crato, and H. Kautz&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2000)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Heavy-tailed phenomena in satisfiability and constraint satisfaction problems&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;J. Automat. Reason.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;24&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 67–100&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px2.p1.1" title="Linear-Fractional Structure across Domains. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib23" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[23]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;N. Grosjean and T. Huillet&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2017)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Additional aspects of the generalized linear-fractional branching process&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Ann. Inst. Statist. Math.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;69&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 1075–1097&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px2.p1.1" title="Linear-Fractional Structure across Domains. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib24" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[24]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;J. Jocković and B. Todić&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2024)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Coupon collector problem with reset button&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Mathematics&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;12&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 239&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S6.SS1.p1.2" title="6.1 Model ‣ 6 Application: Coupon Collector with Reset ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§6.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px4.p1.1" title="Coupon Collector Variants and Phase Transitions. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib25" class="ltx_bibitem ltx_bib_book"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[25]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;V. V. Kalashnikov&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1997)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Geometric sums: bounds for rare events with applications&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; &lt;span class="ltx_text ltx_bib_publisher"&gt;Springer&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S4.SS3.p1.1" title="4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§4.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S4.p1.1" title="4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§4&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px3.p1.1" title="Exponential Approximation of Geometric Sums. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib26" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[26]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;T. D. Keidar, O. Blumer, B. Hirshberg, and S. Reuveni&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2025)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Adaptive resetting for informed search strategies and the design of non-equilibrium steady-states&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Nature Commun.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;16&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 7259&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px1.p1.1" title="Stochastic Resetting and the PGF Formula. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib27" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[27]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;B. Krishna Kumar and D. Arivudainambi&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2000)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Transient solution of an M/M/1 queue with catastrophes&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Comput. Math. Appl.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;40&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 1233–1240&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px2.p1.1" title="Linear-Fractional Structure across Domains. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib28" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[28]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;A. Lindo and S. Sagitov&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2018)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;General linear-fractional branching processes with discrete time&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Stochastics: International Journal of Probability and Stochastic Processes&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;90&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 364–378&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px2.p1.1" title="Linear-Fractional Structure across Domains. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib29" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[29]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. Luby, A. Sinclair, and D. Zuckerman&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1993)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Optimal speedup of Las Vegas algorithms&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Inform. Process. Lett.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;47&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 173–180&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.I1.i1.p1.1" title="In 1.1 Motivation ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1st item&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px2.p1.1" title="Linear-Fractional Structure across Domains. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib30" class="ltx_bibitem ltx_bib_inproceedings"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[30]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;T. Nakata and I. Kubo&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2006)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;A coupon collector’s problem with bonuses&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;DMTCS Proceedings&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Vol. &lt;span class="ltx_text ltx_bib_volume"&gt;AG&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 215–224&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px4.p1.1" title="Coupon Collector Variants and Phase Transitions. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib31" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[31]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;P. Neal&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2008)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;The generalised coupon collector problem&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;J. Appl. Probab.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;45&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 621–629&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px4.p1.1" title="Coupon Collector Variants and Phase Transitions. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib32" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[32]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;A. Pal and V. V. Prasad&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2019)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Landau-like expansion for phase transitions in stochastic resetting&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Phys. Rev. Research&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;1&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 032001&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px4.p2.1" title="Coupon Collector Variants and Phase Transitions. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib33" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[33]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;A. Pal and S. Reuveni&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2017)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;First passage under restart&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Phys. Rev. Lett.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;118&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 030603&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS1.p2.1" title="1.1 Motivation ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px1.p1.1" title="Stochastic Resetting and the PGF Formula. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib35" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[34]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;E. A. Peköz, A. Röllin, and N. Ross&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2013)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Total variation error bounds for geometric approximation&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Bernoulli&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;19&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 610–632&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px3.p1.1" title="Exponential Approximation of Geometric Sums. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib34" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[35]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;E. A. Peköz and A. Röllin&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2011)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;New rates for exponential approximation and the theorems of Rényi and Yaglom&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Ann. Probab.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;39&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 587–608&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px3.p1.1" title="Exponential Approximation of Geometric Sums. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib36" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[36]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;A. Rényi&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1956)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;A Poisson-folyamat egy jellemzése&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;MTA Mat. Kutató Int. Közl.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;1&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 519–527&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p7.1" title="1.3 Main Results ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S4.SS3.p9.1" title="4.3 The Bridge Theorem ‣ 4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§4.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S4.p1.1" title="4 Exponential Approximation ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§4&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px3.p1.1" title="Exponential Approximation of Geometric Sums. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib37" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[37]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;S. Reuveni&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2016)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Optimal stochastic restart renders fluctuations in first passage times universal&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Phys. Rev. Lett.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;116&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 170601&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS1.p2.1" title="1.1 Motivation ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S7.Thmtheorem2.p1.1" title="Remark 7.2 (CV criterion and forced catastrophe). ‣ 7.2 Phase Transition and Convergence Rate ‣ 7 Application: Multi-Phase Task with Catastrophe ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Remark 7.2&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px1.p1.1" title="Stochastic Resetting and the PGF Formula. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib38" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[38]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;S. Sagitov&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2013)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Linear-fractional branching processes with countably many types&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Stochastic Process. Appl.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;123&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 2940–2956&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS1.p4.1" title="1.1 Motivation ‣ 1 Introduction ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S8.SS0.SSS0.Px2.p1.1" title="Linear-Fractional Structure across Domains. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib39" class="ltx_bibitem ltx_bib_inproceedings"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[39]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;A. P. A. van Moorsel and K. Wolter&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2004)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Analysis and algorithms for restart&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;QEST 2004&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt;pp. 195–204&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px2.p1.1" title="Linear-Fractional Structure across Domains. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib40" class="ltx_bibitem ltx_bib_book"&gt;&lt;span class="ltx_tag ltx_bib_key ltx_role_refnum ltx_tag_bibitem"&gt;[40]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;K. Wolter&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2010)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Stochastic models for fault tolerance: restart, rejuvenation and checkpointing&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; &lt;span class="ltx_text ltx_bib_publisher"&gt;Springer&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S8.SS0.SSS0.Px2.p1.1" title="Linear-Fractional Structure across Domains. ‣ 8 Related Work ‣ On Completion Times under Memoryless Catastrophe" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§8&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;&lt;div class="ltx_rdf" about="" property="dcterms:creator" content="Sichen Wang, Zhipeng Lu"&gt;&lt;/div&gt;
&lt;div class="ltx_rdf" about="" property="dcterms:title" content="On Completion Times under Memoryless Catastrophe"&gt;&lt;/div&gt;
&lt;/article&gt;</description></item><item><title>Retained-Set Descent for Diagonal Ramsey Numbers</title><link>https://sichen-wang.github.io/publications/retained-set-descent/</link><pubDate>Sun, 13 Sep 2026 00:00:00 +0000</pubDate><guid>https://sichen-wang.github.io/publications/retained-set-descent/</guid><description>&lt;article class="ltx_document ltx_authors_1line"&gt;
&lt;section id="S1" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="introduction"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;1 &lt;/span&gt;Introduction&lt;/h2&gt;
&lt;div id="S1.p1" class="ltx_para"&gt;
&lt;p id="S1.p1.1" class="ltx_p"&gt;Let $R(k,\ell)$ be the least integer $N$ such that every red–blue coloring of $K_{N}$ contains a red $K_{k}$ or a blue $K_{\ell}\text{.}$
Ramsey’s theorem &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx6" title="" class="ltx_ref"&gt;Ram&lt;/a&gt;]&lt;/cite&gt; guarantees that these numbers are finite.
The Erdős–Szekeres recurrence &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx4" title="" class="ltx_ref"&gt;ES&lt;/a&gt;]&lt;/cite&gt; gives $R(k,\ell)\leq\binom{k+\ell-2}{k-1}\text{,}$ and hence $R(k,k)\leq 4^{k}\text{.}$
In the other direction, Erdős’s random-coloring argument &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx3" title="" class="ltx_ref"&gt;Er&lt;/a&gt;]&lt;/cite&gt; gives a lower bound of order $k2^{k/2}\text{;}$ Spencer &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx8" title="" class="ltx_ref"&gt;Spe&lt;/a&gt;]&lt;/cite&gt; improved its leading constant using the Lovász local lemma.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p2" class="ltx_para"&gt;
&lt;p id="S1.p2.1" class="ltx_p"&gt;Thomason &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx10" title="" class="ltx_ref"&gt;Tho&lt;/a&gt;]&lt;/cite&gt; improved the classical upper bound by a polynomial factor using quasirandomness: a coloring close to the inductive bound must have degrees and small-subgraph counts close to those of a random coloring.
Conlon &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx2" title="" class="ltx_ref"&gt;Con&lt;/a&gt;]&lt;/cite&gt; developed this approach to obtain $R(k,k)\leq 4^{k}\exp(-c(\log k)^{2}/\log\log k)\text{.}$
Sah &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx7" title="" class="ltx_ref"&gt;Sah&lt;/a&gt;]&lt;/cite&gt; strengthened the estimate to $R(k,k)\leq 4^{k}\exp(-c(\log k)^{2})\text{.}$
Each bound holds for a suitable absolute constant $c&amp;gt;0$ and all sufficiently large $k\text{.}$
These results gave successively larger subexponential improvements while retaining exponential base $4\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p3" class="ltx_para"&gt;
&lt;p id="S1.p3.1" class="ltx_p"&gt;Campos, Griffiths, Morris, and Sahasrabudhe &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx1" title="" class="ltx_ref"&gt;CGMS&lt;/a&gt;]&lt;/cite&gt; obtained the first improvement in the exponential base, proving $R(k,k)\leq(4-\varepsilon)^{k}$ for an absolute $\varepsilon&amp;gt;0$ and all sufficiently large $k\text{.}$
Their book algorithm works with two vertex sets and controls the red density between them.
Gupta, Ndiaye, Norin, and Wei &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx5" title="" class="ltx_ref"&gt;GNNW&lt;/a&gt;]&lt;/cite&gt; replaced this algorithm by a candidate induction, obtained stronger off-diagonal estimates, and optimized the resulting parameters to give $R(k,k)\leq 3.8^{k+o(k)}\text{.}$
Their candidate induction and reuse of improved Ramsey bounds in this optimization are the starting points of our work.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p4" class="ltx_para"&gt;
&lt;p id="S1.p4.1" class="ltx_p"&gt;We improve the diagonal bound to $3.69507^{k}$ for all sufficiently large $k\text{.}$
Our descent applies density bounds inside a vertex set $X$ while keeping a second set $Y$ fixed for a final inequality in $|X|^{w}|Y|\text{,}$ with $w&amp;gt;0\text{.}$
Each resulting bound can be used inside $X$ in a later descent.
We also ask how small an exponent finitely many such repetitions can give from a fixed initial bound.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p5" class="ltx_para"&gt;
&lt;p id="S1.p5.1" class="ltx_p"&gt;We call this initial bound the &lt;em id="S1.p5.1.1" class="ltx_emph ltx_font_italic"&gt;source&lt;/em&gt;.
It has the form $\log R(a,b)\leq af(b/a)+o(a)$ for integers $1\leq b\leq a\text{,}$ where $f$ is a fixed concave function on $[0,1]$ and the error is uniform in $b\text{.}$
&lt;a href="#S2" title="2 Source Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; specifies $f\text{,}$ and &lt;a href="#A2" title="Appendix B Admissibility of the Source ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;B&lt;/span&gt;&lt;/a&gt; proves the bound.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p6" class="ltx_para"&gt;
&lt;p id="S1.p6.1" class="ltx_p"&gt;A &lt;em id="S1.p6.1.1" class="ltx_emph ltx_font_italic"&gt;conditional bound&lt;/em&gt; at density $p\in(0,1)$ and ratio $s\in(0,1]$ applies to colorings with at least a fraction $p$ of their edges red.
An exponent $z$ means that, for some fixed $C\geq 1$ and all sufficiently large $k\text{,}$ order at least $C\mathrm{e}^{zk}$ guarantees a red $K_{k}$ or a blue $K_{\lfloor sk\rfloor}\text{.}$
We use families of such bounds on closed intervals of $s\text{,}$ with continuous exponents and common constants and thresholds.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p7" class="ltx_para"&gt;
&lt;p id="S1.p7.1" class="ltx_p"&gt;Starting from the conditional bounds supplied by the source, we apply the descent rule using bounds proved at earlier steps.
We may also restrict ratio intervals, increase a density threshold or an exponent, and combine bounds at the same density on a finite closed cover of a ratio interval.
A &lt;em id="S1.p7.1.1" class="ltx_emph ltx_font_italic"&gt;finite proof&lt;/em&gt; uses only finitely many of these operations; &lt;a href="#S4.Thmlemma1" title="Definition 4.1 (Finite Proof). ‣ 4 The Optimum over Finite Proofs ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Definition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.1&lt;/span&gt;&lt;/a&gt; gives the precise rules.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p8" class="ltx_para"&gt;
&lt;p id="S1.p8.1" class="ltx_p"&gt;Let $U_{\rm fin}(p,s)$ be the infimum of the exponents obtained at density $p$ and ratio $s$ by such finite proofs.
In the diagonal case $(p,s)=(1/2,1)\text{,}$ we construct a finite proof with rational exponent $z_{+}$ and a rational lower bound $z_{-}$ for all finite proofs.
Their exact values are given in &lt;a href="#S6" title="6 The Diagonal Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem1" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="Thmtheorem1.2" class="ltx_text ltx_font_bold"&gt;Theorem 1&lt;/span&gt;&lt;/span&gt;&lt;span id="Thmtheorem1.3" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p id="Thmtheorem1.p1.1" class="ltx_p"&gt;&lt;span id="Thmtheorem1.p1.1.1" class="ltx_text ltx_font_italic"&gt;For this source and these finite proof rules,&lt;/span&gt;&lt;/p&gt;
&lt;table id="S1.E1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$1.305&amp;lt;z_{-}\leq U_{\rm fin}(1/2,1)\leq z_{+}&amp;lt;1.307.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(1)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="Thmtheorem1.p1.2" class="ltx_p"&gt;&lt;span id="Thmtheorem1.p1.2.1" class="ltx_text ltx_font_italic"&gt;The exponent $z_{+}$ has a finite proof.
For all sufficiently large integers $k\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S1.E2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R(k,k)\leq\left\lceil 150003\exp(z_{+}k)\right\rceil,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(2)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="Thmtheorem1.p1.3" class="ltx_p"&gt;&lt;span id="Thmtheorem1.p1.3.1" class="ltx_text ltx_font_italic"&gt;and hence $R(k,k)\leq 3.69507^{k}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S1.p9" class="ltx_para"&gt;
&lt;p id="S1.p9.1" class="ltx_p"&gt;For the Ramsey bound, choose the denser color as red and apply the conditional bound at $(p,s)=(1/2,1)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S1.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="proof-outline"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;1.1 &lt;/span&gt;Proof Outline&lt;/h3&gt;
&lt;div id="S1.SS1.p1" class="ltx_para"&gt;
&lt;p id="S1.SS1.p1.1" class="ltx_p"&gt;We use disjoint sets $X,Y\text{,}$ keeping $Y$ fixed and requiring each vertex of $X$ to have at least a fixed positive fraction of $Y$ as red neighbors.
The red target $k$ and the blue target $\ell$ in $Y$ stay fixed while the blue target $t$ in $X$ decreases.
When $X$ is large enough for a conditional bound at density $q\text{,}$ we either finish at red density at least $q$ or descend to a blue neighborhood of size greater than $(1-q)(|X|-1)\text{.}$
Restricting $X$ to this neighborhood preserves its red degrees into $Y$ and reduces $t$ by one: a blue $K_{t-1}$ there extends through the chosen vertex.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS1.p2" class="ltx_para"&gt;
&lt;p id="S1.SS1.p2.1" class="ltx_p"&gt;Write the required size of $X$ at $s=t/k$ as $\exp(kg(s))\text{,}$ with $g$ piecewise affine.
On a cell of slope $d\text{,}$ the threshold falls by a factor $\mathrm{e}^{-d}$ per step, so we take $d&amp;gt;-\log(1-q)$ to allow for the neighborhood loss.
The profile $g$ must also exceed the exponents of the bounds used inside $X\text{.}$
With slopes and calls fixed, optimizing its vertical shift under these conditions and the initial and terminal inequalities gives the cost in &lt;a href="#S3.E12" title="In 3.1 The Cost of a Descent ‣ 3 Retained-Set Descent and Its Cost ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;12&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS1.p3" class="ltx_para"&gt;
&lt;p id="S1.SS1.p3.1" class="ltx_p"&gt;Reusing these bounds and iterating from the source gives a decreasing sequence of exponents whose limit is a greatest fixed point (&lt;a href="#Thmtheorem3" title="Theorem 3 (Finite Proofs and Preserved Lower Bounds). ‣ 4 The Optimum over Finite Proofs ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;).
Strict inequalities persist on neighborhoods of ratios; compactness selects finitely many neighborhoods and hence a common finite depth for a whole descent.
Hence every exponent strictly above the limit has a finite proof, uniformly near its target ratio.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS1.p4" class="ltx_para"&gt;
&lt;p id="S1.SS1.p4.1" class="ltx_p"&gt;For the lower bound, a concave polygon $F$ assigns exponent $F(s)$ at densities up to $1-\mathrm{e}^{-d}$ on a segment of slope $d\text{.}$
Where a descent using bounds that respect this estimate has $g&amp;lt;F\text{,}$ its call density must exceed $1-\mathrm{e}^{-d}\text{,}$ forcing the slope of $g$ above $d\text{.}$
Thus $g-F$ decreases as the descent moves to smaller ratios.
We choose $F$ so that the terminal weighted inequality cannot hold below it.
The supporting-line formula reduces this requirement to one-variable inequalities at its vertices (&lt;a href="#Thmtheorem4" title="Theorem 4 (Finite Polygon Criterion). ‣ 5.1 Elimination of the Terminal Controls ‣ 5 Concave Lower Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;); the certificates in &lt;a href="#S6" title="6 The Diagonal Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt; complete the proof of &lt;a href="#Thmtheorem1" title="Theorem 1. ‣ 1 Introduction ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS1.p5" class="ltx_para"&gt;
&lt;p id="S1.SS1.p5.1" class="ltx_p"&gt;The Lean 4 formalization and the Python code for exact certificate checks are available in the accompanying repository.&lt;span id="footnote1" class="ltx_note ltx_role_footnote"&gt;&lt;sup class="ltx_note_mark"&gt;1&lt;/sup&gt;&lt;span class="ltx_note_outer"&gt;&lt;span class="ltx_note_content"&gt;&lt;sup class="ltx_note_mark"&gt;1&lt;/sup&gt;
&lt;span class="ltx_tag ltx_tag_note"&gt;1&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;a href=&amp;quot;https://github.com/sichen-wang/diagonal-ramsey-numbers&amp;quot; title=&amp;quot;&amp;quot; class=&amp;quot;ltx_ref ltx_url ltx_font_typewriter&amp;quot;&amp;gt;https://github.com/sichen-wang/diagonal-ramsey-numbers&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S2" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="source-bounds"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;2 &lt;/span&gt;Source Bounds&lt;/h2&gt;
&lt;div id="S2.p1" class="ltx_para"&gt;
&lt;p id="S2.p1.1" class="ltx_p"&gt;We now describe the source function and express its bound through pairs $(x,y)\text{.}$
These pairs supply the weighted inequality and the initial conditional bounds used in the descent.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.p2" class="ltx_para"&gt;
&lt;p id="S2.p2.1" class="ltx_p"&gt;All logarithms are natural. Let&lt;/p&gt;
&lt;table id="S2.Ex1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$h(s)=(1+s)\log(1+s)-s\log s,\qquad h(0)=0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.p2.2" class="ltx_p"&gt;The classical Ramsey bound gives $\log R(k,\ell)\leq kh(\ell/k)$ for $1\leq\ell\leq k$ &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx4" title="" class="ltx_ref"&gt;ES&lt;/a&gt;]&lt;/cite&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.p3" class="ltx_para"&gt;
&lt;p id="S2.p3.1" class="ltx_p"&gt;Our fixed source is&lt;/p&gt;
&lt;table id="S2.E3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$f(s)=h(s)+s\mathrm{e}^{-s}P(s)\qquad(0\leq s\leq 1),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(3)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.p3.2" class="ltx_p"&gt;where the piecewise cubic $P$ is specified by the rational partition points, values, and derivatives in &lt;span class="ltx_ref ltx_nolink ltx_path ltx_font_typewriter ltx_ref_self"&gt;data/source.json&lt;/span&gt;.
This source satisfies&lt;/p&gt;
&lt;table id="S2.E4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log R(a,b)\leq af(b/a)+o(a)\qquad(1\leq b\leq a),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(4)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.p3.3" class="ltx_p"&gt;with an error uniform in $b\text{.}$
&lt;a href="#A2" title="Appendix B Admissibility of the Source ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;B&lt;/span&gt;&lt;/a&gt; proves this bound and the properties of $f$ used below.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S2.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="source-pairs-and-supporting-lines"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;2.1 &lt;/span&gt;Source Pairs and Supporting Lines&lt;/h3&gt;
&lt;div id="S2.SS1.p1" class="ltx_para"&gt;
&lt;p id="S2.SS1.p1.1" class="ltx_p"&gt;The weighted inequality uses bounds of the form $R(a,b)\leq x^{-a}y^{-b}\text{.}$
We say that $(x,y)\in(0,1)^{2}$ is an &lt;em id="S2.SS1.p1.1.1" class="ltx_emph ltx_font_italic"&gt;admissible Ramsey pair&lt;/em&gt; if this bound holds for all sufficiently large $a+b\text{.}$
Color symmetry in &lt;a href="#S2.E4" title="In 2 Source Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; leads to the extension&lt;/p&gt;
&lt;table id="S2.Ex2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widehat{f}(t)=\begin{cases}f(t),&amp;amp;0\leq t\leq 1,\\ tf(1/t),&amp;amp;t\geq 1.\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.SS1.p1.2" class="ltx_p"&gt;The source exponent for arbitrary positive targets $a,b$ is then $b\widehat{f}(a/b)\text{.}$
We call $(x,y)\in(0,1)^{2}$ a &lt;em id="S2.SS1.p1.2.1" class="ltx_emph ltx_font_italic"&gt;source pair&lt;/em&gt; if
$b\widehat{f}(a/b)\leq-a\log x-b\log y$ for all $a,b&amp;gt;0\text{,}$ and write $\mathcal{B}_{f}$ for their set.
Every interior point of $\mathcal{B}_{f}$ is admissible: choose a slightly larger pair still in $\mathcal{B}_{f}$ and apply &lt;a href="#S2.E4" title="In 2 Source Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; with color symmetry.
The resulting error is $o(a+b)\text{,}$ which the strict coordinate gaps absorb.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS1.p2" class="ltx_para"&gt;
&lt;p id="S2.SS1.p2.1" class="ltx_p"&gt;Supporting lines give a convenient description of these pairs.
The source verification shows that $f$ is continuous on $[0,1]$ and is $C^{1}$ on $(0,1]\text{,}$ where it is strictly concave and increasing.
It also gives $f(0)=0$ and $2f^{\prime}(1)&amp;gt;f(1)\text{.}$
It follows that $\widehat{f}$ is increasing and concave.
On each smooth piece with $t&amp;gt;1\text{,}$ $\widehat{f}^{\prime\prime}(t)=t^{-3}f^{\prime\prime}(1/t)&amp;lt;0\text{;}$ its first derivative is continuous at the reflected source partition points. At $t=1\text{,}$ the derivative drops from $f^{\prime}(1)$ to $f(1)-f^{\prime}(1)\text{.}$
Strict concavity and $f(0)=0$ give $f(s)-sf^{\prime}(s)&amp;gt;0\text{,}$ so the reflected branch is increasing.
The expression in &lt;a href="#S2.E3" title="In 2 Source Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; gives $\widehat{f}^{\prime}(0+)=\infty\text{,}$ $\widehat{f}^{\prime}(\infty)=0\text{,}$ and $\widehat{f}(t)/t\to 0$ as $t\to\infty\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS1.p3" class="ltx_para"&gt;
&lt;p id="S2.SS1.p3.1" class="ltx_p"&gt;For $A&amp;gt;0\text{,}$ define the intercept of the supporting line with slope $A$ by&lt;/p&gt;
&lt;table id="S2.E5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$b(A)=\sup_{t\geq 0}\{\widehat{f}(t)-At\},\qquad\widehat{f}(t)=\inf_{A&amp;gt;0}\{At+b(A)\}\quad(t&amp;gt;0).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(5)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.SS1.p3.2" class="ltx_p"&gt;For fixed $A&amp;gt;0\text{,}$ $\widehat{f}(t)-At\to-\infty$ as $t\to\infty\text{,}$ while $f(t)/t\to\infty$ as $t\downarrow 0$ makes this expression positive for small positive $t\text{.}$
By continuity, the supremum is positive and attained at some $t&amp;gt;0\text{.}$
At each $t&amp;gt;0\text{,}$ concavity supplies a supporting slope $A&amp;gt;0\text{:}$ use the derivative, or any slope between the one-sided derivatives at $t=1\text{.}$
For this slope $b(A)=\widehat{f}(t)-At\text{,}$ proving the second identity.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS1.p4" class="ltx_para"&gt;
&lt;p id="S2.SS1.p4.1" class="ltx_p"&gt;Writing $x=\mathrm{e}^{-A}$ and $y=\mathrm{e}^{-B}\text{,}$ the source-pair condition becomes $B\geq b(A)\text{,}$ so&lt;/p&gt;
&lt;table id="S2.Ex3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{B}_{f}=\{(\mathrm{e}^{-A},\mathrm{e}^{-B}):A&amp;gt;0,\ B\geq b(A)\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.SS1.p4.2" class="ltx_p"&gt;The finite convex function $b$ is continuous on $A&amp;gt;0\text{,}$ so interior source pairs correspond to $B&amp;gt;b(A)\text{.}$
Taking $(a,b)=(1,s)$ in the support inequality gives&lt;/p&gt;
&lt;table id="S2.E6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$A+sb(A)\geq f(s)\qquad(0&amp;lt;s\leq 1).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(6)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S2.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-weighted-candidate-bound"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;2.2 &lt;/span&gt;The Weighted Candidate Bound&lt;/h3&gt;
&lt;div id="S2.SS2.p1" class="ltx_para"&gt;
&lt;p id="S2.SS2.p1.1" class="ltx_p"&gt;Write $N_{\chi}(v)$ for the neighborhood of $v$ in color $\chi\in\{R,B\}$ and $\deg_{\chi}(v,Z)=|N_{\chi}(v)\cap Z|\text{.}$
For disjoint nonempty vertex sets $X,Y\text{,}$ let $e_{R}(X,Y)$ be the number of red edges between them and write $d_{R}(X,Y)=e_{R}(X,Y)/(|X||Y|)\text{.}$
Following &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx5" title="" class="ltx_ref"&gt;GNNW&lt;/a&gt;]&lt;/cite&gt;, a &lt;em id="S2.SS2.p1.1.1" class="ltx_emph ltx_font_italic"&gt;candidate&lt;/em&gt; is an ordered pair $(X,Y)$ of such sets.
We say that a candidate is &lt;em id="S2.SS2.p1.1.2" class="ltx_emph ltx_font_italic"&gt;$(k,\ell,t)$-good&lt;/em&gt; if $X\cup Y$ contains a red $K_{k}\text{,}$ or $X$ contains a blue $K_{t}\text{,}$ or $Y$ contains a blue $K_{\ell}\text{.}$
The target in the retained set $Y$ is $\ell\text{,}$ while the target $t$ in $X$ may decrease.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmlemma1" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmlemma1.2" class="ltx_text ltx_font_bold"&gt;Lemma 2.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmlemma1.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Weighted Candidate Bound)&lt;span id="S2.Thmlemma1.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmlemma1.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmlemma1.p1.1" class="ltx_p"&gt;&lt;span id="S2.Thmlemma1.p1.1.1" class="ltx_text ltx_font_italic"&gt;Fix $w&amp;gt;0$ and $\mu,p,x,y\in(0,1)$ with $(x,y)\in\operatorname{int}\mathcal{B}_{f}$ and&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.Ex4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$x&amp;lt;(1-\mu)^{w}p^{1/(1-\mu)}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.Thmlemma1.p1.2" class="ltx_p"&gt;&lt;span id="S2.Thmlemma1.p1.2.1" class="ltx_text ltx_font_italic"&gt;For all sufficiently large $\ell\text{,}$ uniformly in positive integers $k,t\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.Ex5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{R}(X,Y)\geq p,\qquad|X|^{w}|Y|\geq x^{-k}y^{-\ell}\mu^{-wt}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.Thmlemma1.p1.3" class="ltx_p"&gt;&lt;span id="S2.Thmlemma1.p1.3.1" class="ltx_text ltx_font_italic"&gt;imply that $(X,Y)$ is $(k,\ell,t)$-good.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS2.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S2.SS2.p2" class="ltx_para"&gt;
&lt;p id="S2.SS2.p2.1" class="ltx_p"&gt;&lt;span id="S2.SS2.p2.1.1" class="ltx_text"&gt;Choose a slightly larger pair $(\widehat{x},\widehat{y})$ still in $\operatorname{int}\mathcal{B}_{f}\text{.}$
Once $\ell$ is large, admissibility guarantees a red $K_{a}$ or a blue $K_{\ell}$ in every vertex set of size at least $\widehat{x}^{-a}\widehat{y}^{-\ell}\text{,}$ uniformly for $a\geq 1\text{.}$
Applying &lt;a href="#A1.Thmlemma1" title="Lemma A.1 (Finite-Host Weighted Candidate Bound). ‣ Appendix A The Finite-Host Weighted Inequality ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;A.1&lt;/span&gt;&lt;/a&gt; with $C=1$ proves the claim.
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S2.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="conditional-bounds"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;2.3 &lt;/span&gt;Conditional Bounds&lt;/h3&gt;
&lt;div id="S2.SS3.p1" class="ltx_para"&gt;
&lt;p id="S2.SS3.p1.1" class="ltx_p"&gt;To reuse a bound during a descent, we need it for an interval of blue-to-red target ratios, with a single size constant and a single threshold for $k\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmlemma2" class="ltx_theorem ltx_theorem_definition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmlemma2.2" class="ltx_text ltx_font_bold"&gt;Definition 2.2&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmlemma2.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Conditional Bound)&lt;span id="S2.Thmlemma2.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmlemma2.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmlemma2.p1.1" class="ltx_p"&gt;For $p\in(0,1)\text{,}$ a compact interval $I\subset(0,1]\text{,}$ and a continuous function $L:I\to(0,\infty)\text{,}$ we say that the &lt;em id="S2.Thmlemma2.p1.1.1" class="ltx_emph ltx_font_italic"&gt;conditional bound&lt;/em&gt; $\mathsf{D}(p,L,I)$ holds if some $C\geq 1,K$ have the following property uniformly for $r\in I$ and integers $k\geq K\text{:}$
a coloring of red density at least $p$ and order at least $C\mathrm{e}^{kL(r)}$ contains a red $K_{k}$ or a blue $K_{\lfloor rk\rfloor}\text{.}$
We choose $K$ so that all blue targets are positive.
For a constant exponent $z\text{,}$ the notation $\mathsf{D}(p,z,I)$ means $L\equiv z\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS3.p2" class="ltx_para"&gt;
&lt;p id="S2.SS3.p2.1" class="ltx_p"&gt;We call $(w,\mu,x,y)$ a &lt;em id="S2.SS3.p2.1.1" class="ltx_emph ltx_font_italic"&gt;strict control at density $p$&lt;/em&gt; when it satisfies the parameter conditions of &lt;a href="#S2.Thmlemma1" title="Lemma 2.1 (Weighted Candidate Bound). ‣ 2.2 The Weighted Candidate Bound ‣ 2 Source Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;.
Write $A=-\log x\text{,}$ $B=-\log y\text{,}$ and $\beta=-\log\mu\text{.}$
Apply the weighted candidate bound with $t=\ell$ to a balanced partition whose red cross-density is at least $p\text{;}$ such a partition exists by averaging.
Both set sizes are a constant fraction of the graph’s order, so the corresponding exponent is&lt;/p&gt;
&lt;table id="S2.E7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$L(r)=\frac{A+rB+wr\beta}{1+w}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(7)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.SS3.p2.2" class="ltx_p"&gt;Choose $y_{1}&amp;gt;y$ with $(x,y_{1})\in\operatorname{int}\mathcal{B}_{f}\text{.}$
For $\ell=\lfloor rk\rfloor$ and a host of order $N\geq\mathrm{e}^{kL(r)}\text{,}$ the partition satisfies&lt;/p&gt;
&lt;table id="S2.Ex6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$|X|^{w}|Y|\geq\frac{x^{-k}y^{-\ell}\mu^{-w\ell}}{3^{w+1}}\geq x^{-k}y_{1}^{-\ell}\mu^{-w\ell}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.SS3.p2.3" class="ltx_p"&gt;The first inequality uses $kr\geq\ell$ and $B+w\beta&amp;gt;0\text{;}$ the second holds once $(y_{1}/y)^{\ell}\geq 3^{w+1}\text{.}$
Applying &lt;a href="#S2.Thmlemma1" title="Lemma 2.1 (Weighted Candidate Bound). ‣ 2.2 The Weighted Candidate Bound ‣ 2 Source Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt; at $(x,y_{1})$ proves $\mathsf{D}(p,L,I)$ with $C=1$ on every compact $I\subset(0,1]\text{.}$
The threshold is uniform in $r\in I\text{,}$ since $\ell\geq k\min I-1\text{.}$
These &lt;em id="S2.SS3.p2.3.1" class="ltx_emph ltx_font_italic"&gt;weighted source bounds&lt;/em&gt; are the starting points of our finite derivations, and we call them &lt;em id="S2.SS3.p2.3.2" class="ltx_emph ltx_font_italic"&gt;source leaves&lt;/em&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S3" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="retained-set-descent-and-its-cost"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;3 &lt;/span&gt;Retained-Set Descent and Its Cost&lt;/h2&gt;
&lt;div id="S3.p1" class="ltx_para"&gt;
&lt;p id="S3.p1.1" class="ltx_p"&gt;We now allow the conditional bound used in $X$ to change as its blue target decreases.
Throughout the descent we keep $\deg_{R}(v,Y)\geq\pi|Y|$ for every $v\in X\text{,}$ for a fixed $\pi\in(0,1)\text{.}$
This gives cross-density at least $\pi$ after every restriction of $X\text{.}$
A positive function $g(s)$ specifies the required size $\exp(kg(s))$ of $X$ at target $t=sk\text{.}$
To use a bound $\mathsf{D}(q,L,I)\text{,}$ we require $g&amp;gt;L$ to absorb its size constant; the slope condition below absorbs the loss in a blue-neighborhood step.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.Thmlemma1" class="ltx_theorem ltx_theorem_definition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmlemma1.2" class="ltx_text ltx_font_bold"&gt;Definition 3.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmlemma1.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Route)&lt;span id="S3.Thmlemma1.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmlemma1.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmlemma1.p1.1" class="ltx_p"&gt;A &lt;em id="S3.Thmlemma1.p1.1.1" class="ltx_emph ltx_font_italic"&gt;route&lt;/em&gt; consists of a partition
$0&amp;lt;\theta=u_{0}&amp;lt;\cdots&amp;lt;u_{m}=\lambda\leq 1$ and, on each closed cell $J_{j}=[u_{j-1},u_{j}]\text{,}$ a proved call $\mathsf{D}(q_{j},L_{j},I_{j})$ with $J_{j}\subseteq I_{j}\text{.}$
It also specifies slopes&lt;/p&gt;
&lt;table id="S3.Ex7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{j}&amp;gt;c(q_{j}):=-\log(1-q_{j})$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.Thmlemma1.p1.2" class="ltx_p"&gt;and a continuous positive function $g\text{,}$ constant on $[0,\theta]$ and affine with slope $d_{j}$ on $J_{j}\text{,}$ such that $g&amp;gt;L_{j}$ on every closed cell.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.p2" class="ltx_para"&gt;
&lt;p id="S3.p2.1" class="ltx_p"&gt;The descent starts at ratio $\lambda$ and stops at $\theta\text{.}$
Write $d(t)$ for the piecewise constant slope on $[\theta,\lambda]\text{,}$ taking the right-hand slope at $\theta$ and internal partition points and the left-hand slope at $\lambda\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem2" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="Thmtheorem2.2" class="ltx_text ltx_font_bold"&gt;Theorem 2&lt;/span&gt;&lt;/span&gt;&lt;span id="Thmtheorem2.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Retained-Set Rule)&lt;span id="Thmtheorem2.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="Thmtheorem2.p1" class="ltx_para"&gt;
&lt;p id="Thmtheorem2.p1.1" class="ltx_p"&gt;&lt;span id="Thmtheorem2.p1.1.1" class="ltx_text ltx_font_italic"&gt;Fix a route as above, an outer density $p\text{,}$ and a row density $0&amp;lt;\pi&amp;lt;p&amp;lt;1\text{.}$
Choose a strict control at density $\pi$ as the route’s &lt;em id="Thmtheorem2.p1.1.1.1" class="ltx_emph ltx_font_upright"&gt;terminal parameters&lt;/em&gt;.
If&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.E8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$z&amp;gt;g(\lambda),\qquad z+wg(\theta)&amp;gt;A+\lambda B+w\theta\beta,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(8)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="Thmtheorem2.p1.2" class="ltx_p"&gt;&lt;span id="Thmtheorem2.p1.2.1" class="ltx_text ltx_font_italic"&gt;then $\mathsf{D}(p,z,\{\lambda\})$ holds with&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.E9" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$C=\frac{3(1-\pi)}{p-\pi}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(9)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="Thmtheorem2.p1.3" class="ltx_p"&gt;&lt;span id="Thmtheorem2.p1.3.1" class="ltx_text ltx_font_italic"&gt;The conclusion is uniform over truncations and vertical shifts of one fixed route when the new endpoint, output exponent, and shift depend continuously on a parameter in a compact set; the stopping ratio, slopes, densities, calls, and terminal controls stay fixed.
At endpoint $r\text{,}$ retain the closed cells $[u_{j-1},\min\{u_{j},r\}]$ with $u_{j-1}&amp;lt;r$ and require positive uniform margins in $g&amp;gt;L_{j}$ and in &lt;a href="#S3.E8" title="In Theorem 2 (Retained-Set Rule). ‣ 3 Retained-Set Descent and Its Cost ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt;.
Such a family may include $r=\theta\text{,}$ with no internal calls.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S3.p3" class="ltx_para"&gt;
&lt;p id="S3.p3.1" class="ltx_p"&gt;&lt;span id="S3.p3.1.1" class="ltx_text"&gt;If $\lambda=\theta\text{,}$ the size tests give&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(1+w)z&amp;gt;z+wg(\theta)&amp;gt;A+\theta B+w\theta\beta.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.p3.2" class="ltx_p"&gt;&lt;span id="S3.p3.2.1" class="ltx_text"&gt;The source leaf at density $\pi$ proves the conclusion at density $p&amp;gt;\pi\text{,}$ with constant $1\leq C\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.p4" class="ltx_para"&gt;
&lt;p id="S3.p4.1" class="ltx_p"&gt;&lt;span id="S3.p4.1.1" class="ltx_text"&gt;Suppose $\theta&amp;lt;\lambda\text{,}$ and take a graph of red density at least $p$ and order $N\geq C\mathrm{e}^{kz}\text{.}$
Averaging gives a balanced partition $X_{0},Y$ with cross-density at least $p$ and both parts of size at least $N/3\text{.}$
Keep in $X_{0}$ only the vertices with at least $\pi|Y|$ red neighbors in $Y\text{.}$
The surviving set $X$ satisfies&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex9" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(p-\pi)|X_{0}||Y|\leq e_{R}(X,Y)-\pi|X||Y|\leq(1-\pi)|X||Y|.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.p4.2" class="ltx_p"&gt;&lt;span id="S3.p4.2.1" class="ltx_text"&gt;The choice of $C$ gives $|X|,|Y|\geq\mathrm{e}^{kz}\text{.}$
Every nonempty subset of $X$ has red cross-density at least $\pi$ with this fixed $Y\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.p5" class="ltx_para"&gt;
&lt;p id="S3.p5.1" class="ltx_p"&gt;&lt;span id="S3.p5.1.1" class="ltx_text"&gt;Put $n_{0}=\lfloor\theta k\rfloor$ and $\ell=\lfloor\lambda k\rfloor\text{,}$ taking $k$ large enough that $n_{0}\geq 1\text{.}$
To track the loss, define for integers $0\leq t\leq\ell$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex10" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Gamma_{k}(t)=kg(\theta)+\sum_{j=n_{0}+1}^{t}d(j/k)\quad(t&amp;gt;n_{0}),\qquad\Gamma_{k}(t)=kg(\theta)\quad(0\leq t\leq n_{0}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.p5.2" class="ltx_p"&gt;&lt;span id="S3.p5.2.1" class="ltx_text"&gt;For $V=d_{1}+\sum_{j&amp;lt;m}|d_{j+1}-d_{j}|\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.E10" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Gamma_{k}(t)-\Gamma_{k}(t-1)=d(t/k)\quad(t&amp;gt;n_{0}),\qquad|\Gamma_{k}(t)-kg(t/k)|\leq V.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(10)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.p5.3" class="ltx_p"&gt;&lt;span id="S3.p5.3.1" class="ltx_text"&gt;For the second bound, express $d$ as its initial step at $\theta$ and its subsequent jumps.
For each unit step, the mesh count differs from $k$ times its integral by at most one, even when a jump lies on the mesh.
Summing the absolute jump sizes gives $V\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.p6" class="ltx_para"&gt;
&lt;p id="S3.p6.1" class="ltx_p"&gt;&lt;span id="S3.p6.1.1" class="ltx_text"&gt;Let $C_{j}$ be the call constants and put&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex11" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\delta=\min_{j}\min_{J_{j}}(g-L_{j})&amp;gt;0,\qquad\eta=\min_{j}(1-q_{j}-\mathrm{e}^{-d_{j}})&amp;gt;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.p6.2" class="ltx_p"&gt;&lt;span id="S3.p6.2.1" class="ltx_text"&gt;Choose $k$ so that $k\delta&amp;gt;V+\max_{j}\log C_{j}$ and $\eta\mathrm{e}^{kg(\theta)}&amp;gt;1\text{,}$ and so that all call and candidate thresholds hold.
We prove by induction on $t=1,\ldots,\ell$ that $(Z,Y)$ is $(k,\ell,t)$-good whenever $Z\subseteq X$ and $|Z|\geq\mathrm{e}^{\Gamma_{k}(t)}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.p7" class="ltx_para"&gt;
&lt;p id="S3.p7.1" class="ltx_p"&gt;&lt;span id="S3.p7.1.1" class="ltx_text"&gt;For $t\leq n_{0}\text{,}$ the terminal test gives&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex12" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log(|Z|^{w}|Y|)\geq k[wg(\theta)+z]&amp;gt;k(A+\lambda B+w\theta\beta)\geq kA+\ell B+wt\beta.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.p7.2" class="ltx_p"&gt;&lt;span id="S3.p7.2.1" class="ltx_text"&gt;Since $d_{R}(Z,Y)\geq\pi\text{,}$ &lt;a href="#S2.Thmlemma1" title="Lemma 2.1 (Weighted Candidate Bound). ‣ 2.2 The Weighted Candidate Bound ‣ 2 Source Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt; applies.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.p8" class="ltx_para"&gt;
&lt;p id="S3.p8.1" class="ltx_p"&gt;&lt;span id="S3.p8.1.1" class="ltx_text"&gt;For $t&amp;gt;n_{0}\text{,}$ put $s=t/k$ and use the cell with assigned slope $d_{j}\text{.}$
If the red density in $Z$ is at least $q_{j}\text{,}$ then
$\log|Z|\geq kg(s)-V&amp;gt;kL_{j}(s)+\log C_{j}\text{.}$
The call gives a red $K_{k}$ or a blue $K_{t}\text{.}$
Otherwise some vertex has a blue neighborhood $Z^{\prime}\subseteq Z$ with&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex13" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$|Z^{\prime}|&amp;gt;(\mathrm{e}^{-d_{j}}+\eta)(|Z|-1)&amp;gt;\mathrm{e}^{-d_{j}}|Z|\geq\mathrm{e}^{\Gamma_{k}(t-1)}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.p8.2" class="ltx_p"&gt;&lt;span id="S3.p8.2.1" class="ltx_text"&gt;The middle inequality follows from $\eta|Z|&amp;gt;1$ and $\mathrm{e}^{-d_{j}}+\eta&amp;lt;1\text{.}$
Induction applies to $(Z^{\prime},Y)\text{.}$
A blue $K_{t-1}$ extends through the chosen vertex; either of the other two outcomes already proves the claim.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.p9" class="ltx_para"&gt;
&lt;p id="S3.p9.1" class="ltx_p"&gt;&lt;span id="S3.p9.1.1" class="ltx_text"&gt;Finally, &lt;a href="#S3.E10" title="In Proof. ‣ 3 Retained-Set Descent and Its Cost ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;10&lt;/span&gt;&lt;/a&gt; and the endpoint test give
$\Gamma_{k}(\ell)\leq kg(\lambda)+V&amp;lt;kz$ for large $k\text{.}$
The claim therefore applies to $Z=X$ at $t=\ell\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.p10" class="ltx_para"&gt;
&lt;p id="S3.p10.1" class="ltx_p"&gt;&lt;span id="S3.p10.1.1" class="ltx_text"&gt;For uniformity, take the minimum stopping height and the minima of the strict gaps over the compact parameter set, and the maxima of the finitely many call thresholds.
The same $V$ bounds every truncated profile, since truncation only removes slope jumps.
These choices give a common threshold for $k\text{;}$ at $\lambda=\theta$ use the fixed source control as above.
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;section id="S3.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-cost-of-a-descent"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.1 &lt;/span&gt;The Cost of a Descent&lt;/h3&gt;
&lt;div id="S3.SS1.p1" class="ltx_para"&gt;
&lt;p id="S3.SS1.p1.1" class="ltx_p"&gt;Fix the partition, calls, slopes, and terminal controls, and vary the vertical position of $g\text{.}$
Put&lt;/p&gt;
&lt;table id="S3.E11" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$S(s)=\int_{s}^{\lambda}d(t)\,dt,\qquad M=\max_{j}\max_{s\in J_{j}}\{L_{j}(s)+S(s)\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(11)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS1.p1.2" class="ltx_p"&gt;The quantity $S(s)$ is the cumulative logarithmic loss in descending from $\lambda$ to $s\text{.}$
Every $g$ with the specified slopes has the form $g(s)=H-S(s)$ on $[\theta,\lambda]\text{.}$
The internal conditions are exactly $H&amp;gt;M\text{;}$ they also make $g$ positive, since $M\geq L_{1}(\theta)+S(\theta)&amp;gt;S(\theta)\text{.}$
The conditions in &lt;a href="#S3.E8" title="In Theorem 2 (Retained-Set Rule). ‣ 3 Retained-Set Descent and Its Cost ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt; now read&lt;/p&gt;
&lt;table id="S3.Ex14" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H&amp;lt;z,\qquad wH+z&amp;gt;A+\lambda B+w\theta\beta+wS(\theta).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS1.p1.3" class="ltx_p"&gt;There is such an $H&amp;gt;M$ exactly when&lt;/p&gt;
&lt;table id="S3.E12" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$z&amp;gt;Z:=\max\left\{M,\frac{A+\lambda B+w\theta\beta+wS(\theta)}{1+w}\right\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(12)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS1.p1.4" class="ltx_p"&gt;Necessity follows from $z&amp;gt;H&amp;gt;M$ and $(1+w)z&amp;gt;z+wH\text{.}$
Conversely, if $z&amp;gt;Z\text{,}$ choose $H&amp;lt;z$ sufficiently close to $z$ to satisfy both inequalities.
Thus $Z$ is the infimum output exponent over these vertical positions.
The term $M$ accounts for every internal call together with the loss needed to reach it; the other term is the least exponent compatible with the weighted terminal inequality.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p2" class="ltx_para"&gt;
&lt;p id="S3.SS1.p2.1" class="ltx_p"&gt;For one call $\mathsf{D}(q,L,[\theta,\lambda])$ with affine $L\text{,}$ choose a slope $d&amp;gt;c(q)\text{.}$
Here $S(s)=d(\lambda-s)\text{,}$ so $L+S$ is affine and its maximum occurs at an endpoint.
Substitution in &lt;a href="#S3.E12" title="In 3.1 The Cost of a Descent ‣ 3 Retained-Set Descent and Its Cost ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;12&lt;/span&gt;&lt;/a&gt; gives&lt;/p&gt;
&lt;table id="S3.Ex15" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$Z=\max\left\{L(\lambda),\ L(\theta)+d(\lambda-\theta),\ \frac{A+\lambda B+w\theta\beta+wd(\lambda-\theta)}{1+w}\right\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS1.p2.2" class="ltx_p"&gt;The first two terms require enough vertices to use the call at both ends of the interval; the second includes all the loss incurred before reaching $\theta\text{.}$
The third requires enough vertices to apply the weighted bound at $\theta\text{.}$
Every $z&amp;gt;Z$ therefore gives a new conditional bound at $\lambda\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S3.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="reuse-on-an-interval"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.2 &lt;/span&gt;Reuse on an Interval&lt;/h3&gt;
&lt;div id="S3.SS2.p1" class="ltx_para"&gt;
&lt;p id="S3.SS2.p1.1" class="ltx_p"&gt;To obtain bounds at smaller target ratios, keep the same calls and terminal controls.
For $\theta\leq r\leq\lambda\text{,}$ restrict the profile $g$ to $[0,r]$ and allow a nonnegative vertical shift.
Such a shift preserves the inequalities $g&amp;gt;L_{j}\text{.}$
The resulting infimum is&lt;/p&gt;
&lt;table id="S3.E13" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$E(r)=\max\left\{g(r),\frac{A+rB+w\{\theta\beta+g(r)-g(\theta)\}}{1+w}\right\},\qquad\theta\leq r\leq\lambda.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(13)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS2.p1.2" class="ltx_p"&gt;For every $\varepsilon&amp;gt;0\text{,}$ the whole family $\mathsf{D}(p,E+\varepsilon,[\theta,\lambda])$ holds with the constant in &lt;a href="#S3.E9" title="In Theorem 2 (Retained-Set Rule). ‣ 3 Retained-Set Descent and Its Cost ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;9&lt;/span&gt;&lt;/a&gt;.
To check strictness uniformly, use the shift
$H_{r}=E(r)-g(r)+\varepsilon/2$ and output $z_{r}=E(r)+\varepsilon\text{.}$
The endpoint gap is $\varepsilon/2\text{,}$ and&lt;/p&gt;
&lt;table id="S3.Ex16" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$z_{r}+w[g(\theta)+H_{r}]-A-rB-w\theta\beta\geq(1+w/2)\varepsilon.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS2.p1.3" class="ltx_p"&gt;&lt;a href="#Thmtheorem2" title="Theorem 2 (Retained-Set Rule). ‣ 3 Retained-Set Descent and Its Cost ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; applies uniformly.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p2" class="ltx_para"&gt;
&lt;p id="S3.SS2.p2.1" class="ltx_p"&gt;A source leaf is affine, and $E$ is the maximum of two affine functions on each affine piece of $g\text{.}$
When a new route uses one of these bounds as a call, refine its cell at the partition points of the called profile.
On each resulting piece, adding the affine loss $S$ preserves convexity.
The maximum in &lt;a href="#S3.E11" title="In 3.1 The Cost of a Descent ‣ 3 Retained-Set Descent and Its Cost ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt; is therefore attained at an endpoint of a call cell or a partition point of the called profile inside that cell.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S4" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="the-optimum-over-finite-proofs"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;4 &lt;/span&gt;The Optimum over Finite Proofs&lt;/h2&gt;
&lt;div id="S4.p1" class="ltx_para"&gt;
&lt;p id="S4.p1.1" class="ltx_p"&gt;We keep the source $\mathcal{B}_{f}$ fixed and minimize over all finite repetitions of the retained-set rule.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmlemma1" class="ltx_theorem ltx_theorem_definition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmlemma1.2" class="ltx_text ltx_font_bold"&gt;Definition 4.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmlemma1.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Finite Proof)&lt;span id="S4.Thmlemma1.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmlemma1.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmlemma1.p1.1" class="ltx_p"&gt;A &lt;em id="S4.Thmlemma1.p1.1.1" class="ltx_emph ltx_font_italic"&gt;finite proof&lt;/em&gt; is a finite derivation of conditional bounds using the following rules:&lt;/p&gt;
&lt;ol id="S4.I1" class="ltx_enumerate"&gt;
&lt;li id="S4.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;1.&lt;/span&gt;
&lt;div id="S4.I1.i1.p1" class="ltx_para"&gt;
&lt;p id="S4.I1.i1.p1.1" class="ltx_p"&gt;Start with a weighted source bound from &lt;a href="#S2.E7" title="In 2.3 Conditional Bounds ‣ 2 Source Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S4.I1.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;2.&lt;/span&gt;
&lt;div id="S4.I1.i2.p1" class="ltx_para"&gt;
&lt;p id="S4.I1.i2.p1.1" class="ltx_p"&gt;Apply &lt;a href="#Thmtheorem2" title="Theorem 2 (Retained-Set Rule). ‣ 3 Retained-Set Descent and Its Cost ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; with previously derived conditional bounds as its calls, including its uniform families.&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S4.I1.i3" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;3.&lt;/span&gt;
&lt;div id="S4.I1.i3.p1" class="ltx_para"&gt;
&lt;p id="S4.I1.i3.p1.1" class="ltx_p"&gt;Restrict to a closed ratio interval, increase the density, or increase the continuous exponent function pointwise.&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S4.I1.i4" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;4.&lt;/span&gt;
&lt;div id="S4.I1.i4.p1" class="ltx_para"&gt;
&lt;p id="S4.I1.i4.p1.1" class="ltx_p"&gt;Combine finitely many bounds: on a finite closed cover of a compact ratio interval, use a continuous output that dominates a proved family at the same density on each cover interval.&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.p2" class="ltx_para"&gt;
&lt;p id="S4.p2.1" class="ltx_p"&gt;Taking the maximum of the constants and thresholds validates the last rule.
Let $U_{\rm fin}(p,s)$ be the infimum of the exponents obtained at $(p,s)$ by these finite proofs.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.p3" class="ltx_para"&gt;
&lt;p id="S4.p3.1" class="ltx_p"&gt;To compare these proofs across all finite depths, first let $U_{0}(p,s)$ be the infimum over source leaves alone.
It is finite: take $w=1\text{,}$ $\mu=1/2\text{,}$ $A&amp;gt;\log 2-2\log p\text{,}$ and $B&amp;gt;b(A)\text{.}$
These strict controls give $0\leq U_{0}(p,s)&amp;lt;\infty\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.p4" class="ltx_para"&gt;
&lt;p id="S4.p4.1" class="ltx_p"&gt;To treat all possible descents at once, let $u(p,s)$ specify the required exponent for a call at $(p,s)\text{.}$
Order these functions pointwise and consider the complete lattice
$\mathcal{L}=\{u:(0,1)\times(0,1]\to\mathbb{R}:0\leq u\leq U_{0}\}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.p5" class="ltx_para"&gt;
&lt;p id="S4.p5.1" class="ltx_p"&gt;Define $T(u)(p,\lambda)$ as the infimum of $U_{0}(p,\lambda)$ and all $z&amp;gt;0$ admitted by the following data:
a finite partition $0&amp;lt;\theta=u_{0}&amp;lt;\cdots&amp;lt;u_{m}=\lambda\text{,}$ densities $q_{j}\in(0,1)\text{,}$ slopes $d_{j}&amp;gt;c(q_{j})\text{,}$ and a continuous positive function $g\text{,}$ affine with slope $d_{j}$ on each $J_{j}$ and constant on $[0,\theta]\text{,}$ such that&lt;/p&gt;
&lt;table id="S4.E14" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$g(s)&amp;gt;u(q_{j},s)\qquad(s\in J_{j}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(14)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.p5.2" class="ltx_p"&gt;The terminal parameters form a strict control at some row density $0&amp;lt;\pi&amp;lt;p$ and satisfy &lt;a href="#S3.E8" title="In Theorem 2 (Retained-Set Rule). ‣ 3 Retained-Set Descent and Its Cost ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt;.
All data are finite and fixed before $k$ is chosen.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.p6" class="ltx_para"&gt;
&lt;p id="S4.p6.1" class="ltx_p"&gt;The operator is monotone: decreasing the internal requirements can only add feasible routes.
Its output is nonincreasing in the outer density $p\text{,}$ since any leaf or route valid at $p$ remains valid at a larger density.
Set&lt;/p&gt;
&lt;table id="S4.Ex17" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$U_{n+1}=T(U_{n}),\qquad U_{\infty}=\inf_{n\geq 0}U_{n}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S4.p7" class="ltx_para"&gt;
&lt;p id="S4.p7.1" class="ltx_p"&gt;We say that $v\in\mathcal{L}$ is a &lt;em id="S4.p7.1.1" class="ltx_emph ltx_font_italic"&gt;lower bound preserved by the rules&lt;/em&gt; if $v\leq T(v)\text{.}$
In standard order terminology, such a function is a &lt;em id="S4.p7.1.2" class="ltx_emph ltx_font_italic"&gt;post-fixed point&lt;/em&gt; of $T\text{.}$
Equivalently, every leaf and every route using internal requirements $v$ has output at least $v\text{.}$
Here a proof on a relative neighborhood of $s$ means a conditional bound on a compact ratio interval containing that neighborhood.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem3" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="Thmtheorem3.2" class="ltx_text ltx_font_bold"&gt;Theorem 3&lt;/span&gt;&lt;/span&gt;&lt;span id="Thmtheorem3.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Finite Proofs and Preserved Lower Bounds)&lt;span id="Thmtheorem3.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="Thmtheorem3.p1" class="ltx_para"&gt;
&lt;p id="Thmtheorem3.p1.1" class="ltx_p"&gt;&lt;span id="Thmtheorem3.p1.1.1" class="ltx_text ltx_font_italic"&gt;The sequence $U_{n}$ decreases to the greatest fixed point $U_{\infty}$ of $T$ in $\mathcal{L}\text{,}$ and&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.E15" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$U_{\rm fin}(p,s)=U_{\infty}(p,s)=\sup_{\begin{subarray}{c}v\in\mathcal{L}\\ v\leq T(v)\end{subarray}}v(p,s).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(15)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="Thmtheorem3.p1.2" class="ltx_p"&gt;&lt;span id="Thmtheorem3.p1.2.1" class="ltx_text ltx_font_italic"&gt;Every $z&amp;gt;U_{\infty}(p,s)$ has a finite proof with constant output $z$ on a relative neighborhood of $s\text{,}$ with uniform constants.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.p8" class="ltx_para"&gt;
&lt;p id="S4.p8.1" class="ltx_p"&gt;The order comparison is the classical greatest-fixed-point principle &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx9" title="" class="ltx_ref"&gt;Tarski&lt;/a&gt;, Theorem 1]&lt;/cite&gt;.
Strict inequalities and compactness also identify the limit with finite conditional proofs, including the uniformity required for their reuse.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.p9" class="ltx_para"&gt;
&lt;p id="S4.p9.1" class="ltx_p"&gt;&lt;span id="S4.p9.1.1" class="ltx_text"&gt;Since $T(U_{0})\leq U_{0}\text{,}$ monotonicity gives $U_{n+1}\leq U_{n}\text{.}$
By induction on $n\text{,}$ we prove both that each ratio section $U_{n}(p,\cdot)$ is upper semicontinuous and that every $z&amp;gt;U_{n}(p,s)$ has a finite proof with constant output $z$ on a relative neighborhood of $s\text{.}$
Upper semicontinuity means that a strict inequality $U_{n}(p,s)&amp;lt;a$ persists near $s\text{.}$
At level zero, both conclusions follow by choosing a continuous source leaf strictly below $z\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.p10" class="ltx_para"&gt;
&lt;p id="S4.p10.1" class="ltx_p"&gt;&lt;span id="S4.p10.1.1" class="ltx_text"&gt;Suppose the claim holds at level $n\text{,}$ and let $z&amp;gt;U_{n+1}(p,\lambda)\text{.}$
Choose a leaf or a formal route against $U_{n}$ with output $z^{\prime}&amp;lt;z\text{.}$
A leaf again gives both conclusions by continuity.
For a route, truncate or extend its last affine cell, keeping the density and slope.
Upper semicontinuity preserves $g&amp;gt;U_{n}(q_{m},\cdot)$ near $\lambda\text{,}$ and the strict endpoint and terminal tests persist by continuity.
Thus the same output $z^{\prime}$ is feasible for nearby endpoints, proving $U_{n+1}(p,r)&amp;lt;z$ there.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.p11" class="ltx_para"&gt;
&lt;p id="S4.p11.1" class="ltx_p"&gt;&lt;span id="S4.p11.1.1" class="ltx_text"&gt;Choose a compact interval of endpoints within this range that contains a relative neighborhood of $\lambda\text{.}$
To replace the formal calls by finite proofs, consider the call cells up to the largest endpoint in this neighborhood.
At each point $s$ of a cell with density $q_{j}\text{,}$ choose&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex18" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$U_{n}(q_{j},s)&amp;lt;z_{s}&amp;lt;g(s).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.p11.2" class="ltx_p"&gt;&lt;span id="S4.p11.2.1" class="ltx_text"&gt;The induction hypothesis gives a finite proof with constant output $z_{s}$ near $s\text{.}$
Shrink this neighborhood until $z_{s}&amp;lt;g$ throughout.
Compactness gives a finite subcover of each cell.
Subdivide into closed subcells contained in these neighborhoods and use the corresponding proofs, with the original density and slope.
The calls and their strict inequalities also hold at every shared endpoint.
There are finitely many subcells, so their positive gaps have a common positive lower bound.
The uniform part of &lt;a href="#Thmtheorem2" title="Theorem 2 (Retained-Set Rule). ‣ 3 Retained-Set Descent and Its Cost ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; now gives a finite proof with constant output $z$ on the chosen endpoint neighborhood.
This completes the induction.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.p12" class="ltx_para"&gt;
&lt;p id="S4.p12.1" class="ltx_p"&gt;&lt;span id="S4.p12.1.1" class="ltx_text"&gt;We next show that $U_{\infty}$ is fixed.
Monotonicity gives $T(U_{\infty})\leq U_{n+1}$ for every $n\text{,}$ hence $T(U_{\infty})\leq U_{\infty}\text{.}$
For the reverse inequality, take a route feasible against $U_{\infty}\text{.}$
On each closed cell $J_{j}\text{,}$ the sets&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex19" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$O_{n}=\{s\in J_{j}:U_{n}(q_{j},s)&amp;lt;g(s)\}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.p12.2" class="ltx_p"&gt;&lt;span id="S4.p12.2.1" class="ltx_text"&gt;are relatively open, increase with $n\text{,}$ and cover $J_{j}\text{.}$
Compactness and nesting give a common $N$ with $O_{N}=J_{j}$ on every cell.
The route is therefore feasible against $U_{N}\text{,}$ so its output is at least $U_{N+1}\geq U_{\infty}\text{.}$
The leaf alternative is also at least $U_{\infty}\text{.}$
Taking infima gives $T(U_{\infty})=U_{\infty}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.p13" class="ltx_para"&gt;
&lt;p id="S4.p13.1" class="ltx_p"&gt;&lt;span id="S4.p13.1.1" class="ltx_text"&gt;If $v\in\mathcal{L}$ and $v\leq T(v)\text{,}$ then $v\leq U_{0}$ and&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex20" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$v\leq U_{n}\quad\Longrightarrow\quad v\leq T(v)\leq T(U_{n})=U_{n+1}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.p13.2" class="ltx_p"&gt;&lt;span id="S4.p13.2.1" class="ltx_text"&gt;Hence $v\leq U_{\infty}\text{.}$
As $U_{\infty}$ is itself fixed, it is the greatest post-fixed point.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.p14" class="ltx_para"&gt;
&lt;p id="S4.p14.1" class="ltx_p"&gt;&lt;span id="S4.p14.1.1" class="ltx_text"&gt;Every finite proof has output at least $U_{\infty}\text{,}$ by induction through its rules.
This holds for leaves since $U_{0}\geq U_{\infty}\text{.}$
A route whose calls are at least $U_{\infty}$ is feasible against $U_{\infty}\text{,}$ so its output is at least $T(U_{\infty})=U_{\infty}\text{.}$
The case $\lambda=\theta$ reduces to a leaf.
Restriction, increasing the exponent, and finite patching preserve the comparison.
Increasing the density does too, since $U_{\infty}$ is nonincreasing in that density.
Thus $U_{\rm fin}\geq U_{\infty}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.p15" class="ltx_para"&gt;
&lt;p id="S4.p15.1" class="ltx_p"&gt;&lt;span id="S4.p15.1.1" class="ltx_text"&gt;Conversely, every $z&amp;gt;U_{\infty}(p,s)$ exceeds $U_{n}(p,s)$ for some finite $n\text{.}$
The local proof constructed above gives $U_{\rm fin}\leq U_{\infty}$ and the claimed uniformity.
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S5" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="concave-lower-bounds"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;5 &lt;/span&gt;Concave Lower Bounds&lt;/h2&gt;
&lt;div id="S5.p1" class="ltx_para"&gt;
&lt;p id="S5.p1.1" class="ltx_p"&gt;We construct a function $v\leq T(v)\text{,}$ giving the lower estimate by &lt;a href="#Thmtheorem3" title="Theorem 3 (Finite Proofs and Preserved Lower Bounds). ‣ 4 The Optimum over Finite Proofs ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;.
Its exponent will be a &lt;em id="S5.p1.1.1" class="ltx_emph ltx_font_italic"&gt;concave polygon&lt;/em&gt;: a continuous piecewise affine concave function $F:[0,1]\to\mathbb{R}\text{.}$
Write its partition points and values as&lt;/p&gt;
&lt;table id="S5.Ex21" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$0=s_{0}&amp;lt;s_{1}&amp;lt;\cdots&amp;lt;s_{N}=1,\qquad F_{i}=F(s_{i}),\qquad F_{0}=0,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.p1.2" class="ltx_p"&gt;and suppose the slopes $d_{i}=(F_{i}-F_{i-1})/(s_{i}-s_{i-1})$ satisfy
$d_{1}\geq\cdots\geq d_{N}&amp;gt;0\text{.}$
A call at density $q&amp;gt;1-\mathrm{e}^{-d_{i}}$ requires a route slope greater than $c(q)&amp;gt;d_{i}\text{.}$
This relation suggests using $1-\mathrm{e}^{-d_{i}}$ as the density up to which $F$ gives a lower bound.
Define&lt;/p&gt;
&lt;table id="S5.Ex22" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$p_{F}(s)=1-\mathrm{e}^{-d_{i}}\quad(s_{i-1}&amp;lt;s\leq s_{i}),\qquad v_{F}(p,s)=\begin{cases}F(s),&amp;amp;p\leq p_{F}(s),\\ 0,&amp;amp;p&amp;gt;p_{F}(s).\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.p1.3" class="ltx_p"&gt;At each $s_{i}&amp;gt;0\text{,}$ $p_{F}$ uses the slope of the segment ending there.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.Thmlemma1" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmlemma1.2" class="ltx_text ltx_font_bold"&gt;Proposition 5.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmlemma1.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(A Preserved Lower Bound)&lt;span id="S5.Thmlemma1.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmlemma1.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmlemma1.p1.1" class="ltx_p"&gt;&lt;span id="S5.Thmlemma1.p1.1.1" class="ltx_text ltx_font_italic"&gt;Suppose every strict terminal control of row density at most $p_{F}(\lambda)$ satisfies&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.E16" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F(\lambda)+wF(\theta)\leq A+\lambda B+w\theta\beta\qquad(0\leq\theta\leq\lambda\leq 1,\ \lambda&amp;gt;0).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(16)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.Thmlemma1.p1.2" class="ltx_p"&gt;&lt;span id="S5.Thmlemma1.p1.2.1" class="ltx_text ltx_font_italic"&gt;Then $v_{F}\leq U_{\infty}\text{.}$
If $d_{N}\geq\log 2\text{,}$ in particular $F(1)\leq U_{\infty}(1/2,1)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S5.p2" class="ltx_para"&gt;
&lt;p id="S5.p2.1" class="ltx_p"&gt;&lt;span id="S5.p2.1.1" class="ltx_text"&gt;Taking $\theta=\lambda$ in &lt;a href="#S5.E16" title="In Proposition 5.1 (A Preserved Lower Bound). ‣ 5 Concave Lower Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;16&lt;/span&gt;&lt;/a&gt; shows that every source leaf at density $p\leq p_{F}(\lambda)$ has exponent at least $F(\lambda)\text{.}$
Thus $0\leq v_{F}\leq U_{0}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.p3" class="ltx_para"&gt;
&lt;p id="S5.p3.1" class="ltx_p"&gt;&lt;span id="S5.p3.1.1" class="ltx_text"&gt;Consider a route feasible against $v_{F}$ at density $p\leq p_{F}(\lambda)\text{,}$ with output $z&amp;lt;F(\lambda)\text{.}$
Its endpoint satisfies $g(\lambda)&amp;lt;F(\lambda)\text{.}$
Refine the call partition at the points $s_{i}\text{.}$
On a resulting cell $[a,b]\text{,}$ let $\ell_{j}$ and $d_{i}$ be the slopes of $g$ and $F\text{.}$
If $g(b)&amp;lt;F(b)\text{,}$ the closed call condition forces $q_{j}&amp;gt;p_{F}(b)=1-\mathrm{e}^{-d_{i}}\text{,}$ since $p_{F}$ uses the left slope at $b\text{.}$
Consequently $\ell_{j}&amp;gt;c(q_{j})&amp;gt;d_{i}\text{,}$ and&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex23" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$g(a)-F(a)=g(b)-F(b)-(\ell_{j}-d_{i})(b-a)&amp;lt;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.p3.2" class="ltx_p"&gt;&lt;span id="S5.p3.2.1" class="ltx_text"&gt;Starting at $\lambda$ and applying this implication backward through the finite partition gives $g(\theta)&amp;lt;F(\theta)\text{.}$
The row density satisfies $\pi&amp;lt;p\leq p_{F}(\lambda)\text{,}$ so &lt;a href="#S5.E16" title="In Proposition 5.1 (A Preserved Lower Bound). ‣ 5 Concave Lower Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;16&lt;/span&gt;&lt;/a&gt; now contradicts
$z+wg(\theta)&amp;gt;A+\lambda B+w\theta\beta\text{.}$
Every route and leaf therefore has output at least $v_{F}\text{,}$ giving $v_{F}\leq T(v_{F})\text{.}$
Apply &lt;a href="#Thmtheorem3" title="Theorem 3 (Finite Proofs and Preserved Lower Bounds). ‣ 4 The Optimum over Finite Proofs ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;; the final assertion follows from $p_{F}(1)\geq 1/2\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;section id="S5.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="elimination-of-the-terminal-controls"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.1 &lt;/span&gt;Elimination of the Terminal Controls&lt;/h3&gt;
&lt;div id="S5.SS1.p1" class="ltx_para"&gt;
&lt;p id="S5.SS1.p1.1" class="ltx_p"&gt;At each positive partition point, we maximize over the stopping ratio and combine the terminal inequalities with the supporting-line formula.
This gives a test in the single parameter $\mu\text{.}$
For $0&amp;lt;\mu&amp;lt;1\text{,}$ write $\tau=-\log(1-\mu)$ and $\beta=-\log\mu\text{,}$ and define&lt;/p&gt;
&lt;table id="S5.E17" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi(\lambda,z,\kappa,\mu)=\frac{1-\mu}{\kappa}\left[z-\lambda\widehat{f}\!\left(\frac{1-\kappa}{\lambda}\right)\right],\qquad\lambda&amp;gt;0,\quad 0&amp;lt;\kappa&amp;lt;1.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(17)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem4" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="Thmtheorem4.2" class="ltx_text ltx_font_bold"&gt;Theorem 4&lt;/span&gt;&lt;/span&gt;&lt;span id="Thmtheorem4.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Finite Polygon Criterion)&lt;span id="Thmtheorem4.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="Thmtheorem4.p1" class="ltx_para"&gt;
&lt;p id="Thmtheorem4.p1.1" class="ltx_p"&gt;&lt;span id="Thmtheorem4.p1.1.1" class="ltx_text ltx_font_italic"&gt;Suppose $F$ is as above and&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.E18" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$0&amp;lt;F_{i}&amp;lt;\min\{f(s_{i}),h(s_{i})\}\qquad(1\leq i\leq N).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(18)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="Thmtheorem4.p1.2" class="ltx_p"&gt;&lt;span id="Thmtheorem4.p1.2.1" class="ltx_text ltx_font_italic"&gt;For each $\mu\in(0,1)$ define&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.E19" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$D_{i}(\beta)=\max_{0\leq j\leq i}(F_{j}-s_{j}\beta),\qquad\kappa_{i}=D_{i}(\beta)/\tau,\qquad P_{i}=-\log(1-\mathrm{e}^{-d_{i}}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(19)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="Thmtheorem4.p1.3" class="ltx_p"&gt;&lt;span id="Thmtheorem4.p1.3.1" class="ltx_text ltx_font_italic"&gt;If, for every $i$ and every $\mu$ with $D_{i}(\beta)&amp;gt;0\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.E20" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi(s_{i},F_{i},\kappa_{i},\mu)\leq P_{i},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(20)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="Thmtheorem4.p1.4" class="ltx_p"&gt;&lt;span id="Thmtheorem4.p1.4.1" class="ltx_text ltx_font_italic"&gt;then $v_{F}\leq U_{\infty}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.SS1.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S5.SS1.p2" class="ltx_para"&gt;
&lt;p id="S5.SS1.p2.1" class="ltx_p"&gt;&lt;span id="S5.SS1.p2.1.1" class="ltx_text"&gt;At endpoint $s_{i}\text{,}$ the function $F(\theta)-\theta\beta$ is affine between consecutive partition points, so&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex24" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\max_{0\leq\theta\leq s_{i}}\{F(\theta)-\theta\beta\}=D_{i}(\beta).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS1.p2.2" class="ltx_p"&gt;&lt;span id="S5.SS1.p2.2.1" class="ltx_text"&gt;Concavity of $h$ and &lt;a href="#S5.E18" title="In Theorem 4 (Finite Polygon Criterion). ‣ 5.1 Elimination of the Terminal Controls ‣ 5 Concave Lower Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;18&lt;/span&gt;&lt;/a&gt; put $F(\theta)$ strictly below $h(\theta)$ for $\theta&amp;gt;0\text{.}$
The minimum of $\tau+\theta\beta$ over $0&amp;lt;\mu&amp;lt;1$ occurs at $\mu=\theta/(1+\theta)$ and equals $h(\theta)\text{.}$
Thus&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex25" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F(\theta)&amp;lt;h(\theta)\leq\tau+\theta\beta\qquad(\theta&amp;gt;0).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS1.p2.3" class="ltx_p"&gt;&lt;span id="S5.SS1.p2.3.1" class="ltx_text"&gt;The term at $\theta=0$ is zero, so $0\leq D_{i}(\beta)&amp;lt;\tau\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS1.p3" class="ltx_para"&gt;
&lt;p id="S5.SS1.p3.1" class="ltx_p"&gt;&lt;span id="S5.SS1.p3.1.1" class="ltx_text"&gt;Fix a strict control at row density $\pi\leq 1-\mathrm{e}^{-d_{i}}$ and put $P_{\pi}=-\log\pi\geq P_{i}\text{.}$
If the terminal inequality fails at $\lambda=s_{i}$ for some stopping ratio, then&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex26" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$wD_{i}&amp;gt;A+s_{i}B-F_{i}&amp;gt;0,\qquad A&amp;gt;w\tau+\frac{P_{\pi}}{1-\mu}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS1.p3.2" class="ltx_p"&gt;&lt;span id="S5.SS1.p3.2.1" class="ltx_text"&gt;Here $A+s_{i}B-F_{i}&amp;gt;0$ because $A+s_{i}B\geq f(s_{i})&amp;gt;F_{i}\text{.}$
In particular $0&amp;lt;\kappa_{i}=D_{i}/\tau&amp;lt;1\text{.}$
Multiplying the second inequality by $\kappa_{i}$ and using the first gives&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex27" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(1-\kappa_{i})A+s_{i}B&amp;lt;F_{i}-\frac{\kappa_{i}P_{\pi}}{1-\mu}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS1.p3.3" class="ltx_p"&gt;&lt;span id="S5.SS1.p3.3.1" class="ltx_text"&gt;Since $B&amp;gt;b(A)\text{,}$ the supporting-line formula &lt;a href="#S2.E5" title="In 2.1 Source Pairs and Supporting Lines ‣ 2 Source Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; gives&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex28" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$s_{i}\widehat{f}\!\left(\frac{1-\kappa_{i}}{s_{i}}\right)\leq(1-\kappa_{i})A+s_{i}B.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS1.p3.4" class="ltx_p"&gt;&lt;span id="S5.SS1.p3.4.1" class="ltx_text"&gt;Combining these inequalities yields
$P_{\pi}&amp;lt;\Psi(s_{i},F_{i},\kappa_{i},\mu)\leq P_{i}\text{,}$ a contradiction.
Thus &lt;a href="#S5.E16" title="In Proposition 5.1 (A Preserved Lower Bound). ‣ 5 Concave Lower Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;16&lt;/span&gt;&lt;/a&gt; holds for every stopping ratio at each positive partition point.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS1.p4" class="ltx_para"&gt;
&lt;p id="S5.SS1.p4.1" class="ltx_p"&gt;&lt;span id="S5.SS1.p4.1.1" class="ltx_text"&gt;Now fix controls at row density at most $1-\mathrm{e}^{-d_{i}}$ and let $\lambda\in[s_{i-1},s_{i}]\text{.}$
Since $F$ is affine on this interval,&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex29" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\max_{0\leq\theta\leq\lambda}\{F(\theta)-\theta\beta\}=\max\{D_{i-1}(\beta),\ F(\lambda)-\lambda\beta\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS1.p4.2" class="ltx_p"&gt;&lt;span id="S5.SS1.p4.2.1" class="ltx_text"&gt;where $D_{0}=0\text{.}$
The largest terminal difference over all stopping ratios is therefore&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex30" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F(\lambda)-A-\lambda B+w\max\{D_{i-1}(\beta),\ F(\lambda)-\lambda\beta\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS1.p4.3" class="ltx_p"&gt;&lt;span id="S5.SS1.p4.3.1" class="ltx_text"&gt;This is convex in $\lambda\text{,}$ being affine plus a positive multiple of a maximum of two affine functions.
It is nonpositive at $s_{i}$ by the inequality already proved there.
The same holds at $s_{i-1}&amp;gt;0$ because the left slope of $F$ there is at least $d_{i}\text{;}$ at zero the value is $-A&amp;lt;0\text{.}$
Convexity gives &lt;a href="#S5.E16" title="In Proposition 5.1 (A Preserved Lower Bound). ‣ 5 Concave Lower Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;16&lt;/span&gt;&lt;/a&gt; throughout the interval.
Apply &lt;a href="#S5.Thmlemma1" title="Proposition 5.1 (A Preserved Lower Bound). ‣ 5 Concave Lower Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.1&lt;/span&gt;&lt;/a&gt;.
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S5.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-full-control-interval"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.2 &lt;/span&gt;The Full Control Interval&lt;/h3&gt;
&lt;div id="S5.SS2.p1" class="ltx_para"&gt;
&lt;p id="S5.SS2.p1.1" class="ltx_p"&gt;For the supplied polygon, the remaining variable is $\tau\in(0,\infty)\text{,}$ with
$\mu=1-\mathrm{e}^{-\tau}$ and $\beta(\tau)=-\log(1-\mathrm{e}^{-\tau})\text{.}$
We verify the criterion analytically near zero and infinity, leaving a compact interval for the finite computation.
Let $L=1/10$ and $H=10\text{.}$
The supplied data satisfy&lt;/p&gt;
&lt;table id="S5.E21" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\beta(L)&amp;gt;d_{1},\qquad\beta(H)&amp;lt;F_{N}/2,\qquad F_{N}&amp;lt;H,\qquad 2H\mathrm{e}^{-H}&amp;lt;P_{1}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(21)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS2.p1.2" class="ltx_p"&gt;For $\tau\leq L\text{,}$ concavity gives $F_{j}\leq d_{1}s_{j}&amp;lt;\beta s_{j}$ for $j&amp;gt;0\text{,}$ so $D_{i}=0\text{.}$
For $\tau\geq H\text{,}$ concavity gives $F_{i}/s_{i}\geq F_{N}$ and hence
$D_{i}\geq F_{i}-s_{i}\beta\geq F_{i}/2\text{.}$
Also $D_{i}\leq F_{N}&amp;lt;\tau\text{.}$
The source term in &lt;a href="#S5.E17" title="In 5.1 Elimination of the Terminal Controls ‣ 5 Concave Lower Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;17&lt;/span&gt;&lt;/a&gt; is nonnegative, so&lt;/p&gt;
&lt;table id="S5.Ex31" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi(s_{i},F_{i},\kappa_{i},\mu)\leq\mathrm{e}^{-\tau}\frac{F_{i}\tau}{D_{i}}\leq 2\tau\mathrm{e}^{-\tau}\leq 2H\mathrm{e}^{-H}&amp;lt;P_{1}\leq P_{i}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.SS2.p1.3" class="ltx_p"&gt;Thus only the closed interval $[L,H]$ requires subdivision.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS2.p2" class="ltx_para"&gt;
&lt;p id="S5.SS2.p2.1" class="ltx_p"&gt;On each control cell, outward interval arithmetic first encloses $\beta\text{.}$
The function $D_{i}$ is nonincreasing in $\beta\text{,}$ so its two endpoint evaluations enclose the finite maximum in &lt;a href="#S5.E19" title="In Theorem 4 (Finite Polygon Criterion). ‣ 5.1 Elimination of the Terminal Controls ‣ 5 Concave Lower Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;19&lt;/span&gt;&lt;/a&gt;.
The source $\widehat{f}$ increases, so its endpoint values enclose the source term in &lt;a href="#S5.E17" title="In 5.1 Elimination of the Terminal Controls ‣ 5 Concave Lower Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;17&lt;/span&gt;&lt;/a&gt;.
A cell is accepted if it proves $D_{i}=0$ throughout, or a nonpositive numerator in &lt;a href="#S5.E17" title="In 5.1 Elimination of the Terminal Controls ‣ 5 Concave Lower Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;17&lt;/span&gt;&lt;/a&gt; wherever $D_{i}&amp;gt;0\text{.}$
Points with $D_{i}=0$ already satisfy the terminal condition, since $F_{i}&amp;lt;A+s_{i}B\text{.}$
Otherwise the checker requires a positive lower bound for $\kappa_{i}$ before division, and accepts the cell only if it proves $P_{i}-\Psi&amp;gt;0\text{.}$
All other cells are subdivided.
The checker verifies an exact closed cover of $[L,H]$ for every positive partition point.
&lt;a href="#Thmtheorem4" title="Theorem 4 (Finite Polygon Criterion). ‣ 5.1 Elimination of the Terminal Controls ‣ 5 Concave Lower Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; then covers all weights, source supports, stopping ratios, endpoint ratios, and finite depths.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S6" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="the-diagonal-bounds"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;6 &lt;/span&gt;The Diagonal Bounds&lt;/h2&gt;
&lt;div id="S6.p1" class="ltx_para"&gt;
&lt;p id="S6.p1.1" class="ltx_p"&gt;We now evaluate the two sides of &lt;a href="#S4.E15" title="In Theorem 3 (Finite Proofs and Preserved Lower Bounds). ‣ 4 The Optimum over Finite Proofs ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;15&lt;/span&gt;&lt;/a&gt;.
The repository specifies the source, a finite upper proof, and a rational lower polygon, with the following complete interval covers.&lt;/p&gt;
&lt;table id="S6.p1.2" class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle"&gt;
&lt;thead class="ltx_thead"&gt;
&lt;tr id="S6.p1.2.1" class="ltx_tr"&gt;
&lt;th id="S6.p1.2.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_th_row ltx_border_tt"&gt;Construction&lt;/th&gt;
&lt;th id="S6.p1.2.1.2" class="ltx_td ltx_align_right ltx_th ltx_th_column ltx_border_tt"&gt;Size&lt;/th&gt;
&lt;th id="S6.p1.2.1.3" class="ltx_td ltx_align_right ltx_th ltx_th_column ltx_border_tt"&gt;Checked Cells&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody class="ltx_tbody"&gt;
&lt;tr id="S6.p1.2.2" class="ltx_tr"&gt;
&lt;th id="S6.p1.2.2.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t"&gt;Source profile&lt;/th&gt;
&lt;td id="S6.p1.2.2.2" class="ltx_td ltx_align_right ltx_border_t"&gt;2,279 cubic pieces&lt;/td&gt;
&lt;td id="S6.p1.2.2.3" class="ltx_td ltx_align_right ltx_border_t"&gt;12,319&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S6.p1.2.3" class="ltx_tr"&gt;
&lt;th id="S6.p1.2.3.1" class="ltx_td ltx_align_left ltx_th ltx_th_row"&gt;Upper proof&lt;/th&gt;
&lt;td id="S6.p1.2.3.2" class="ltx_td ltx_align_right"&gt;2,932 routes; depth 27&lt;/td&gt;
&lt;td id="S6.p1.2.3.3" class="ltx_td ltx_align_right"&gt;1,065,279&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S6.p1.2.4" class="ltx_tr"&gt;
&lt;th id="S6.p1.2.4.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb"&gt;Lower polygon&lt;/th&gt;
&lt;td id="S6.p1.2.4.2" class="ltx_td ltx_align_right ltx_border_bb"&gt;2,048 affine pieces&lt;/td&gt;
&lt;td id="S6.p1.2.4.3" class="ltx_td ltx_align_right ltx_border_bb"&gt;853,082&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S6.p2" class="ltx_para"&gt;
&lt;p id="S6.p2.1" class="ltx_p"&gt;The source inequalities are evaluated at 224 fractional binary bits, and the upper and lower inequalities at both 224 and 320 bits.
An independent integer-prefix computation reproduces every route height and loss from the checked primitive enclosures.
The repository contains the four rational inputs in &lt;span class="ltx_ref ltx_nolink ltx_path ltx_font_typewriter ltx_ref_self"&gt;data/&lt;/span&gt;, the Python certificate checker in &lt;span class="ltx_ref ltx_nolink ltx_path ltx_font_typewriter ltx_ref_self"&gt;proof/&lt;/span&gt;, and the Lean formalization in &lt;span class="ltx_ref ltx_nolink ltx_path ltx_font_typewriter ltx_ref_self"&gt;lean/&lt;/span&gt;.
The Python checker uses only the standard library. Running &lt;span id="S6.p2.1.1" class="ltx_text ltx_font_typewriter"&gt;python proof/replay.py --workers 16&lt;/span&gt; from the repository root writes the results and input and code hashes to &lt;span class="ltx_ref ltx_nolink ltx_path ltx_font_typewriter ltx_ref_self"&gt;proof/build/replay/&lt;/span&gt;.
The root &lt;span class="ltx_ref ltx_nolink ltx_path ltx_font_typewriter ltx_ref_self"&gt;README.md&lt;/span&gt; gives the build and reproduction instructions for both projects.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S6.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="exact-interval-arithmetic"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;6.1 &lt;/span&gt;Exact Interval Arithmetic&lt;/h3&gt;
&lt;div id="S6.SS1.p1" class="ltx_para"&gt;
&lt;p id="S6.SS1.p1.1" class="ltx_p"&gt;Transcendental quantities are enclosed by intervals whose endpoints are integers divided by a fixed power of two. Rational inputs and arithmetic operations are rounded outward. For logarithms, reduce to $y\in[1,2]$ and put $u=(y-1)/(y+1)\in[0,1/3]\text{.}$ Then&lt;/p&gt;
&lt;table id="S6.E22" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log y=2\sum_{j=0}^{m-1}\frac{u^{2j+1}}{2j+1}+E_{m},\qquad 0\leq E_{m}\leq\frac{3u^{2m+1}}{2m+1}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(22)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS1.p1.2" class="ltx_p"&gt;The tail is at most $2u^{2m+1}/((2m+1)(1-u^{2}))\text{.}$ The same formula encloses $\log 2$ for reversing the scaling.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS1.p2" class="ltx_para"&gt;
&lt;p id="S6.SS1.p2.1" class="ltx_p"&gt;For the exponential, put $S_{m}(z)=\sum_{j=0}^{m}z^{j}/j!$ for integers $m\geq 0\text{.}$
Successive terms after degree $m$ have ratio at most $z/(m+2)\text{,}$ so a geometric sum gives&lt;/p&gt;
&lt;table id="S6.E23" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$S_{m}(z)&amp;lt;\mathrm{e}^{z}\leq S_{m}(z)+\frac{z^{m+1}}{(m+1)!}\frac{1}{1-z/(m+2)}\qquad(0&amp;lt;z&amp;lt;m+2).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(23)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS1.p2.2" class="ltx_p"&gt;At zero the sum is exact.
The interval backend reduces a nonnegative argument to $0\leq y\leq 1/8\text{,}$ where this tail is at most $2y^{m+1}/(m+1)!\text{.}$
Repeated squaring reverses the scaling; negative arguments use outward reciprocals.
A logarithm or division is accepted only after its domain is checked.
For the final exponential bound, a separate rational calculation applies &lt;a href="#S6.E23" title="In 6.1 Exact Interval Arithmetic ‣ 6 The Diagonal Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;23&lt;/span&gt;&lt;/a&gt; directly with $m=140$ and compares the upper enclosure with $3.69507\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S6.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="a-finite-upper-proof"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;6.2 &lt;/span&gt;A Finite Upper Proof&lt;/h3&gt;
&lt;div id="S6.SS2.p1" class="ltx_para"&gt;
&lt;p id="S6.SS2.p1.1" class="ltx_p"&gt;The file &lt;span class="ltx_ref ltx_nolink ltx_path ltx_font_typewriter ltx_ref_self"&gt;data/upper.json&lt;/span&gt; contains an ordered list of routes.
A call names either a weighted source bound or an earlier route with a terminal control.
All 2,932 routes are reachable from the root.
The density, height, and output margins are all $10^{-12}\text{;}$ rounding is upward to multiples of $10^{-12}\text{.}$
The source pairs use the inward factor $1-10^{-9}\text{,}$ and we put $\rho=1-2\cdot 10^{-5}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS2.p2" class="ltx_para"&gt;
&lt;p id="S6.SS2.p2.1" class="ltx_p"&gt;For each control, let $\pi$ be its leaf density when it defines a source bound, and $\rho p$ when it ends a route at outer density $p\text{.}$
The checker computes&lt;/p&gt;
&lt;table id="S6.Ex32" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$x_{\rm cap}=(1-\mu)^{w}\pi^{1/(1-\mu)}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS2.p2.2" class="ltx_p"&gt;and an explicit boundary pair $(\xi,\zeta)$ with $\xi\geq x_{\rm cap}\text{.}$
It uses $x=(1-10^{-9})x_{\rm cap}$ and $y=(1-10^{-9})\zeta\text{.}$
Both coordinates are strictly below a supporting pair, and $x&amp;lt;x_{\rm cap}\text{,}$ so the control is strict.
Source supports are given explicitly in the data and checked by interval inequalities.
For a source leaf, the coefficients $A/(1+w)$ and $(B+w\beta)/(1+w)$ are rounded upward, giving a rational affine upper bound for &lt;a href="#S2.E7" title="In 2.3 Conditional Bounds ‣ 2 Source Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS2.p3" class="ltx_para"&gt;
&lt;p id="S6.SS2.p3.1" class="ltx_p"&gt;For a reused child with stored profile $g$ and stopping ratio $\theta\text{,}$ upward enclosures of its terminal parameters give rational coefficients&lt;/p&gt;
&lt;table id="S6.Ex33" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$a^{+}\geq\frac{A+w\theta\beta}{1+w},\qquad b^{+}\geq\frac{B}{1+w},\qquad t^{+}\geq\frac{w}{1+w}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS2.p3.2" class="ltx_p"&gt;Its called family is&lt;/p&gt;
&lt;table id="S6.Ex34" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\max\{g(s),\ a^{+}+b^{+}s+t^{+}(g(s)-g(\theta))\}+10^{-12}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS2.p3.3" class="ltx_p"&gt;This dominates &lt;a href="#S3.E13" title="In 3.2 Reuse on an Interval ‣ 3 Retained-Set Descent and Its Cost ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;13&lt;/span&gt;&lt;/a&gt; with a strict allowance; rounding $t^{+}$ upward is valid because $g(s)-g(\theta)\geq 0\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS2.p4" class="ltx_para"&gt;
&lt;p id="S6.SS2.p4.1" class="ltx_p"&gt;With these calls established, the parent route can be evaluated.
Each slope is an upward-rounded enclosure of $c(q_{j})+10^{-12}\text{,}$ so the sums defining $S$ are rational.
The endpoint rule in &lt;a href="#S3.E11" title="In 3.1 The Cost of a Descent ‣ 3 Retained-Set Descent and Its Cost ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt; gives $M$ by checking the parent cell endpoints and the child profiles’ partition points inside each cell.
With $Q=10^{12}\text{,}$ the parent stores&lt;/p&gt;
&lt;table id="S6.Ex35" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H=\frac{\lceil Q(M+10^{-12})\rceil}{Q},\qquad g=H-S.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS2.p4.2" class="ltx_p"&gt;The checker also verifies the full partitions, density implications, child-domain containment, and strict ordering of child indices.
Induction through the ordered list and &lt;a href="#Thmtheorem2" title="Theorem 2 (Retained-Set Rule). ‣ 3 Retained-Set Descent and Its Cost ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; prove all its conditional families.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS2.p5" class="ltx_para"&gt;
&lt;p id="S6.SS2.p5.1" class="ltx_p"&gt;The root has&lt;/p&gt;
&lt;table id="S6.Ex36" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$p=\tfrac{1}{2},\qquad\pi=\tfrac{1}{2}-10^{-5},\qquad\theta=\tfrac{1}{4},\qquad\lambda=1,\qquad w=1,\qquad\mu=\tfrac{1}{4}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS2.p5.2" class="ltx_p"&gt;It has 65 cells and uses the left source support in &lt;span class="ltx_ref ltx_nolink ltx_path ltx_font_typewriter ltx_ref_self"&gt;data/upper.json&lt;/span&gt;, at $t\approx 0.383\text{.}$
Exact reconstruction gives $g(1)&amp;gt;1.3\text{,}$ while the second term in &lt;a href="#S3.E13" title="In 3.2 Reuse on an Interval ‣ 3 Retained-Set Descent and Its Cost ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;13&lt;/span&gt;&lt;/a&gt; is less than $1.2\text{.}$
Adding the output margin yields the constant conditional exponent&lt;/p&gt;
&lt;table id="S6.Ex37" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$z_{+}=g(1)+10^{-12}=\frac{1306998938417}{10^{12}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS2.p5.3" class="ltx_p"&gt;Thus $U_{\infty}(1/2,1)\leq z_{+}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S6.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-lower-polygon"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;6.3 &lt;/span&gt;The Lower Polygon&lt;/h3&gt;
&lt;div id="S6.SS3.p1" class="ltx_para"&gt;
&lt;p id="S6.SS3.p1.1" class="ltx_p"&gt;The file &lt;span class="ltx_ref ltx_nolink ltx_path ltx_font_typewriter ltx_ref_self"&gt;data/lower.json&lt;/span&gt; specifies the 2,049 rational partition points and values of $F\text{.}$
Exact rational comparisons establish positive decreasing slopes and $F(0)=0\text{.}$
Interval comparisons establish &lt;a href="#S5.E18" title="In Theorem 4 (Finite Polygon Criterion). ‣ 5.1 Elimination of the Terminal Controls ‣ 5 Concave Lower Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;18&lt;/span&gt;&lt;/a&gt;, the tail bounds in &lt;a href="#S5.E21" title="In 5.2 The Full Control Interval ‣ 5 Concave Lower Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;21&lt;/span&gt;&lt;/a&gt;, and $d_{N}&amp;gt;\log 2\text{.}$
The 853,082 closed control cells verify &lt;a href="#S5.E20" title="In Theorem 4 (Finite Polygon Criterion). ‣ 5.1 Elimination of the Terminal Controls ‣ 5 Concave Lower Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;20&lt;/span&gt;&lt;/a&gt;.
&lt;a href="#Thmtheorem4" title="Theorem 4 (Finite Polygon Criterion). ‣ 5.1 Elimination of the Terminal Controls ‣ 5 Concave Lower Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S5.Thmlemma1" title="Proposition 5.1 (A Preserved Lower Bound). ‣ 5 Concave Lower Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.1&lt;/span&gt;&lt;/a&gt; therefore give&lt;/p&gt;
&lt;table id="S6.Ex38" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$z_{-}:=F(1)=\frac{1305460275532}{10^{12}}\leq U_{\infty}(1/2,1).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S6.SS3.p2" class="ltx_para"&gt;
&lt;p id="S6.SS3.p2.1" class="ltx_p"&gt;The resulting interval for the finite-proof optimum has width less than $0.0016\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS3.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of &lt;a href="#Thmtheorem1" title="Theorem 1. ‣ 1 Introduction ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;.&lt;/h6&gt;
&lt;div id="S6.SS3.p3" class="ltx_para"&gt;
&lt;p id="S6.SS3.p3.1" class="ltx_p"&gt;&lt;span id="S6.SS3.p3.1.1" class="ltx_text"&gt;The finite upper proof and the preserved polygon give &lt;a href="#S1.E1" title="In Theorem 1. ‣ 1 Introduction ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; by &lt;a href="#Thmtheorem3" title="Theorem 3 (Finite Proofs and Preserved Lower Bounds). ‣ 4 The Optimum over Finite Proofs ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;.
In an arbitrary two-coloring, interchange the colors so that red has density at least $1/2$ and apply the root conditional bound.
Its constant is&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex39" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{3(1-\pi)}{1/2-\pi}=150003,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.SS3.p3.2" class="ltx_p"&gt;&lt;span id="S6.SS3.p3.2.1" class="ltx_text"&gt;which proves &lt;a href="#S1.E2" title="In Theorem 1. ‣ 1 Introduction ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;.
An independent rational Taylor enclosure gives $\mathrm{e}^{z_{+}}&amp;lt;3.69507\text{.}$
This strict gap absorbs the fixed factor and the ceiling for sufficiently large $k\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_pagination ltx_role_newpage"&gt;&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="bib" class="ltx_bibliography"&gt;
&lt;h2 class="ltx_title ltx_title_bibliography" id="references"&gt;References&lt;/h2&gt;
&lt;ul class="ltx_biblist"&gt;
&lt;li id="bib.bibx1" class="ltx_bibitem ltx_align_left"&gt;&lt;span class="ltx_tag ltx_tag_bibitem"&gt;[CGMS]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; M. Campos, S. Griffiths, R. Morris, and J. Sahasrabudhe, An exponential improvement for diagonal Ramsey, &lt;em id="bib.bibx1.2" class="ltx_emph ltx_font_italic"&gt;Annals of Mathematics&lt;/em&gt; &lt;span id="bib.bibx1.3" class="ltx_text ltx_font_bold"&gt;203&lt;/span&gt; (2026), no. 3, 869–932. &lt;a href="https://doi.org/10.4007/annals.2026.203.3.4" title="" class="ltx_ref ltx_url ltx_font_typewriter"&gt;https://doi.org/10.4007/annals.2026.203.3.4&lt;/a&gt;.
&lt;p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/p&gt;
&lt;li id="bib.bibx2" class="ltx_bibitem ltx_align_left"&gt;&lt;span class="ltx_tag ltx_tag_bibitem"&gt;[Con]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; D. Conlon, A new upper bound for diagonal Ramsey numbers, &lt;em id="bib.bibx2.2" class="ltx_emph ltx_font_italic"&gt;Annals of Mathematics&lt;/em&gt; &lt;span id="bib.bibx2.3" class="ltx_text ltx_font_bold"&gt;170&lt;/span&gt; (2009), no. 2, 941–960. &lt;a href="https://doi.org/10.4007/annals.2009.170.941" title="" class="ltx_ref ltx_url ltx_font_typewriter"&gt;https://doi.org/10.4007/annals.2009.170.941&lt;/a&gt;.
&lt;p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/p&gt;
&lt;li id="bib.bibx3" class="ltx_bibitem ltx_align_left"&gt;&lt;span class="ltx_tag ltx_tag_bibitem"&gt;[Er]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; P. Erdős, Some remarks on the theory of graphs, &lt;em id="bib.bibx3.2" class="ltx_emph ltx_font_italic"&gt;Bulletin of the American Mathematical Society&lt;/em&gt; &lt;span id="bib.bibx3.3" class="ltx_text ltx_font_bold"&gt;53&lt;/span&gt; (1947), 292–294. &lt;a href="https://doi.org/10.1090/S0002-9904-1947-08785-1" title="" class="ltx_ref ltx_url ltx_font_typewriter"&gt;https://doi.org/10.1090/S0002-9904-1947-08785-1&lt;/a&gt;.
&lt;p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/p&gt;
&lt;li id="bib.bibx4" class="ltx_bibitem ltx_align_left"&gt;&lt;span class="ltx_tag ltx_tag_bibitem"&gt;[ES]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; P. Erdős and G. Szekeres, A combinatorial problem in geometry, &lt;em id="bib.bibx4.2" class="ltx_emph ltx_font_italic"&gt;Compositio Mathematica&lt;/em&gt; &lt;span id="bib.bibx4.3" class="ltx_text ltx_font_bold"&gt;2&lt;/span&gt; (1935), 463–470. &lt;a href="https://www.numdam.org/item/CM_1935__2__463_0/" title="" class="ltx_ref ltx_url ltx_font_typewriter"&gt;https://www.numdam.org/item/CM_1935__2__463_0/&lt;/a&gt;.
&lt;p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/p&gt;
&lt;li id="bib.bibx5" class="ltx_bibitem ltx_align_left"&gt;&lt;span class="ltx_tag ltx_tag_bibitem"&gt;[GNNW]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; P. Gupta, Ndiamé Ndiaye, S. Norin, and L. Wei, &lt;em id="bib.bibx5.2" class="ltx_emph ltx_font_italic"&gt;Optimizing the CGMS upper bound on Ramsey numbers&lt;/em&gt;, arXiv:2407.19026v2, revised 29 August 2026. &lt;a href="https://arxiv.org/abs/2407.19026v2" title="" class="ltx_ref ltx_url ltx_font_typewriter"&gt;https://arxiv.org/abs/2407.19026v2&lt;/a&gt;.
&lt;p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/p&gt;
&lt;li id="bib.bibx6" class="ltx_bibitem ltx_align_left"&gt;&lt;span class="ltx_tag ltx_tag_bibitem"&gt;[Ram]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; F. P. Ramsey, On a problem of formal logic, &lt;em id="bib.bibx6.2" class="ltx_emph ltx_font_italic"&gt;Proceedings of the London Mathematical Society&lt;/em&gt; (2) &lt;span id="bib.bibx6.3" class="ltx_text ltx_font_bold"&gt;30&lt;/span&gt; (1930), 264–286. &lt;a href="https://doi.org/10.1112/plms/s2-30.1.264" title="" class="ltx_ref ltx_url ltx_font_typewriter"&gt;https://doi.org/10.1112/plms/s2-30.1.264&lt;/a&gt;.
&lt;p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/p&gt;
&lt;li id="bib.bibx7" class="ltx_bibitem ltx_align_left"&gt;&lt;span class="ltx_tag ltx_tag_bibitem"&gt;[Sah]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; A. Sah, Diagonal Ramsey via effective quasirandomness, &lt;em id="bib.bibx7.2" class="ltx_emph ltx_font_italic"&gt;Duke Mathematical Journal&lt;/em&gt; &lt;span id="bib.bibx7.3" class="ltx_text ltx_font_bold"&gt;172&lt;/span&gt; (2023), no. 3, 545–567. &lt;a href="https://doi.org/10.1215/00127094-2022-0048" title="" class="ltx_ref ltx_url ltx_font_typewriter"&gt;https://doi.org/10.1215/00127094-2022-0048&lt;/a&gt;.
&lt;p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/p&gt;
&lt;li id="bib.bibx8" class="ltx_bibitem ltx_align_left"&gt;&lt;span class="ltx_tag ltx_tag_bibitem"&gt;[Spe]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; J. Spencer, Ramsey’s theorem—a new lower bound, &lt;em id="bib.bibx8.2" class="ltx_emph ltx_font_italic"&gt;Journal of Combinatorial Theory, Series A&lt;/em&gt; &lt;span id="bib.bibx8.3" class="ltx_text ltx_font_bold"&gt;18&lt;/span&gt; (1975), 108–115. &lt;a href="https://doi.org/10.1016/0097-3165(75)90071-0" title="" class="ltx_ref ltx_url ltx_font_typewriter"&gt;https://doi.org/10.1016/0097-3165(75)90071-0&lt;/a&gt;.
&lt;p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/p&gt;
&lt;li id="bib.bibx9" class="ltx_bibitem ltx_align_left"&gt;&lt;span class="ltx_tag ltx_tag_bibitem"&gt;[Tarski]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; A. Tarski, A lattice-theoretical fixpoint theorem and its applications, &lt;em id="bib.bibx9.2" class="ltx_emph ltx_font_italic"&gt;Pacific Journal of Mathematics&lt;/em&gt; &lt;span id="bib.bibx9.3" class="ltx_text ltx_font_bold"&gt;5&lt;/span&gt; (1955), 285–309. &lt;a href="https://msp.org/pjm/1955/5-2/pjm-v5-n2-p11-s.pdf" title="" class="ltx_ref ltx_url ltx_font_typewriter"&gt;https://msp.org/pjm/1955/5-2/pjm-v5-n2-p11-s.pdf&lt;/a&gt;.
&lt;p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/p&gt;
&lt;li id="bib.bibx10" class="ltx_bibitem ltx_align_left"&gt;&lt;span class="ltx_tag ltx_tag_bibitem"&gt;[Tho]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; A. Thomason, An upper bound for some Ramsey numbers, &lt;em id="bib.bibx10.2" class="ltx_emph ltx_font_italic"&gt;Journal of Graph Theory&lt;/em&gt; &lt;span id="bib.bibx10.3" class="ltx_text ltx_font_bold"&gt;12&lt;/span&gt; (1988), no. 4, 509–517. &lt;a href="https://doi.org/10.1002/jgt.3190120406" title="" class="ltx_ref ltx_url ltx_font_typewriter"&gt;https://doi.org/10.1002/jgt.3190120406&lt;/a&gt;.
&lt;p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/p&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;div class="ltx_pagination ltx_role_newpage"&gt;&lt;/div&gt;
&lt;section id="A1" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="the-finite-host-weighted-inequality"&gt;&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix A &lt;/span&gt;The Finite-Host Weighted Inequality&lt;/h2&gt;
&lt;div id="A1.p1" class="ltx_para"&gt;
&lt;p id="A1.p1.1" class="ltx_p"&gt;We prove the estimate used in &lt;a href="#S2.Thmlemma1" title="Lemma 2.1 (Weighted Candidate Bound). ‣ 2.2 The Weighted Candidate Bound ‣ 2 Source Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;.
Its stopping assumption concerns only proper subsets of the host.
This lets the same estimate prove the source bound by a smallest-counterexample argument in &lt;a href="#A2" title="Appendix B Admissibility of the Source ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;B&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A1.Thmlemma1" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="A1.Thmlemma1.2" class="ltx_text ltx_font_bold"&gt;Lemma A.1&lt;/span&gt;&lt;/span&gt;&lt;span id="A1.Thmlemma1.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Finite-Host Weighted Candidate Bound)&lt;span id="A1.Thmlemma1.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="A1.Thmlemma1.p1" class="ltx_para"&gt;
&lt;p id="A1.Thmlemma1.p1.1" class="ltx_p"&gt;&lt;span id="A1.Thmlemma1.p1.1.1" class="ltx_text ltx_font_italic"&gt;Fix $w&amp;gt;0$ and parameters in $(0,1)$ satisfying&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.Ex40" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$x_{0}&amp;lt;\widehat{x},\qquad y_{0}&amp;lt;\widehat{y},\qquad x_{0}&amp;lt;(1-\mu_{0})^{w}p^{1/(1-\mu_{0})}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.Thmlemma1.p1.2" class="ltx_p"&gt;&lt;span id="A1.Thmlemma1.p1.2.1" class="ltx_text ltx_font_italic"&gt;There is $L_{0}\text{,}$ depending only on these parameters, with the following property, uniformly in $C\geq 1$ and the finite host coloring $H\text{.}$ Fix $\ell\geq L_{0}\text{,}$ and suppose that for every integer $a\geq 1\text{,}$ every proper subset $Z\subsetneq V(H)$ of size&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.E24" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$|Z|\geq C\widehat{x}^{-a}\widehat{y}^{-\ell}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(24)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.Thmlemma1.p1.3" class="ltx_p"&gt;&lt;span id="A1.Thmlemma1.p1.3.1" class="ltx_text ltx_font_italic"&gt;contains a red $K_{a}$ or a blue $K_{\ell}\text{.}$ Then, for all $k,t\geq 1\text{,}$ every candidate in $H$ satisfying&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.E25" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{R}(X,Y)\geq p,\qquad|X|^{w}|Y|\geq C^{w+1}x_{0}^{-k}y_{0}^{-\ell}\mu_{0}^{-wt}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(25)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.Thmlemma1.p1.4" class="ltx_p"&gt;&lt;span id="A1.Thmlemma1.p1.4.1" class="ltx_text ltx_font_italic"&gt;is $(k,\ell,t)$-good.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A1.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A1.p2" class="ltx_para"&gt;
&lt;p id="A1.p2.1" class="ltx_p"&gt;&lt;span id="A1.p2.1.1" class="ltx_text"&gt;We adapt the candidate induction of &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx5" title="" class="ltx_ref"&gt;GNNW&lt;/a&gt;, Lemma 12]&lt;/cite&gt; to unequal weights. After removing rows with too few red neighbors, we either pass to a common blue neighborhood or choose a vertex whose red or blue child satisfies the induction hypothesis. A power of the excess red density controls the size loss in these steps.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A1.p3" class="ltx_para"&gt;
&lt;p id="A1.p3.1" class="ltx_p"&gt;&lt;span id="A1.p3.1.1" class="ltx_text"&gt;Choose a fixed integer $r&amp;gt;\max\{1,w\}$ so large that $p^{1/r}&amp;gt;\mu_{0}$ and&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.Ex41" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$x_{0}&amp;lt;(p^{1/r}-\mu_{0})^{r}(1-\mu_{0})^{w-r}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p3.2" class="ltx_p"&gt;&lt;span id="A1.p3.2.1" class="ltx_text"&gt;The logarithm of the right side tends to $w\log(1-\mu_{0})+\log p/(1-\mu_{0})\text{.}$ The function&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.Ex42" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$x_{0}^{1/r}(1-q)^{1-w/r}+\mu_{0}^{w/r}q^{1-w/r}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p3.3" class="ltx_p"&gt;&lt;span id="A1.p3.3.1" class="ltx_text"&gt;increases until $q=\mu_{0}/(\mu_{0}+x_{0}^{1/w})&amp;gt;\mu_{0}\text{,}$ and is less than $p^{1/r}$ at $q=\mu_{0}\text{.}$ By continuity choose&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.Ex43" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$x_{0}&amp;lt;x&amp;lt;\widehat{x},\quad y_{0}&amp;lt;y&amp;lt;\widehat{y},\quad\mu_{0}&amp;lt;\mu&amp;lt;\beta&amp;lt;1,\quad 0&amp;lt;\delta&amp;lt;p/2,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p3.4" class="ltx_p"&gt;&lt;span id="A1.p3.4.1" class="ltx_text"&gt;and $\gamma&amp;gt;0$ so that, with $\bar{p}=p-\delta\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.E26" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\max_{0\leq q\leq\beta}\{x^{1/r}(1-q)^{1-w/r}+\mu^{w/r}q^{1-w/r}\}\leq(1-\gamma)\bar{p}^{1/r}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(26)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p3.5" class="ltx_p"&gt;&lt;span id="A1.p3.5.1" class="ltx_text"&gt;All these choices precede $C,H,k,\ell,t\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A1.p4" class="ltx_para"&gt;
&lt;p id="A1.p4.1" class="ltx_p"&gt;&lt;span id="A1.p4.1.1" class="ltx_text"&gt;Put $n=k+t\text{,}$ $\delta_{n}=\delta/n\text{,}$ and induct on $n\text{,}$ for fixed sufficiently large $\ell\text{,}$ using the stronger hypothesis&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.E27" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{R}(X,Y)\geq p-\delta_{n},\qquad Q_{n}=(d_{R}(X,Y)-p+\delta_{n})^{r}|X|^{w}|Y|\geq C^{w+1}x^{-k}y^{-\ell}\mu^{-wt}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(27)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p4.2" class="ltx_p"&gt;&lt;span id="A1.p4.2.1" class="ltx_text"&gt;After canceling $C^{w+1}\text{,}$ the conditions in &lt;a href="#A1.E25" title="In Lemma A.1 (Finite-Host Weighted Candidate Bound). ‣ Appendix A The Finite-Host Weighted Inequality ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;25&lt;/span&gt;&lt;/a&gt; imply this once $\ell$ is large, uniformly in $k,t\text{,}$ because&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.Ex44" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(\delta/n)^{r}(x/x_{0})^{k}(y/y_{0})^{\ell}(\mu/\mu_{0})^{wt}\geq 1.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p4.3" class="ltx_p"&gt;&lt;span id="A1.p4.3.1" class="ltx_text"&gt;The factors involving $k,t$ grow exponentially in $n\text{,}$ so their ratio to $n^{r}$ has a positive infimum; increasing $\ell$ makes the inequality hold. If $k=1$ or $t=1\text{,}$ any vertex of $X$ suffices. Henceforth $k,t\geq 2\text{,}$ and the density excess lies in $(0,1)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A1.p5" class="ltx_para"&gt;
&lt;p id="A1.p5.1" class="ltx_p"&gt;&lt;em id="A1.p5.1.1" class="ltx_emph ltx_font_italic"&gt;Regularize and stop if $Y$ is large.&lt;/em&gt;&lt;span id="A1.p5.1.2" class="ltx_text"&gt;
Delete rows of red degree less than $(p-\delta_{n})|Y|\text{.}$ The excess edge count $E=e_{R}(X,Y)-(p-\delta_{n})|X||Y|$ increases, and&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.Ex45" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$Q_{n}=E^{r}|X|^{w-r}|Y|^{1-r}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p5.2" class="ltx_p"&gt;&lt;span id="A1.p5.2.1" class="ltx_text"&gt;does not decrease, since $r&amp;gt;w\text{.}$ Positive excess prevents deletion of the last row. Every nonempty $T\subseteq X$ now has $d_{R}(T,Y)\geq p-\delta_{n}\text{.}$
If $|Y|\geq C\widehat{x}^{-k}\widehat{y}^{-\ell}\text{,}$ apply the stopping assumption with $a=k\text{;}$ $Y$ is proper because $X\neq\varnothing\text{.}$ Otherwise $Q_{n}\leq|X|^{w}|Y|$ implies&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.E28" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$|X|^{w}&amp;gt;C^{w}(\widehat{x}/x)^{k}(\widehat{y}/y)^{\ell}\mu^{-wt},\qquad|X|\geq C\exp(c(k+\ell+t))$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(28)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p5.3" class="ltx_p"&gt;&lt;span id="A1.p5.3.1" class="ltx_text"&gt;for a fixed $c&amp;gt;0\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A1.p6" class="ltx_para"&gt;
&lt;p id="A1.p6.1" class="ltx_p"&gt;&lt;em id="A1.p6.1.1" class="ltx_emph ltx_font_italic"&gt;Find a common blue neighborhood or a suitable vertex.&lt;/em&gt;&lt;span id="A1.p6.1.2" class="ltx_text"&gt;
Define&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.Ex46" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$b=\left\lceil\frac{2r\log n+r\log(1/\delta)+w\log 2}{w\log(\beta/\mu)}\right\rceil,\qquad m=\lceil 10\beta^{-1}b^{2}\rceil,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p6.2" class="ltx_p"&gt;&lt;span id="A1.p6.2.1" class="ltx_text"&gt;and $W=\{v\in X:\deg_{B}(v,X)\geq\beta|X|\}\text{.}$ Put $\xi_{n}=\delta/(2n^{2})\text{.}$
We choose $L_{0}$ once so that&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.Ex47" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$|X|\geq 5m^{2},\qquad R(k,m)&amp;lt;\bar{p}\xi_{n}|X|,\qquad\frac{2n^{2}}{\delta|X|}&amp;lt;\gamma.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p6.3" class="ltx_p"&gt;&lt;span id="A1.p6.3.1" class="ltx_text"&gt;To justify a uniform choice, note that $b=O(\log n)\text{,}$ $m=O((\log n)^{2})\text{,}$ and
$R(k,m)\leq\binom{k+m-2}{m-1}\leq k^{m-1}\text{;}$ the last inequality counts nondecreasing tuples in $\{1,\ldots,k\}^{m-1}\text{.}$
The logarithm of each required lower bound on $|X|$ is therefore $O((\log n)^{3})\text{.}$
Subtracting $cn$ leaves a function bounded above in $n\text{,}$ so &lt;a href="#A1.E28" title="In Proof. ‣ Appendix A The Finite-Host Weighted Inequality ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;28&lt;/span&gt;&lt;/a&gt; supplies all three bounds for one $L_{0}\text{,}$ independently of $C\geq 1,k,t\text{.}$
We use the common-neighborhood averaging argument of &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx5" title="" class="ltx_ref"&gt;GNNW&lt;/a&gt;, Lemma 9]&lt;/cite&gt;.
When $|W|\geq R(k,m)\text{,}$ either a red $K_{k}$ finishes the proof, or $W$ contains a blue $m$-clique $U\text{.}$ Put $N_{X}=|X|\text{.}$ The blue density $\sigma$ between $U$ and $X\setminus U$ satisfies&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.Ex48" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sigma\geq\frac{\beta N_{X}-m}{N_{X}-m}=\beta-\frac{(1-\beta)m}{N_{X}-m}\geq\beta-\frac{1}{4m}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p6.4" class="ltx_p"&gt;&lt;span id="A1.p6.4.1" class="ltx_text"&gt;Choose a uniform $b$-subset of $U\text{,}$ and let $T$ be its common blue neighborhood in $X\setminus U\text{.}$ Convexity of the piecewise-linear extension of $j\mapsto\binom{j}{b}$ on nonnegative integers gives&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.Ex49" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}|T|\geq(N_{X}-m)\frac{\binom{\lfloor\sigma m\rfloor}{b}}{\binom{m}{b}}\geq(N_{X}-m)(\sigma-b/m)^{b}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p6.5" class="ltx_p"&gt;&lt;span id="A1.p6.5.1" class="ltx_text"&gt;The second inequality follows factor by factor from the binomial product. Since $m\geq 10\beta^{-1}b^{2}\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.Ex50" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sigma-b/m\geq\beta\left(1-\frac{1}{8b}\right)&amp;gt;0,\qquad N_{X}-m\geq\frac{4}{5}N_{X}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p6.6" class="ltx_p"&gt;&lt;span id="A1.p6.6.1" class="ltx_text"&gt;Bernoulli’s inequality gives $\mathbb{E}|T|\geq(7/10)\beta^{b}N_{X}\text{.}$ Thus some blue $b$-clique $S\subseteq U$ has a disjoint common blue neighborhood $T$ with $|T|\geq\beta^{b}|X|/2\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A1.p7" class="ltx_para"&gt;
&lt;p id="A1.p7.1" class="ltx_p"&gt;&lt;span id="A1.p7.1.1" class="ltx_text"&gt;If $b\geq t\text{,}$ then $S$ already contains the required blue clique. For $b&amp;lt;t\text{,}$ we have&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.Ex51" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\delta_{n-b}-\delta_{n}\geq\delta/n^{2},\qquad Q_{n-b}(T,Y)\geq(\delta/n^{2})^{r}2^{-w}\beta^{wb}|X|^{w}|Y|\geq C^{w+1}x^{-k}y^{-\ell}\mu^{-w(t-b)}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p7.2" class="ltx_p"&gt;&lt;span id="A1.p7.2.1" class="ltx_text"&gt;The last inequality uses $Q_{n}\leq|X|^{w}|Y|$ and $(\beta/\mu)^{wb}\geq 2^{w}(n^{2}/\delta)^{r}\text{,}$ which follows from the choice of $b\text{.}$ Induction applies; a blue $K_{t-b}$ in $T$ joins $S$ to form a blue $K_{t}\text{,}$ and either of the other two outcomes already suffices.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A1.p8" class="ltx_para"&gt;
&lt;p id="A1.p8.1" class="ltx_p"&gt;&lt;span id="A1.p8.1.1" class="ltx_text"&gt;We may now assume $|W|&amp;lt;R(k,m)&amp;lt;\bar{p}\xi_{n}|X|\text{.}$ Put $Y_{v}=N_{R}(v)\cap Y\text{,}$ $d=d_{R}(X,Y)\text{,}$ and $E_{0}=e_{R}(X,Y)\text{.}$ Row regularization gives $|Y_{v}|\geq\bar{p}|Y|&amp;gt;0$ for every $v\in X\text{.}$ Counting by vertices in $Y$ and applying Cauchy–Schwarz gives&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.Ex52" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{v\in X}d_{R}(X,Y_{v})|Y_{v}|=\frac{1}{|X|}\sum_{y\in Y}\deg_{R}(y,X)^{2}\geq dE_{0}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p8.2" class="ltx_p"&gt;&lt;span id="A1.p8.2.1" class="ltx_text"&gt;Removing the terms indexed by $W$ loses at most $|W||Y|\text{,}$ so&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.Ex53" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{v\notin W}d_{R}(X,Y_{v})|Y_{v}|\geq dE_{0}-|W||Y|&amp;gt;(d-\xi_{n})E_{0}\geq(d-\xi_{n})\sum_{v\notin W}|Y_{v}|.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p8.3" class="ltx_p"&gt;&lt;span id="A1.p8.3.1" class="ltx_text"&gt;Here $E_{0}\geq\bar{p}|X||Y|$ and $d-\xi_{n}&amp;gt;0\text{.}$ Hence some $v\notin W$ satisfies $d_{R}(X,Y_{v})\geq d-\xi_{n}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A1.p9" class="ltx_para"&gt;
&lt;p id="A1.p9.1" class="ltx_p"&gt;&lt;em id="A1.p9.1.1" class="ltx_emph ltx_font_italic"&gt;Pass to a red or blue child.&lt;/em&gt;&lt;span id="A1.p9.1.2" class="ltx_text"&gt;
Set $Y^{\prime}=Y_{v}\text{,}$ $X_{R}=N_{R}(v)\cap X\text{,}$ $X_{B}=N_{B}(v)\cap X\text{,}$ and&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.Ex54" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$a=|X_{R}|/|X|,\quad q=|X_{B}|/|X|,\quad\alpha=d_{R}(X,Y^{\prime})-p+\delta_{n-1}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p9.2" class="ltx_p"&gt;&lt;span id="A1.p9.2.1" class="ltx_text"&gt;Then $a+q\leq 1\text{,}$ $q\leq\beta\text{,}$ and $\alpha\geq d-p+\delta_{n}+\delta/(2n^{2})&amp;gt;0\text{.}$
For $\chi\in\{R,B\}\text{,}$ set $\alpha_{\chi}=d_{R}(X_{\chi},Y^{\prime})-p+\delta_{n-1}$ when $X_{\chi}\neq\varnothing\text{,}$ and set $\alpha_{\chi}=0$ otherwise. Write $u_{+}=\max\{u,0\}$ and&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.Ex55" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$Q_{\chi}=(\alpha_{\chi})_{+}^{r}|X_{\chi}|^{w}|Y^{\prime}|.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p9.3" class="ltx_p"&gt;&lt;span id="A1.p9.3.1" class="ltx_text"&gt;Splitting $X$ into its two children and the root gives&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.E29" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$1\leq a\frac{(\alpha_{R})_{+}}{\alpha}+q\frac{(\alpha_{B})_{+}}{\alpha}+\frac{1}{\alpha|X|}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(29)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p9.4" class="ltx_p"&gt;&lt;span id="A1.p9.4.1" class="ltx_text"&gt;The root’s contribution is $(1-p+\delta_{n-1})/(\alpha|X|)\leq 1/(\alpha|X|)\text{.}$
We claim that&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.Ex56" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$Q_{R}\geq xQ_{n}\qquad\text{or}\qquad Q_{B}\geq\mu^{w}Q_{n}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p9.5" class="ltx_p"&gt;&lt;span id="A1.p9.5.1" class="ltx_text"&gt;If both inequalities failed, then $Q_{n}\leq\alpha^{r}|X|^{w}|Y|\text{,}$ $|Y^{\prime}|\geq\bar{p}|Y|\text{,}$ and &lt;a href="#A1.E29" title="In Proof. ‣ Appendix A The Finite-Host Weighted Inequality ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;29&lt;/span&gt;&lt;/a&gt; would give&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.Ex57" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$1\leq\bar{p}^{-1/r}\{x^{1/r}a^{1-w/r}+\mu^{w/r}q^{1-w/r}\}+\frac{1}{\alpha|X|}\leq 1-\gamma+\frac{2n^{2}}{\delta|X|}&amp;lt;1.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.p9.6" class="ltx_p"&gt;&lt;span id="A1.p9.6.1" class="ltx_text"&gt;The second inequality uses $a\leq 1-q$ and &lt;a href="#A1.E26" title="In Proof. ‣ Appendix A The Finite-Host Weighted Inequality ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;26&lt;/span&gt;&lt;/a&gt;; the last is one of our three size bounds.
Thus one child has a positive value of $Q_{n-1}$ meeting &lt;a href="#A1.E27" title="In Proof. ‣ Appendix A The Finite-Host Weighted Inequality ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;27&lt;/span&gt;&lt;/a&gt;, with $k$ reduced by one in the red child or $t$ reduced by one in the blue child. Induction applies. The root extends a red $K_{k-1}$ in $X_{R}\cup Y^{\prime}\text{,}$ or a blue $K_{t-1}$ in $X_{B}\text{,}$ respectively. Every other good outcome already gives a required clique.
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A1.Thmlemma2" class="ltx_theorem ltx_theorem_corollary"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="A1.Thmlemma2.2" class="ltx_text ltx_font_bold"&gt;Corollary A.2&lt;/span&gt;&lt;/span&gt;&lt;span id="A1.Thmlemma2.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Local Density Bound)&lt;span id="A1.Thmlemma2.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="A1.Thmlemma2.p1" class="ltx_para"&gt;
&lt;p id="A1.Thmlemma2.p1.1" class="ltx_p"&gt;&lt;span id="A1.Thmlemma2.p1.1.1" class="ltx_text ltx_font_italic"&gt;Under the stopping assumption of &lt;a href="#A1.Thmlemma1" title="Lemma A.1 (Finite-Host Weighted Candidate Bound). ‣ Appendix A The Finite-Host Weighted Inequality ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;A.1&lt;/span&gt;&lt;/a&gt;, fix $w&amp;gt;0$ and $\mu,p,x,y\in(0,1)$ with
$x&amp;lt;\widehat{x}\text{,}$ $y&amp;lt;\widehat{y}\text{,}$ and $x&amp;lt;(1-\mu)^{w}p^{1/(1-\mu)}\text{.}$
If a host has red density at least $p$ and order&lt;/span&gt;&lt;/p&gt;
&lt;table id="A1.E30" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$N\geq Cx^{-k/(w+1)}(y\mu^{w})^{-\ell/(w+1)},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(30)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A1.Thmlemma2.p1.2" class="ltx_p"&gt;&lt;span id="A1.Thmlemma2.p1.2.1" class="ltx_text ltx_font_italic"&gt;then it contains a red $K_{k}$ or a blue $K_{\ell}$ for all sufficiently large $\ell\text{,}$ with a threshold independent of $C\geq 1$ and $k\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A1.3" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A1.p10" class="ltx_para"&gt;
&lt;p id="A1.p10.1" class="ltx_p"&gt;&lt;span id="A1.p10.1.1" class="ltx_text"&gt;Choose $y&amp;lt;y_{1}&amp;lt;\widehat{y}\text{.}$
A uniformly chosen balanced partition has expected cross-density equal to the host density, so some disjoint $X,Y\text{,}$ each of size at least $N/3\text{,}$ satisfy $d_{R}(X,Y)\geq p\text{.}$
For large $\ell\text{,}$ $(y_{1}/y)^{\ell}\geq 3^{w+1}\text{.}$
The order bound therefore supplies &lt;a href="#A1.E25" title="In Lemma A.1 (Finite-Host Weighted Candidate Bound). ‣ Appendix A The Finite-Host Weighted Inequality ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;25&lt;/span&gt;&lt;/a&gt; at $(x,y_{1})$ with $t=\ell\text{,}$ and &lt;a href="#A1.Thmlemma1" title="Lemma A.1 (Finite-Host Weighted Candidate Bound). ‣ Appendix A The Finite-Host Weighted Inequality ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;A.1&lt;/span&gt;&lt;/a&gt; applies.
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A2" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="admissibility-of-the-source"&gt;&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix B &lt;/span&gt;Admissibility of the Source&lt;/h2&gt;
&lt;div id="A2.p1" class="ltx_para"&gt;
&lt;p id="A2.p1.1" class="ltx_p"&gt;We first give a criterion for a concave Ramsey profile, then verify it for the specified function $f\text{.}$
For a continuous $F$ on $[0,1]$ with $F(0)=0\text{,}$ define&lt;/p&gt;
&lt;table id="A2.Ex58" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$G_{F}(a,b)=\max(a,b)F\!\left(\frac{\min(a,b)}{\max(a,b)}\right),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;table id="A2.Ex59" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{B}_{F}=\{(x,y)\in(0,1)^{2}:G_{F}(a,b)\leq-a\log x-b\log y\text{ for all }a,b&amp;gt;0\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A2.p1.2" class="ltx_p"&gt;Thus $\mathcal{B}_{F}$ consists of the exponential bounds that dominate the profile in both coordinates.
For $F=f\text{,}$ this agrees with the source pairs in &lt;a href="#S2" title="2 Source Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;, since $G_{f}(a,b)=b\widehat{f}(a/b)\text{.}$
In the source criterion, $X,Y$ denote scalar support parameters.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.Thmlemma1" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="A2.Thmlemma1.2" class="ltx_text ltx_font_bold"&gt;Lemma B.1&lt;/span&gt;&lt;/span&gt;&lt;span id="A2.Thmlemma1.3" class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Source Criterion)&lt;span id="A2.Thmlemma1.4" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="A2.Thmlemma1.p1" class="ltx_para"&gt;
&lt;p id="A2.Thmlemma1.p1.1" class="ltx_p"&gt;&lt;span id="A2.Thmlemma1.p1.1.1" class="ltx_text ltx_font_italic"&gt;Suppose $F$ is continuous on $[0,1]\text{,}$ $F(0)=0\text{,}$ is $C^{1}$ and concave on $(0,1]\text{,}$ and has $F^{\prime}&amp;gt;0\text{.}$ If for every $s\in(0,1]$ there are $w&amp;gt;0\text{,}$ $\mu,Y\in(0,1)$ with&lt;/span&gt;&lt;/p&gt;
&lt;table id="A2.Ex60" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$p_{0}(s)=1-\mathrm{e}^{-F^{\prime}(s)},\quad X=(1-\mu)^{w}p_{0}(s)^{1/(1-\mu)},\quad(X,Y)\in\mathcal{B}_{F},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A2.Thmlemma1.p1.2" class="ltx_p"&gt;&lt;span id="A2.Thmlemma1.p1.2.1" class="ltx_text ltx_font_italic"&gt;and&lt;/span&gt;&lt;/p&gt;
&lt;table id="A2.E31" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(w+1)F(s)+\log X+s\log Y+ws\log\mu&amp;gt;0,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(31)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A2.Thmlemma1.p1.3" class="ltx_p"&gt;&lt;span id="A2.Thmlemma1.p1.3.1" class="ltx_text ltx_font_italic"&gt;then, for every $\varepsilon&amp;gt;0\text{,}$ some $C_{\varepsilon}\geq 1$ satisfies&lt;/span&gt;&lt;/p&gt;
&lt;table id="A2.E32" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R(a,b)\leq\left\lceil C_{\varepsilon}\exp\bigl(G_{F}(a,b)+\varepsilon(a+b)\bigr)\right\rceil\qquad(a,b\in\mathbb{Z}_{\geq 1}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(32)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A2.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A2.p2" class="ltx_para"&gt;
&lt;p id="A2.p2.1" class="ltx_p"&gt;&lt;span id="A2.p2.1.1" class="ltx_text"&gt;Fix $\varepsilon&amp;gt;0\text{.}$ We first choose finitely many local bounds, then apply one of them to a smallest counterexample.
Since $F(0)=0$ and $F^{\prime}&amp;gt;0\text{,}$ we have $F\geq 0\text{.}$
Choose $0&amp;lt;\alpha&amp;lt;1$ with $h(\alpha)&amp;lt;\varepsilon/2\text{;}$ the classical bound will handle smaller ratios.
At each $s_{0}\in[\alpha,1]\text{,}$ choose $w,\mu,X,Y$ as in the hypothesis and put $\bar{x}=\mathrm{e}^{-\varepsilon}X\text{,}$ $\bar{y}=\mathrm{e}^{-\varepsilon}Y\text{.}$
Scaling the controls this way and replacing $F(s_{0})$ by $F(s_{0})+\varepsilon(1+s_{0})$ increases the slack by $w\varepsilon(1+s_{0})\text{.}$
We may therefore choose&lt;/span&gt;&lt;/p&gt;
&lt;table id="A2.Ex61" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$0&amp;lt;x&amp;lt;\widehat{x}&amp;lt;\bar{x},\qquad 0&amp;lt;y&amp;lt;\widehat{y}&amp;lt;\bar{y},\qquad 0&amp;lt;p&amp;lt;p_{0}(s_{0}),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A2.p2.2" class="ltx_p"&gt;&lt;span id="A2.p2.2.1" class="ltx_text"&gt;close enough to $(\bar{x},\bar{y},p_{0}(s_{0}))$ that $x&amp;lt;(1-\mu)^{w}p^{1/(1-\mu)}$ and&lt;/span&gt;&lt;/p&gt;
&lt;table id="A2.Ex62" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H(t):=-\frac{\log x+t\log(y\mu^{w})}{w+1},\qquad H(s_{0})&amp;lt;F(s_{0})+\varepsilon(1+s_{0}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A2.p2.3" class="ltx_p"&gt;&lt;span id="A2.p2.3.1" class="ltx_text"&gt;Continuity gives a neighborhood on which this inequality holds and $p_{0}(s)&amp;gt;p+2\eta_{s_{0}}$ for some $\eta_{s_{0}}&amp;gt;0\text{.}$
A finite subcover gives $\eta&amp;gt;0$ and a common threshold $L\geq 2$ for &lt;a href="#A1.Thmlemma2" title="Corollary A.2 (Local Density Bound). ‣ Appendix A The Finite-Host Weighted Inequality ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;A.2&lt;/span&gt;&lt;/a&gt;, both independent of $C\text{.}$
At every $s\in[\alpha,1]\text{,}$ one selected local bound satisfies $H(s)&amp;lt;F(s)+\varepsilon(1+s)$ and $p_{0}(s)&amp;gt;p+2\eta\text{.}$
Every selected pair also satisfies&lt;/span&gt;&lt;/p&gt;
&lt;table id="A2.E33" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$-a\log\widehat{x}-b\log\widehat{y}\geq G_{F}(a,b)+\varepsilon(a+b)\qquad(a,b&amp;gt;0),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(33)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A2.p2.4" class="ltx_p"&gt;&lt;span id="A2.p2.4.1" class="ltx_text"&gt;by the support condition and the scaling by $\mathrm{e}^{-\varepsilon}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.p3" class="ltx_para"&gt;
&lt;p id="A2.p3.1" class="ltx_p"&gt;&lt;span id="A2.p3.1.1" class="ltx_text"&gt;Choose an integer $K$ with $\alpha K\geq L\text{,}$ and then $C\geq\max\{3,2/\eta,4^{K}\}\text{.}$ Suppose there is a coloring with no required clique at an integer order&lt;/span&gt;&lt;/p&gt;
&lt;table id="A2.Ex63" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$N\geq C\exp\bigl(G_{F}(a,b)+\varepsilon(a+b)\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A2.p3.2" class="ltx_p"&gt;&lt;span id="A2.p3.2.1" class="ltx_text"&gt;Choose one of smallest order among all parameter pairs and colorings. Interchange the colors if needed and write its targets as $k\geq\ell\text{.}$ The classical bound &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx4" title="" class="ltx_ref"&gt;ES&lt;/a&gt;]&lt;/cite&gt; excludes $k&amp;lt;K\text{.}$ It also excludes $\ell/k\leq\alpha\text{,}$ since&lt;/span&gt;&lt;/p&gt;
&lt;table id="A2.Ex64" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log R(k,\ell)\leq kh(\ell/k)\leq kh(\alpha)&amp;lt;\varepsilon k/2\leq kF(\ell/k)+\varepsilon(k+\ell)+\log C.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A2.p3.3" class="ltx_p"&gt;&lt;span id="A2.p3.3.1" class="ltx_text"&gt;Thus $s=\ell/k\in[\alpha,1]$ and $\ell\geq L\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.p4" class="ltx_para"&gt;
&lt;p id="A2.p4.1" class="ltx_p"&gt;&lt;span id="A2.p4.1.1" class="ltx_text"&gt;For every integer $a\geq 1\text{,}$ minimality and &lt;a href="#A2.E33" title="In Proof. ‣ Appendix B Admissibility of the Source ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;33&lt;/span&gt;&lt;/a&gt; give a red $K_{a}$ or a blue $K_{\ell}$ in each proper subset satisfying &lt;a href="#A1.E24" title="In Lemma A.1 (Finite-Host Weighted Candidate Bound). ‣ Appendix A The Finite-Host Weighted Inequality ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;24&lt;/span&gt;&lt;/a&gt;.
Thus the stopping assumption of &lt;a href="#A1.Thmlemma2" title="Corollary A.2 (Local Density Bound). ‣ Appendix A The Finite-Host Weighted Inequality ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;A.2&lt;/span&gt;&lt;/a&gt; holds for the local bound selected at $s\text{.}$
If the host’s red density is at least $p_{0}(s)-\eta&amp;gt;p\text{,}$ then $N&amp;gt;C\mathrm{e}^{kH(s)}\text{,}$ and &lt;a href="#A1.Thmlemma2" title="Corollary A.2 (Local Density Bound). ‣ Appendix A The Finite-Host Weighted Inequality ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;A.2&lt;/span&gt;&lt;/a&gt; gives a required clique.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.p5" class="ltx_para"&gt;
&lt;p id="A2.p5.1" class="ltx_p"&gt;&lt;span id="A2.p5.1.1" class="ltx_text"&gt;Otherwise its blue density exceeds $q=\mathrm{e}^{-F^{\prime}(s)}+\eta&amp;lt;1\text{.}$ A blue neighborhood $Z$ has size at least $q(N-1)&amp;gt;N\mathrm{e}^{-F^{\prime}(s)}\text{,}$ since $N\eta&amp;gt;1\text{.}$ Concavity gives&lt;/span&gt;&lt;/p&gt;
&lt;table id="A2.Ex65" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$k\bigl(F(s)-F(s-1/k)\bigr)\geq F^{\prime}(s).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A2.p5.2" class="ltx_p"&gt;&lt;span id="A2.p5.2.1" class="ltx_text"&gt;Consequently&lt;/span&gt;&lt;/p&gt;
&lt;table id="A2.Ex66" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$|Z|&amp;gt;N\mathrm{e}^{-F^{\prime}(s)}\geq\mathrm{e}^{\varepsilon}C\exp\bigl(kF(s-1/k)+\varepsilon(k+\ell-1)\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A2.p5.3" class="ltx_p"&gt;&lt;span id="A2.p5.3.1" class="ltx_text"&gt;The proper subset $Z$ therefore has order above the proposed $(k,\ell-1)$ threshold. Minimality gives a red $K_{k}$ or a blue $K_{\ell-1}\text{;}$ in the latter case, add the chosen vertex. Either outcome contradicts the choice of the host.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.p6" class="ltx_para"&gt;
&lt;p id="A2.p6.1" class="ltx_p"&gt;&lt;span id="A2.p6.1.1" class="ltx_text"&gt;Hence &lt;a href="#A2.E32" title="In Lemma B.1 (Source Criterion). ‣ Appendix B Admissibility of the Source ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;32&lt;/span&gt;&lt;/a&gt; holds. For $1\leq b\leq a\text{,}$ its logarithm is at most $aF(b/a)+2\varepsilon a+\log(2C_{\varepsilon})\text{.}$ Since $\varepsilon$ is arbitrary, the error is uniform in $b\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;section id="A2.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-piecewise-cubic-profile"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;B.1 &lt;/span&gt;The Piecewise Cubic Profile&lt;/h3&gt;
&lt;div id="A2.SS1.p1" class="ltx_para"&gt;
&lt;p id="A2.SS1.p1.1" class="ltx_p"&gt;We now verify the criterion for $f$ in &lt;a href="#S2.E3" title="In 2 Source Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;. The function $P$ has 2,279 rational cubic pieces.
The file &lt;span class="ltx_ref ltx_nolink ltx_path ltx_font_typewriter ltx_ref_self"&gt;data/source.json&lt;/span&gt; gives the rational partition points, values, and derivatives of $P\text{.}$ On a cell $[a,b]\text{,}$ set $u=t-a\text{,}$ $\delta=b-a\text{,}$ and $\Delta=P(b)-P(a)\text{.}$ Its exact polynomial is&lt;/p&gt;
&lt;table id="A2.Ex67" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$P(a+u)=P(a)+P^{\prime}(a)u+\frac{3\Delta/\delta-2P^{\prime}(a)-P^{\prime}(b)}{\delta}u^{2}+\frac{P^{\prime}(a)+P^{\prime}(b)-2\Delta/\delta}{\delta^{2}}u^{3}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A2.SS1.p1.2" class="ltx_p"&gt;Exact endpoint identities ensure that $P$ is globally $C^{1}\text{.}$ For $t&amp;gt;0$ in the interior of a piece, with $j(t)=t\mathrm{e}^{-t}P(t)\text{,}$&lt;/p&gt;
&lt;table id="A2.Ex68" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$j^{\prime\prime}(t)=\mathrm{e}^{-t}\bigl((t-2)P+(2-2t)P^{\prime}+tP^{\prime\prime}\bigr),\qquad f^{\prime\prime}(t)=-\frac{1}{t(1+t)}+j^{\prime\prime}(t).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A2.SS1.p1.3" class="ltx_p"&gt;The cover in &lt;span class="ltx_ref ltx_nolink ltx_path ltx_font_typewriter ltx_ref_self"&gt;data/source_cells.json&lt;/span&gt; proves $1-t(1+t)j^{\prime\prime}(t)&amp;gt;0$ on each closed piece, using that piece’s endpoint derivatives, together with $f^{\prime}(1)&amp;gt;0$ and $2f^{\prime}(1)&amp;gt;f(1)\text{.}$
Consequently $f(0)=0\text{,}$ $f$ is continuous on $[0,1]\text{,}$ $C^{1}$ on $(0,1]\text{,}$ strictly concave and increasing.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.SS1.p2" class="ltx_para"&gt;
&lt;p id="A2.SS1.p2.1" class="ltx_p"&gt;To describe the boundary of $\mathcal{B}_{f}\text{,}$ put $x_{f}(t)=\mathrm{e}^{-f^{\prime}(t)}$ and $y_{f}(t)=\mathrm{e}^{tf^{\prime}(t)-f(t)}\text{.}$
Their endpoint limits are&lt;/p&gt;
&lt;table id="A2.Ex69" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$x_{f}(t)=\frac{t}{1+t}\mathrm{e}^{-j^{\prime}(t)}\longrightarrow 0,\qquad y_{f}(t)=\frac{1}{1+t}\mathrm{e}^{tj^{\prime}(t)-j(t)}\longrightarrow 1.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="A2.SS1.p3" class="ltx_para"&gt;
&lt;p id="A2.SS1.p3.1" class="ltx_p"&gt;Strict concavity makes $x_{f}$ increasing and $y_{f}$ decreasing.
Also $x_{f}(t)&amp;lt;y_{f}(t)\text{:}$ the function $(1+t)f^{\prime}(t)-f(t)$ decreases to its positive value at $t=1\text{.}$
Writing $x_{1}=x_{f}(1)$ and $y_{1}=y_{f}(1)\text{,}$ the upper boundary is&lt;/p&gt;
&lt;table id="A2.E34" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$Y_{f}(x)=\begin{cases}y_{f}(t),&amp;amp;0&amp;lt;x&amp;lt;x_{1},\quad x_{f}(t)=x,\\ \mathrm{e}^{-f(1)}/x,&amp;amp;x_{1}\leq x\leq y_{1},\\ x_{f}(t),&amp;amp;y_{1}&amp;lt;x&amp;lt;1,\quad y_{f}(t)=x.\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(34)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A2.SS1.p3.2" class="ltx_p"&gt;These are the supporting lines of $\widehat{f}$ on its two smooth branches and at its corner.
Thus $b(A)=-\log Y_{f}(\mathrm{e}^{-A})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A2.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-source-inequalities"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;B.2 &lt;/span&gt;The Source Inequalities&lt;/h3&gt;
&lt;div id="A2.SS2.p1" class="ltx_para"&gt;
&lt;p id="A2.SS2.p1.1" class="ltx_p"&gt;The file &lt;span class="ltx_ref ltx_nolink ltx_path ltx_font_typewriter ltx_ref_self"&gt;data/source_cells.json&lt;/span&gt; supplies a cover of 12,319 closed cells and rational controls $r,w&amp;gt;0$ on each cell.
Set $\mu=tr\text{,}$ take $X$ as in &lt;a href="#A2.Thmlemma1" title="Lemma B.1 (Source Criterion). ‣ Appendix B Admissibility of the Source ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;B.1&lt;/span&gt;&lt;/a&gt;, and choose $Y=Y_{f}(X)\text{.}$
With $\Delta_{f}$ denoting the left side of &lt;a href="#A2.E31" title="In Lemma B.1 (Source Criterion). ‣ Appendix B Admissibility of the Source ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;31&lt;/span&gt;&lt;/a&gt;, the cell inequalities give&lt;/p&gt;
&lt;table id="A2.Ex70" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Delta_{f}(t)/t&amp;gt;10^{-8}\qquad(0&amp;lt;t\leq 1).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A2.SS2.p1.2" class="ltx_p"&gt;The cell inequalities also establish $0&amp;lt;\mu,p_{0}&amp;lt;1$ for positive $t\text{.}$ Since &lt;a href="#A2.Thmlemma1" title="Lemma B.1 (Source Criterion). ‣ Appendix B Admissibility of the Source ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;B.1&lt;/span&gt;&lt;/a&gt; requires controls at each ratio, they may be chosen separately on each cell.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.SS2.p2" class="ltx_para"&gt;
&lt;p id="A2.SS2.p2.1" class="ltx_p"&gt;Near zero, we cancel the logarithmic terms before evaluating the slack. Define&lt;/p&gt;
&lt;table id="A2.Ex71" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$L_{+}(u)=\frac{\log(1+u)}{u},\qquad L_{-}(u)=\frac{-\log(1-u)}{u},\qquad L_{+}(0)=L_{-}(0)=1,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;table id="A2.Ex72" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$U=(1+t)L_{+}(t)+\mathrm{e}^{-t}P(t),\quad u=\frac{\mathrm{e}^{-j^{\prime}(t)}}{1+t},\quad V=wrL_{-}(tr)+\frac{uL_{-}(tu)}{1-tr},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;table id="A2.Ex73" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$J(s)=L_{+}(s)+s\mathrm{e}^{-s}(P(s)-P^{\prime}(s)).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A2.SS2.p2.2" class="ltx_p"&gt;Then $f(t)/t=-\log t+U$ and $\log X=-tV\text{.}$
On the right supporting branch, write $X=y_{f}(t\sigma)\text{,}$ $Y=x_{f}(t\sigma)\text{.}$
Here $\log Y=\log t+\log\sigma-\log(1+t\sigma)-j^{\prime}(t\sigma)$ and $\log\mu=\log t+\log r\text{.}$
The terms in $\log t$ cancel in the normalized slack, giving&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A2.EGx1"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A2.Ex74"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A2.Ex75"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle\sigma J(t\sigma) &amp;amp; \displaystyle=V, \\
\displaystyle\Delta_{f}(t)/t &amp;amp; \displaystyle=(w+1)U-V+\log\sigma-\log(1+t\sigma)-j^{\prime}(t\sigma)+w\log r.
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p id="A2.SS2.p2.3" class="ltx_p"&gt;As $t\downarrow 0\text{,}$ $X\to 1$ implies $t\sigma\to 0\text{,}$ since $y_{f}$ is strictly decreasing with limit 1 only at zero. Thus $\sigma J(t\sigma)=V$ and $J(0)=1$ give the continuous extension $\sigma(0)=V(0)=wr+\mathrm{e}^{-P(0)}&amp;gt;0\text{.}$ On each cell near zero, the checker verifies the branch, a positive bracket for $\sigma\text{,}$ and $t\sigma\leq 1\text{.}$ The root is unique: $\sigma\mapsto\sigma J(t\sigma)=-\log y_{f}(t\sigma)/t$ is strictly increasing for $t&amp;gt;0\text{,}$ and is the identity at zero.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.SS2.p3" class="ltx_para"&gt;
&lt;p id="A2.SS2.p3.1" class="ltx_p"&gt;The verifier evaluates complete finite polynomial expansions. Source inverse brackets are accepted only after outward-rounded endpoint inequalities prove them. When $t$ and $t\sigma(t)$ lie in the interiors of source pieces, possibly different ones,&lt;/p&gt;
&lt;table id="A2.Ex76" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sigma^{\prime}=\frac{V^{\prime}-\sigma^{2}J^{\prime}(t\sigma)}{J(t\sigma)+t\sigma J^{\prime}(t\sigma)},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A2.SS2.p3.2" class="ltx_p"&gt;with a checked positive denominator. The integral representations&lt;/p&gt;
&lt;table id="A2.Ex77" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$L_{+}(u)=\int_{0}^{1}\frac{da}{1+ua},\qquad L_{-}(u)=\int_{0}^{1}\frac{da}{1-ua}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="A2.SS2.p3.3" class="ltx_p"&gt;give endpoint enclosures for these functions and their derivatives, including at zero. Away from zero, the function $u\mapsto\log Y_{f}(\mathrm{e}^{u})\text{,}$ with $u&amp;lt;0\text{,}$ has derivative $-s\text{,}$ $-1\text{,}$ or $-1/s$ on the three branches of &lt;a href="#A2.E34" title="In B.1 The Piecewise Cubic Profile ‣ Appendix B Admissibility of the Source ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;34&lt;/span&gt;&lt;/a&gt;, where $s$ is the supporting parameter. These derivatives agree at the branch junctions.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.SS2.p4" class="ltx_para"&gt;
&lt;p id="A2.SS2.p4.1" class="ltx_p"&gt;Together with &lt;a href="#S6.E22" title="In 6.1 Exact Interval Arithmetic ‣ 6 The Diagonal Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equations&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;22&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S6.E23" title="Equation 23 ‣ 6.1 Exact Interval Arithmetic ‣ 6 The Diagonal Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;23&lt;/span&gt;&lt;/a&gt;, these identities enclose each slack and its derivative. An enclosure at the cell center plus the derivative interval times the displacement encloses the slack throughout the cell. When a cell crosses a source partition point, enclosures from every adjoining piece are combined. The continuous compositions are locally Lipschitz, and the stated derivative bounds hold almost everywhere; integrating those bounds justifies the same enclosure across a junction. The complete cover verifies the hypotheses of &lt;a href="#A2.Thmlemma1" title="Lemma B.1 (Source Criterion). ‣ Appendix B Admissibility of the Source ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;B.1&lt;/span&gt;&lt;/a&gt;, which gives &lt;a href="#S2.E4" title="In 2 Source Bounds ‣ Retained-Set Descent for Diagonal Ramsey Numbers" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; with an error uniform in $b\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;&lt;div class="ltx_rdf" about="" property="dcterms:creator" content="Zhipeng Lu and Sichen Wang"&gt;&lt;/div&gt;
&lt;div class="ltx_rdf" about="" property="dcterms:subject" content="Finite Ramsey proofs, their greatest fixed point, and rigorous upper and lower bounds"&gt;&lt;/div&gt;
&lt;div class="ltx_rdf" about="" property="dcterms:title" content="Retained-Set Descent for Diagonal Ramsey Numbers"&gt;&lt;/div&gt;
&lt;/article&gt;</description></item><item><title>A Bound Below 2.8 for Tuza's Conjecture</title><link>https://sichen-wang.github.io/publications/tuza-conjecture/</link><pubDate>Sat, 12 Sep 2026 00:00:00 +0000</pubDate><guid>https://sichen-wang.github.io/publications/tuza-conjecture/</guid><description>&lt;article class="ltx_document ltx_authors_1line"&gt;
&lt;section id="S1" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="introduction"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;1 &lt;/span&gt;Introduction&lt;/h2&gt;
&lt;div id="S1.p1" class="ltx_para"&gt;
&lt;p id="S1.p1.1" class="ltx_p"&gt;A triangle packing in a graph $G$ is a set of pairwise edge-disjoint triangles, and a triangle transversal is a set of edges meeting every triangle. Let $\nu(G)$ and $\tau(G)$ denote their maximum and minimum sizes. A transversal contains an edge of every packed triangle, and the edges of a maximum packing form a transversal, so $\nu(G)\leq\tau(G)\leq 3\nu(G)\text{.}$ Tuza &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx2" title="" class="ltx_ref"&gt;Tuz90&lt;/a&gt;]&lt;/cite&gt; conjectured that $\tau(G)\leq 2\nu(G)$ for every graph $G\text{.}$ The constant $2$ would be best possible, as $K_{4}$ and $K_{5}$ show.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p2" class="ltx_para"&gt;
&lt;p id="S1.p2.1" class="ltx_p"&gt;Haxell &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx1" title="" class="ltx_ref"&gt;Hax99&lt;/a&gt;]&lt;/cite&gt; proved $\tau(G)\leq(66/23)\,\nu(G)\text{,}$ where $66/23\approx 2.870\text{,}$ and noted without proof that the argument can be pushed to $(1+\sqrt{481})/8\approx 2.866\text{.}$ Very recently, Yi &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx3" title="" class="ltx_ref"&gt;Yi26&lt;/a&gt;]&lt;/cite&gt; lowered the constant to $(162+4\sqrt{3})/59\approx 2.863$ by proving $\tau\leq(1+\sqrt{3})\nu$ for every family of triangles that admits a red-blue edge coloring with one red edge per triangle, and observed that this route alone cannot bring the constant below $54/19\approx 2.842\text{.}$ Independently of Yi’s work, we prove the following bound, whose constant $165/59\approx 2.797$ crosses this barrier and lies below $2.8\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem1" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="Thmtheorem1.2" class="ltx_text ltx_font_bold"&gt;Theorem 1&lt;/span&gt;&lt;/span&gt;&lt;span id="Thmtheorem1.3" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p id="Thmtheorem1.p1.1" class="ltx_p"&gt;&lt;span id="Thmtheorem1.p1.1.1" class="ltx_text ltx_font_italic"&gt;Every finite simple graph $G$ satisfies&lt;/span&gt;&lt;/p&gt;
&lt;table id="S1.Ex1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tau(G)\leq\frac{165}{59}\nu(G).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S1.p3" class="ltx_para"&gt;
&lt;p id="S1.p3.1" class="ltx_p"&gt;Our starting point is the following exchange property. Let the edges of a graph be colored red and blue, and consider the family of all triangles with exactly one red edge. Fix a maximum packing in this family and delete the blue edges of its triangles. By maximality, every triangle of the family that survives meets the packing only in its red edge. Suppose now that a surviving triangle $uvy$ contains the red edge $uv$ of a packed triangle $uvx\text{,}$ and that $xy$ is a red edge not used by the packing. Then $uvy$ is the only surviving triangle containing $uv\text{.}$ Indeed, $uxy$ has exactly one red edge, and the family contains every such triangle. So if $uvz$ were a second surviving triangle containing $uv\text{,}$ then replacing $uvx$ by $uxy$ and $uvz$ would enlarge the packing (&lt;a href="#S2.Thmlemma1" title="Lemma 2.1. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;). A red edge that lies in a single surviving triangle can be omitted from any transversal containing the other two edges of that triangle. Two transversals of the family, built in &lt;a href="#S2" title="2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;, allow this omission. Combining the two resulting bounds gives $\tau\leq(8/3)\nu$ for every family of this kind, and every packed triangle whose red edge lies in no other triangle of the family lowers the bound by a further $2/3$ (&lt;a href="#S2.Thmlemma3" title="Lemma 2.3. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p4" class="ltx_para"&gt;
&lt;p id="S1.p4.1" class="ltx_p"&gt;Families of this kind arise in Haxell’s construction. The construction fixes a maximum packing $P\text{,}$ calls the edges of its triangles old, and packs the remaining triangles in two further rounds: a maximum packing $A$ of triangles with one old edge, and, after the edges of $A$ are deleted, a packing $P^{\prime}$ with as many triangles with two old edges as possible. Color new edges red and old edges blue. After the deletion of the edges of $A\text{,}$ the triangles with two old edges form a family of the above kind, and so do the triangles that survive the further deletion of the old edges of $P^{\prime}\text{.}$ We build four transversals of $G$ from these packings, using books of triangles with a common edge, the bounds of &lt;a href="#S2.Thmlemma3" title="Lemma 2.3. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt;, and a random bipartition of the vertex set. Each gives an inequality between $\tau(G)\text{,}$ $\nu(G)\text{,}$ and the sizes of the packings, and a linear combination of the four inequalities yields $165/59\text{.}$ &lt;a href="#S2" title="2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; proves the exchange property and &lt;a href="#S2.Thmlemma3" title="Lemma 2.3. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt;, and &lt;a href="#S3" title="3 The General Bound ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; carries out the construction. The complete proof has been formalized in Lean 4 with Mathlib.&lt;span id="footnote1" class="ltx_note ltx_role_footnote"&gt;&lt;sup class="ltx_note_mark"&gt;1&lt;/sup&gt;&lt;span class="ltx_note_outer"&gt;&lt;span class="ltx_note_content"&gt;&lt;sup class="ltx_note_mark"&gt;1&lt;/sup&gt;
&lt;span class="ltx_tag ltx_tag_note"&gt;1&lt;/span&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;a href=&amp;quot;https://github.com/sichen-wang/tuza-lean&amp;quot; title=&amp;quot;&amp;quot; class=&amp;quot;ltx_ref ltx_url ltx_font_typewriter&amp;quot;&amp;gt;https://github.com/sichen-wang/tuza-lean&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S2" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="colored-triangle-families"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;2 &lt;/span&gt;Colored Triangle Families&lt;/h2&gt;
&lt;div id="S2.p1" class="ltx_para"&gt;
&lt;p id="S2.p1.1" class="ltx_p"&gt;Throughout, graphs are finite and simple, a triangle is identified with its set of three edges, and two triangles meet if they share an edge. For a family of triangles, a packing is a set of pairwise edge-disjoint members, a transversal is a set of edges meeting every member, and a packing is maximal if no member of the family can be added to it. Maximum packings are maximal. For a set $P$ of triangles, $E(P)$ is the union of their edge sets, and $H-X$ is the graph $H$ with the edge set $X$ deleted.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.p2" class="ltx_para"&gt;
&lt;p id="S2.p2.1" class="ltx_p"&gt;This section proves the three lemmas used in &lt;a href="#S3" title="3 The General Bound ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;: the exchange property (&lt;a href="#S2.Thmlemma1" title="Lemma 2.1. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;), a covering lemma for books (&lt;a href="#S2.Thmlemma2" title="Lemma 2.2. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt;), and the two colored bounds (&lt;a href="#S2.Thmlemma3" title="Lemma 2.3. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt;). Let $H$ be a graph whose edges are colored red and blue, and let $\mathcal{F}(H)$ be the family of all triangles of $H$ with exactly one red edge. We write $\mathcal{F}$ for $\mathcal{F}(H)$ when $H$ is clear. For a packing $P$ in $\mathcal{F}(H)\text{,}$ let $R(P)$ and $B(P)$ be the sets of red and blue edges of its members, and let&lt;/p&gt;
&lt;table id="S2.Ex2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{F}_{P}=\mathcal{F}(H-B(P))$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.p2.2" class="ltx_p"&gt;be the family of triangles with one red edge that survive the deletion of the blue edges of $P\text{.}$ If $P$ is maximum, every member of $\mathcal{F}_{P}$ has its red edge in $R(P)\text{,}$ since otherwise it could be added to $P\text{.}$ Hence it meets $E(P)$ exactly in its red edge, and it meets exactly one member of $P\text{.}$ We say that an edge is &lt;em id="S2.p2.2.1" class="ltx_emph ltx_font_italic"&gt;private&lt;/em&gt; in a family of triangles if exactly one member of the family contains it.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmlemma1" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmlemma1.2" class="ltx_text ltx_font_bold"&gt;Lemma 2.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmlemma1.3" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmlemma1.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmlemma1.p1.1" class="ltx_p"&gt;&lt;span id="S2.Thmlemma1.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $P$ be a maximum packing in $\mathcal{F}(H)\text{,}$ let $uvx\in P$ have red edge $uv\text{,}$ and let $uvy\in\mathcal{F}_{P}\text{.}$ If $xy$ is a red edge outside $R(P)\text{,}$ then $uv$ is private in $\mathcal{F}_{P}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S2.p3" class="ltx_para"&gt;
&lt;p id="S2.p3.1" class="ltx_p"&gt;&lt;span id="S2.p3.1.1" class="ltx_text"&gt;Suppose that $uvz\in\mathcal{F}_{P}$ for some $z\neq y\text{.}$ Since $uz\notin B(P)$ while $ux\in B(P)\text{,}$ also $z\neq x\text{.}$ The triangle $uxy$ has blue edges $ux,uy$ and red edge $xy\text{,}$ so it belongs to $\mathcal{F}(H)\text{,}$ and it meets $E(P)$ only in $ux\text{,}$ because $uy\notin B(P)$ and $xy\notin R(P)\text{.}$ The triangle $uvz$ meets $E(P)$ only in $uv\text{.}$ As $z\notin\{x,y\}\text{,}$ the triangles $uxy$ and $uvz$ are edge-disjoint, so replacing $uvx$ by both of them gives a packing in $\mathcal{F}(H)$ larger than $P\text{.}$
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.p4" class="ltx_para"&gt;
&lt;p id="S2.p4.1" class="ltx_p"&gt;The transversals below are built from books. A &lt;em id="S2.p4.1.1" class="ltx_emph ltx_font_italic"&gt;book&lt;/em&gt; with &lt;em id="S2.p4.1.2" class="ltx_emph ltx_font_italic"&gt;spine&lt;/em&gt; $uv$ is a set of triangles containing the edge $uv\text{.}$ Its members are its &lt;em id="S2.p4.1.3" class="ltx_emph ltx_font_italic"&gt;pages&lt;/em&gt;, and the union of their edge sets is its &lt;em id="S2.p4.1.4" class="ltx_emph ltx_font_italic"&gt;support&lt;/em&gt;. If a book has exactly two pages $uvx$ and $uvy$ and $xy$ is an edge, then $xy$ is the &lt;em id="S2.p4.1.5" class="ltx_emph ltx_font_italic"&gt;opposite edge&lt;/em&gt; of the book.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmlemma2" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmlemma2.2" class="ltx_text ltx_font_bold"&gt;Lemma 2.2&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmlemma2.3" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmlemma2.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmlemma2.p1.1" class="ltx_p"&gt;&lt;span id="S2.Thmlemma2.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $\mathcal{B}$ be a set of books with at most three pages each and pairwise edge-disjoint supports, and let $\mathcal{T}$ be a family of triangles such that every selection of one page from each book is a maximal packing in $\mathcal{T}\text{.}$ Let $C$ consist of all edges of the one-page books and the spines of the other books. Then every member of $\mathcal{T}$ avoiding $C$ is $uxy$ or $vxy$ for some two-page book $\{uvx,uvy\}$ in $\mathcal{B}\text{.}$ Consequently, $C$ together with the opposite edges of the two-page books is a transversal of $\mathcal{T}$ of size at most $\sum_{B\in\mathcal{B}}(4-|B|)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.3" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S2.p5" class="ltx_para"&gt;
&lt;p id="S2.p5.1" class="ltx_p"&gt;&lt;span id="S2.p5.1.1" class="ltx_text"&gt;Let $T\in\mathcal{T}$ avoid $C\text{.}$ If every book had a page edge-disjoint from $T\text{,}$ choosing such a page in each book would give a maximal packing in $\mathcal{T}$ to which $T$ could still be added, a contradiction. So $T$ meets every page of some book $B\text{.}$ Since all edges of a one-page book lie in $C\text{,}$ $B$ has two or three pages, and $T$ avoids its spine $uv\text{,}$ so $T$ contains $uz$ or $vz$ for every page $uvz$ of $B\text{.}$ If $B$ had three pages, these would be three edges of $T$ with distinct ends outside $\{u,v\}\text{,}$ but a triangle has only three vertices. So $B=\{uvx,uvy\}\text{,}$ and $T$ contains one of $ux,vx$ and one of $uy,vy\text{.}$ Two edges of a triangle share a vertex, so these are $ux,uy$ or $vx,vy\text{,}$ and $T$ is $uxy$ or $vxy\text{.}$ Finally, a book with $k$ pages contributes at most $4-k$ edges to the transversal.
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.Thmlemma3" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmlemma3.2" class="ltx_text ltx_font_bold"&gt;Lemma 2.3&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmlemma3.3" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmlemma3.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmlemma3.p1.1" class="ltx_p"&gt;&lt;span id="S2.Thmlemma3.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $P$ be a maximum packing in $\mathcal{F}(H)$ and $Q$ a maximum packing in $\mathcal{F}_{P}\text{,}$ with $p=|P|$ and $q=|Q|\text{,}$ and let $u$ be the number of members of $P$ whose red edge is private in $\mathcal{F}(H)\text{.}$ Then&lt;/span&gt;&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="S2.EGx1"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S2.E1"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S2.E2"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle\tau(\mathcal{F}(H)) &amp;amp; \displaystyle\leq\tfrac{8}{3}p-\tfrac{2}{3}u, \\
\displaystyle\tau(\mathcal{F}(H)) &amp;amp; \displaystyle\leq\tfrac{9}{4}p+\tfrac{3}{2}q-\tfrac{1}{4}u.
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no paper-eqgroup-no-rows"&gt;&lt;span class="paper-eqgroup-number"&gt;(1)&lt;/span&gt;&lt;span class="paper-eqgroup-number"&gt;(2)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.4" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S2.p6" class="ltx_para"&gt;
&lt;p id="S2.p6.1" class="ltx_p"&gt;&lt;span id="S2.p6.1.1" class="ltx_text"&gt;Let $r$ be the number of members of $Q$ whose red edge is private in $\mathcal{F}_{P}\text{.}$ We build two transversals of $\mathcal{F}\text{,}$ which give&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.Ex3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tau(\mathcal{F})\leq 3p-2q+r-u\qquad\text{and}\qquad\tau(\mathcal{F})\leq 2p+3q-r,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.p6.2" class="ltx_p"&gt;&lt;span id="S2.p6.2.1" class="ltx_text"&gt;and then combine these bounds, once directly and once after applying &lt;a href="#S2.E1" title="In Lemma 2.3. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; to $\mathcal{F}_{P}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.p7" class="ltx_para"&gt;
&lt;p id="S2.p7.1" class="ltx_p"&gt;&lt;span id="S2.p7.1.1" class="ltx_text"&gt;The first transversal comes from books. Each member of $Q$ shares its red edge with exactly one member of $P\text{,}$ and the two form a book with that red edge as spine. Each unpaired member of $P$ forms a one-page book. No member of $P$ is paired twice, as $Q$ is a packing, and the supports are edge-disjoint, as the blue edges of $Q$ avoid $B(P)\text{.}$ Every selection of one page per book is a packing in $\mathcal{F}$ of size $p=\nu(\mathcal{F})\text{,}$ hence maximal. A member of $P$ whose red edge is private in $\mathcal{F}$ is unpaired, since a page of $Q$ on the same spine would be a second member of $\mathcal{F}$ containing that edge.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.p8" class="ltx_para"&gt;
&lt;p id="S2.p8.1" class="ltx_p"&gt;&lt;span id="S2.p8.1.1" class="ltx_text"&gt;Let $C$ consist of the $3(p-q)$ edges of the one-page books and the $q$ spines. By &lt;a href="#S2.Thmlemma2" title="Lemma 2.2. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt;, a member of $\mathcal{F}$ avoiding $C$ is $uxy$ or $vxy$ for a two-page book $\{uvx,uvy\}$ with $uvx\in P$ and $uvy\in Q\text{.}$ The two edges it shares with the pages are blue, so $xy$ is red, and $xy\notin R(P)$ since $R(P)\subseteq C\text{.}$ By &lt;a href="#S2.Thmlemma1" title="Lemma 2.1. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;, $uv$ is private in $\mathcal{F}_{P}\text{,}$ so $uvy$ is one of the $r$ members of $Q$ with a private red edge. Adding the opposite edges of these at most $r$ books to $C$ therefore gives a transversal of $\mathcal{F}\text{.}$ Finally, delete the red edges of the $u$ unpaired members of $P$ whose red edge is private in $\mathcal{F}\text{:}$ the only member of $\mathcal{F}$ containing such an edge is that member of $P\text{,}$ which is met by its blue edges in $C\text{.}$ The transversal now has at most $3(p-q)+q+r-u$ edges, which is the first bound.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.p9" class="ltx_para"&gt;
&lt;p id="S2.p9.1" class="ltx_p"&gt;&lt;span id="S2.p9.1.1" class="ltx_text"&gt;The second transversal starts from $B(P)\cup E(Q)\text{.}$ A member of $\mathcal{F}$ avoiding $B(P)$ lies in $\mathcal{F}_{P}$ and, as $Q$ is maximal there, meets $E(Q)\text{.}$ So $B(P)\cup E(Q)$ is a transversal of $\mathcal{F}\text{.}$ Delete the red edges of the $r$ members of $Q$ whose red edge is private in $\mathcal{F}_{P}\text{:}$ a member of $\mathcal{F}$ avoiding the remaining edges lies in $\mathcal{F}_{P}$ and contains a deleted edge, so it is the corresponding member of $Q\text{,}$ which is met by its blue edges. The remaining $2p+3q-r$ edges give the second bound.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.p10" class="ltx_para"&gt;
&lt;p id="S2.p10.1" class="ltx_p"&gt;&lt;span id="S2.p10.1.1" class="ltx_text"&gt;Twice the first bound plus the second gives $3\tau(\mathcal{F})\leq 8p-q+r-2u\leq 8p-2u\text{,}$ as $r\leq q\text{,}$ which is &lt;a href="#S2.E1" title="In Lemma 2.3. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;. Next, $Q$ is a maximum packing in $\mathcal{F}(H-B(P))=\mathcal{F}_{P}\text{,}$ and $r$ of its members have a red edge that is private in $\mathcal{F}_{P}\text{,}$ so &lt;a href="#S2.E1" title="In Lemma 2.3. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; for the graph $H-B(P)$ gives $\tau(\mathcal{F}_{P})\leq\tfrac{8}{3}q-\tfrac{2}{3}r\text{.}$ Since $B(P)$ meets every member of $\mathcal{F}\setminus\mathcal{F}_{P}\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.Ex4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tau(\mathcal{F})\leq 2p+\tfrac{8}{3}q-\tfrac{2}{3}r.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.p10.2" class="ltx_p"&gt;&lt;span id="S2.p10.2.1" class="ltx_text"&gt;Three times this bound plus the first bound gives $4\tau(\mathcal{F})\leq 9p+6q-u-r\leq 9p+6q-u\text{,}$ which is &lt;a href="#S2.E2" title="In Lemma 2.3. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;.
∎&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S3" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="the-general-bound"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;3 &lt;/span&gt;The General Bound&lt;/h2&gt;
&lt;div id="S3.2" class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of &lt;a href="#Thmtheorem1" title="Theorem 1. ‣ 1 Introduction ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;.&lt;/h6&gt;
&lt;div id="S3.p1" class="ltx_para"&gt;
&lt;p id="S3.p1.1" class="ltx_p"&gt;&lt;span id="S3.p1.1.1" class="ltx_text"&gt;We follow Haxell’s construction &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bibx1" title="" class="ltx_ref"&gt;Hax99&lt;/a&gt;]&lt;/cite&gt;: the packings below and the first transversal are taken from it, and the other three transversals rest on the lemmas of &lt;a href="#S2" title="2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;. Choose a maximum triangle packing $P$ in $G\text{,}$ and put $n=|P|=\nu(G)$ and $O=E(P)\text{.}$ Call edges in $O$ old and all other edges new. A triangle has type $j$ if it contains exactly $j$ old edges. By maximality of $P$ there are no type-0 triangles.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.p2" class="ltx_para"&gt;
&lt;p id="S3.p2.1" class="ltx_p"&gt;&lt;span id="S3.p2.1.1" class="ltx_text"&gt;Choose a maximum packing $A$ of type-1 triangles and put $a=|A|\text{.}$ The first transversal comes from books formed by $P$ and $A\text{.}$ Pair each member of $A$ with the member of $P$ containing its old edge. If two members of $A$ met the same member of $P\text{,}$ replacing it by both would enlarge $P\text{,}$ since a type-1 triangle meets $E(P)$ only in its old edge. These pairs and the remaining members of $P$ form $n$ books with $n+a$ pages. Their supports are edge-disjoint, since the new edges of $A$ avoid $O\text{,}$ and every selection of one page per book is a packing of size $n=\nu(G)\text{,}$ hence maximal. &lt;a href="#S2.Thmlemma2" title="Lemma 2.2. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt; gives a transversal with at most $3(n-a)+2a$ edges, that is,&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.E3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tau(G)\leq 3n-a.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(3)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S3.p3" class="ltx_para"&gt;
&lt;p id="S3.p3.1" class="ltx_p"&gt;&lt;span id="S3.p3.1.1" class="ltx_text"&gt;Put $G^{\prime}=G-E(A)$ and $O^{\prime}=O\setminus E(A)\text{.}$ Every type-1 triangle meets $E(A)$ by maximality of $A\text{,}$ so every triangle of $G^{\prime}$ has type $2$ or $3\text{,}$ and $|O^{\prime}|=3n-a\text{.}$ Each remaining transversal of $G$ consists of $E(A)$ and a transversal of $G^{\prime}\text{.}$ Color the new edges of $G^{\prime}$ red and its old edges blue. Then $\mathcal{F}(G^{\prime})$ is the family $\mathcal{F}_{2}$ of type-2 triangles of $G^{\prime}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.p4" class="ltx_para"&gt;
&lt;p id="S3.p4.1" class="ltx_p"&gt;&lt;span id="S3.p4.1.1" class="ltx_text"&gt;Choose a packing $P^{\prime}$ in $G^{\prime}$ that maximizes first its number of type-2 members and then its size $m\text{.}$ Let $B^{*}$ be the set of type-2 members of $P^{\prime}$ and put $b=|B^{*}|\text{.}$ Any packing in $\mathcal{F}_{2}$ is a packing in $G^{\prime}\text{,}$ so $B^{*}$ is a maximum packing in $\mathcal{F}_{2}\text{.}$ The new edges of $P^{\prime}$ are the new edges of the members of $B^{*}\text{,}$ one for each. Let $N$ be their set, so that $R(B^{*})=N$ and $|N|=b\text{.}$ Since $A\cup P^{\prime}$ is a packing in $G\text{,}$ we have $a+m\leq n\text{.}$ The choice of $P^{\prime}$ makes every packing in $G^{\prime}$ with $m$ members, $b$ of them of type $2\text{,}$ maximal in $G^{\prime}\text{:}$ adding a triangle would give a packing with at least $b$ type-2 members and $m+1$ members.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.p5" class="ltx_para"&gt;
&lt;p id="S3.p5.1" class="ltx_p"&gt;&lt;span id="S3.p5.1.1" class="ltx_text"&gt;Let $B(P^{\prime})$ be the set of old edges of $P^{\prime}\text{,}$ and put&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{S}=\mathcal{F}(G^{\prime}-B(P^{\prime})),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.p5.2" class="ltx_p"&gt;&lt;span id="S3.p5.2.1" class="ltx_text"&gt;the family of type-2 triangles of $G^{\prime}$ whose old edges avoid $E(P^{\prime})\text{.}$ Since $B(B^{*})\subseteq B(P^{\prime})\text{,}$ we have $\mathcal{S}\subseteq(\mathcal{F}_{2})_{B^{*}}=\mathcal{F}(G^{\prime}-B(B^{*}))\text{,}$ and since $B^{*}$ is a maximum packing in $\mathcal{F}_{2}\text{,}$ the red edge of every member of $\mathcal{S}$ lies in $R(B^{*})=N\text{.}$ Choose a maximum packing $Q$ in $\mathcal{S}\text{,}$ put $c=|Q|\text{,}$ and let $h$ be the number of members of $Q$ whose red edge is private in $\mathcal{S}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.p6" class="ltx_para"&gt;
&lt;p id="S3.p6.1" class="ltx_p"&gt;&lt;span id="S3.p6.1.1" class="ltx_text"&gt;The second transversal combines books formed by $B^{*}$ and $Q$ with a random bipartition. Pair each member of $Q$ with the member of $B^{*}$ containing its red edge. No member of $B^{*}$ is paired twice, as $Q$ is a packing. These pairs and the unpaired members of $B^{*}$ form $b$ books, whose supports are edge-disjoint since the old edges of $Q$ avoid $E(P^{\prime})\text{.}$ Every selection of one page per book consists of $b$ type-2 triangles and is therefore a maximum packing in $\mathcal{F}_{2}\text{.}$ Let $W$ be the set of old edges of the one-page books, so $|W|=2(b-c)\text{.}$ The set $C$ of &lt;a href="#S2.Thmlemma2" title="Lemma 2.2. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt; for these books lies in $W\cup N\text{,}$ since spines are edges of $N$ and a one-page book has its old edges in $W$ and its new edge in $N\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.p7" class="ltx_para"&gt;
&lt;p id="S3.p7.1" class="ltx_p"&gt;&lt;span id="S3.p7.1.1" class="ltx_text"&gt;Assign each vertex of $G^{\prime}$ a bit, independently and uniformly at random, and call an edge crossing if its ends receive different bits. Select $W$ and every non-crossing edge of $O^{\prime}\text{,}$ then add the new edge of each triangle of $G^{\prime}$ not yet met. A type-3 triangle has two vertices with the same bit and hence a non-crossing old edge, so the selected edges meet every triangle of $G^{\prime}\text{.}$ Their expected number is $|W|+\frac{1}{2}(|O^{\prime}|-|W|)$ plus the expected number of added new edges, which we bound in two parts.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.p8" class="ltx_para"&gt;
&lt;p id="S3.p8.1" class="ltx_p"&gt;&lt;span id="S3.p8.1.1" class="ltx_text"&gt;A new edge is added only if both old edges of its triangle are crossing, and then it is non-crossing. Each edge of $N$ is non-crossing with probability $\frac{1}{2}\text{,}$ so the expected number of added edges in $N$ is at most $\frac{b}{2}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.p9" class="ltx_para"&gt;
&lt;p id="S3.p9.1" class="ltx_p"&gt;&lt;span id="S3.p9.1.1" class="ltx_text"&gt;Now let an edge $xy\notin N$ be added as the new edge of a type-2 triangle $T$ not yet met. Then $T$ contains no edge of $N$ and avoids $W\text{,}$ hence avoids $C\text{,}$ and &lt;a href="#S2.Thmlemma2" title="Lemma 2.2. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt; for these books and $\mathcal{F}_{2}$ shows that $T$ is $uxy$ or $vxy$ for a two-page book $\{uvx,uvy\}$ with $uvx\in B^{*}$ and $uvy\in Q\text{.}$ The two edges that $T$ shares with the pages are old, so its new edge $xy$ is the opposite edge of the book. Since $uvy\in\mathcal{S}\subseteq(\mathcal{F}_{2})_{B^{*}}$ and $xy$ is a red edge outside $R(B^{*})=N\text{,}$ &lt;a href="#S2.Thmlemma1" title="Lemma 2.1. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt; shows that $uv$ is private in $(\mathcal{F}_{2})_{B^{*}}\text{,}$ hence in $\mathcal{S}\text{,}$ so $uvy$ is one of the $h$ members of $Q$ with a private red edge. Such a book contributes an added edge only if $uxy$ or $vxy$ is not yet met, which requires $x$ and $y$ to receive the same bit and $u$ or $v$ a different one. As $u,v,x,y$ are distinct, this has probability $\frac{1}{2}-\frac{1}{8}=\frac{3}{8}\text{.}$ Distinct added edges come from distinct books, as each book has one opposite edge, so the expected number of added edges outside $N$ is at most $\frac{3}{8}h\text{.}$ The expected total is at most&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$|W|+\frac{|O^{\prime}|-|W|}{2}+\frac{b}{2}+\frac{3}{8}h=\frac{|O^{\prime}|}{2}+\frac{3}{2}b-c+\frac{3}{8}h,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.p9.2" class="ltx_p"&gt;&lt;span id="S3.p9.2.1" class="ltx_text"&gt;so some assignment of bits gives a transversal of $G^{\prime}$ of at most this size. Adding $E(A)$ and using $|O^{\prime}|=3n-a$ gives&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.E4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tau(G)\leq\tfrac{3}{2}n+\tfrac{5}{2}a+\tfrac{3}{2}b-c+\tfrac{3}{8}h.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(4)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S3.p10" class="ltx_para"&gt;
&lt;p id="S3.p10.1" class="ltx_p"&gt;&lt;span id="S3.p10.1.1" class="ltx_text"&gt;For the third transversal, we add a third page to some of these books and include the remaining members of $P^{\prime}\text{.}$ Choose a maximum packing $Q_{1}$ in $\mathcal{S}_{Q}=\mathcal{F}(G^{\prime}-B(P^{\prime})-B(Q))$ and put $d=|Q_{1}|\text{.}$ The red edge of each member of $Q_{1}$ lies in $R(Q)\text{,}$ and distinct members of $Q_{1}$ have distinct red edges. Add each member of $Q_{1}$ as a third page to the book whose spine is its red edge, and add the members of $P^{\prime}\setminus B^{*}$ as one-page books. The old edges of $Q_{1}$ avoid $E(P^{\prime})\cup E(Q)\text{,}$ so the supports remain edge-disjoint. Every selection of one page per book is a packing in $G^{\prime}$ with $m$ members, $b$ of them of type $2\text{,}$ hence maximal in $G^{\prime}\text{.}$ These $m$ books have $m+c+d$ pages, so &lt;a href="#S2.Thmlemma2" title="Lemma 2.2. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt; gives a transversal of $G^{\prime}$ of size at most $3m-c-d\text{.}$ Adding $E(A)$ and using $a+m\leq n$ gives&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.E5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tau(G)\leq 3n-c-d.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(5)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S3.p11" class="ltx_para"&gt;
&lt;p id="S3.p11.1" class="ltx_p"&gt;&lt;span id="S3.p11.1.1" class="ltx_text"&gt;The fourth transversal consists of $E(A)\text{,}$ the old edges of $P^{\prime}\text{,}$ and a transversal of $\mathcal{S}\text{.}$ The first two sets have at most $3a+3m-b\leq 3n-b$ edges. A triangle avoiding them lies in $G^{\prime}-B(P^{\prime})$ and is not of type $3\text{,}$ since a type-3 triangle avoiding $B(P^{\prime})$ would avoid $E(P^{\prime})$ and could be added to $P^{\prime}\text{.}$ So it belongs to $\mathcal{S}\text{.}$ &lt;a href="#S2.Thmlemma3" title="Lemma 2.3. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt; applied to $G^{\prime}-B(P^{\prime})\text{,}$ with $Q\text{,}$ $Q_{1}\text{,}$ $c\text{,}$ $d\text{,}$ $h$ in the roles of $P\text{,}$ $Q\text{,}$ $p\text{,}$ $q\text{,}$ $u\text{,}$ gives $\tau(\mathcal{S})\leq\frac{9}{4}c+\frac{3}{2}d-\frac{1}{4}h$ by &lt;a href="#S2.E2" title="In Lemma 2.3. ‣ 2 Colored Triangle Families ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;, so&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.E6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tau(G)\leq 3n-b+\tfrac{9}{4}c+\tfrac{3}{2}d-\tfrac{1}{4}h.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(6)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S3.p12" class="ltx_para"&gt;
&lt;p id="S3.p12.1" class="ltx_p"&gt;&lt;span id="S3.p12.1.1" class="ltx_text"&gt;Multiply &lt;a href="#S3.E3" title="In Proof of . ‣ 3 The General Bound ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equations&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;, &lt;a href="#S3.E4" title="Equation 4 ‣ Proof of . ‣ 3 The General Bound ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;, &lt;a href="#S3.E5" title="Equation 5 ‣ Proof of . ‣ 3 The General Bound ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S3.E6" title="Equation 6 ‣ Proof of . ‣ 3 The General Bound ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt; by $20,8,19,12\text{,}$ respectively, and add. The coefficients of $a,b,c,h$ cancel, giving&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$59\tau(G)\leq 165n-d\leq 165\nu(G).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="Thmremarkx1" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="Thmremarkx1.2" class="ltx_text ltx_font_italic"&gt;Remark&lt;/span&gt;&lt;/span&gt;&lt;span id="Thmremarkx1.3" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="Thmremarkx1.p1" class="ltx_para"&gt;
&lt;p id="Thmremarkx1.p1.1" class="ltx_p"&gt;The weights are best possible for the system &lt;a href="#S3.E3" title="In Proof of . ‣ 3 The General Bound ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equations&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;, &lt;a href="#S3.E4" title="Equation 4 ‣ Proof of . ‣ 3 The General Bound ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;, &lt;a href="#S3.E5" title="Equation 5 ‣ Proof of . ‣ 3 The General Bound ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S3.E6" title="Equation 6 ‣ Proof of . ‣ 3 The General Bound ‣ A Bound Below 2.8 for Tuza’s Conjecture" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;. For $a=c=12n/59\text{,}$ $b=m=39n/59\text{,}$ and $d=h=0\text{,}$ which satisfy the relations $a+m\leq n\text{,}$ $d\leq c\leq b\leq m\text{,}$ and $h\leq c$ that hold in the proof, all four right-hand sides equal $165n/59\text{.}$ So no nonnegative combination of the four inequalities gives a smaller constant.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="bib" class="ltx_bibliography"&gt;
&lt;h2 class="ltx_title ltx_title_bibliography" id="references"&gt;References&lt;/h2&gt;
&lt;ul class="ltx_biblist"&gt;
&lt;li id="bib.bibx1" class="ltx_bibitem ltx_align_left"&gt;&lt;span class="ltx_tag ltx_tag_bibitem"&gt;[Hax99]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;
P. E. Haxell, &lt;em id="bib.bibx1.2" class="ltx_emph ltx_font_italic"&gt;Packing and covering triangles in graphs&lt;/em&gt;,
Discrete Mathematics &lt;span id="bib.bibx1.3" class="ltx_text ltx_font_bold"&gt;195&lt;/span&gt; (1999), 251–254.
&lt;a href="https://doi.org/10.1016/S0012-365X(98)00183-6" title="" class="ltx_ref ltx_href"&gt;doi:10.1016/S0012-365X(98)00183-6&lt;/a&gt;.
&lt;p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/p&gt;
&lt;li id="bib.bibx2" class="ltx_bibitem ltx_align_left"&gt;&lt;span class="ltx_tag ltx_tag_bibitem"&gt;[Tuz90]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;
Z. Tuza, &lt;em id="bib.bibx2.2" class="ltx_emph ltx_font_italic"&gt;A conjecture on triangles of graphs&lt;/em&gt;,
Graphs and Combinatorics &lt;span id="bib.bibx2.3" class="ltx_text ltx_font_bold"&gt;6&lt;/span&gt; (1990), 373–380.
&lt;a href="https://doi.org/10.1007/BF01787705" title="" class="ltx_ref ltx_href"&gt;doi:10.1007/BF01787705&lt;/a&gt;.
&lt;p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/p&gt;
&lt;li id="bib.bibx3" class="ltx_bibitem ltx_align_left"&gt;&lt;span class="ltx_tag ltx_tag_bibitem"&gt;[Yi26]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;
L. Yi, &lt;em id="bib.bibx3.2" class="ltx_emph ltx_font_italic"&gt;An improved upper bound for Tuza’s conjecture via 2-colorable triangle families&lt;/em&gt;,
&lt;a href="https://arxiv.org/abs/2608.23010v1" title="" class="ltx_ref ltx_href"&gt;arXiv:2608.23010v1&lt;/a&gt; (2026).
&lt;p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/p&gt;
&lt;/ul&gt;
&lt;/section&gt;&lt;div class="ltx_rdf" about="" property="dcterms:creator" content="Sichen Wang"&gt;&lt;/div&gt;
&lt;div class="ltx_rdf" about="" property="dcterms:title" content="A Bound Below 2.8 for Tuza's Conjecture"&gt;&lt;/div&gt;
&lt;/article&gt;</description></item><item><title>The Minimax Rate of Denoising Flows on Trees</title><link>https://sichen-wang.github.io/publications/denoising-flows-on-trees/</link><pubDate>Sat, 12 Sep 2026 00:00:00 +0000</pubDate><guid>https://sichen-wang.github.io/publications/denoising-flows-on-trees/</guid><description>&lt;article class="ltx_document"&gt;
&lt;section id="S1" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="introduction"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;1 &lt;/span&gt;Introduction&lt;/h2&gt;
&lt;div id="S1.p1" class="ltx_para"&gt;
&lt;p id="S1.p1.1" class="ltx_p"&gt;Two classical problems anchor Gaussian denoising under geometric constraints. Isotonic regression, the estimation of a monotone sequence, obeys the cube-root phase diagram of shape-constrained estimation &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib2" title="" class="ltx_ref"&gt;Zhang, 2002&lt;/a&gt;; &lt;a href="#bib.bib4" title="" class="ltx_ref"&gt;Chatterjee et al., 2015&lt;/a&gt;)&lt;/cite&gt;. Mean estimation over a scaled simplex, the nonnegative part of an $\ell_{1}$ ball, obeys the $\sqrt{\log}$ diagram of sparse estimation &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib5" title="" class="ltx_ref"&gt;Donoho and Johnstone, 1994&lt;/a&gt;; &lt;a href="#bib.bib6" title="" class="ltx_ref"&gt;Birgé and Massart, 2001&lt;/a&gt;)&lt;/cite&gt;. The two diagrams, each carrying decades of theory, are unlike in kind: the monotone problem pays a power of its depth, the sparse problem a logarithm of its width. Between the sequence and the simplex lies every geometry in which depth and branching interact, and there the picture has remained incomplete.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p2" class="ltx_para"&gt;
&lt;p id="S1.p2.1" class="ltx_p"&gt;One model generalizes both. A &lt;em id="S1.p2.1.1" class="ltx_emph ltx_font_italic"&gt;tree flow&lt;/em&gt; &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib1" title="" class="ltx_ref"&gt;Chatterjee and Lafferty, 2018&lt;/a&gt;)&lt;/cite&gt; assigns to the vertices of a rooted tree nonnegative values such that each vertex passes to its children at most what it receives: a mass enters at the root, travels downward, and may leak at any vertex. A path, depth without branching, is bounded isotonic regression; a star, branching without depth, is mean estimation over the scaled simplex. The same inequalities arise wherever hierarchical totals are measured with noise. In the consistency post-processing of differentially private counts they hold with equality &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib7" title="" class="ltx_ref"&gt;Hay et al., 2010&lt;/a&gt;; &lt;a href="#bib.bib8" title="" class="ltx_ref"&gt;Abowd et al., 2022&lt;/a&gt;)&lt;/cite&gt;; in profiling a call tree the leak carries real mass, the self time of a procedure &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib9" title="" class="ltx_ref"&gt;Graham et al., 1982&lt;/a&gt;)&lt;/cite&gt;. Chatterjee and Lafferty studied the least squares estimator, the projection onto the flow cone and the natural tuning-free program for the model, and discovered that it behaves unlike its isotonic counterpart: its rate of convergence is not monotone in the depth of the tree, and it can miss the minimax rate by a power of $n\text{.}$ Where the projection fell short, the minimax rate was attained only by least squares over an exponentially large net, and their closing sentence poses the challenge of “closing the gap between the LSE and the minimax lower bound” with an efficient estimator. A decade later the challenge stood, and with it three gaps: the minimax risk was uncharacterized beyond two regimes of trees, the worst case of least squares at a fixed budget was unquantified, and no efficient estimator was known to attain the minimax rate where the projection did not.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p3" class="ltx_para"&gt;
&lt;p id="S1.p3.1" class="ltx_p"&gt;This paper closes all three. We ask: for every finite rooted tree and every budget and noise level, what is the minimax risk of denoising a tree flow, and is it attained by a computationally efficient estimator? One combinatorial functional of the tree organizes the answers, stated in &lt;a href="#S1.SS1" title="1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.1&lt;/span&gt;&lt;/a&gt;: a rate formula; an exact and efficient estimator; adaptation to the budget and, in an explicit regime, to the noise level; and the worst-case price of least squares. In the local entropy program for convex constraints &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib12" title="" class="ltx_ref"&gt;Neykov, 2023&lt;/a&gt;)&lt;/cite&gt;, the flow polytopes thereby form a nonsymmetric, combinatorially explicit family.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S1.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="our-results"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;1.1 &lt;/span&gt;Our Results&lt;/h3&gt;
&lt;div id="S1.SS1.p1" class="ltx_para"&gt;
&lt;p id="S1.SS1.p1.1" class="ltx_p"&gt;Let $T$ be a finite rooted tree with vertex set $\mathsf{V}\text{,}$ root $o\text{,}$ and $n:=|\mathsf{V}|$ vertices. Write $u\preceq v\text{,}$ and call $u$ an &lt;em id="S1.SS1.p1.1.1" class="ltx_emph ltx_font_italic"&gt;ancestor&lt;/em&gt; of $v\text{,}$ when $u$ lies on the path from $o$ to $v\text{,}$ so that every vertex is an ancestor of itself; let $d_{T}$ denote graph distance, and let $H_{T}:=\max_{u,w\in\mathsf{V}}d_{T}(u,w)$ denote the diameter of $T\text{.}$ Each vertex $u$ carries its root-path indicator $p_{u}\in\{0,1\}^{\mathsf{V}}\text{,}$ defined by $p_{u}(v)=\mathbf{1}\{v\preceq u\}\text{.}$ The &lt;em id="S1.SS1.p1.1.2" class="ltx_emph ltx_font_italic"&gt;flow cone&lt;/em&gt; of $T$ is&lt;/p&gt;
&lt;table id="S1.E1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{F}(T):=\Bigl\{\textstyle\sum_{u\in\mathsf{V}}s_{u}p_{u}:\ s_{u}\geq 0\text{ for all }u\Bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(1.1)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1.SS1.p1.2" class="ltx_p"&gt;whose elements are exactly the monotone flows on $T$ (&lt;a href="#S2.Thmlemma1" title="Lemma 2.1 (Normal forms). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;). Fix a budget $V&amp;gt;0$ and a noise level $\sigma&amp;gt;0\text{.}$ The parameter set of this paper is the budget-$V$ slice of the cone, the &lt;em id="S1.SS1.p1.2.1" class="ltx_emph ltx_font_italic"&gt;flow polytope&lt;/em&gt;&lt;/p&gt;
&lt;table id="S1.E2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{F}_{V}(T):=\bigl\{\mu\in\mathcal{F}(T):\ \mu(o)=V\bigr\}\ =\ V\operatorname{conv}\{p_{u}:u\in\mathsf{V}\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(1.2)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1.SS1.p1.3" class="ltx_p"&gt;The cone &lt;a href="#S1.E1" title="In 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.1&lt;/span&gt;&lt;/a&gt; is the flow cone of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib1" title="" class="ltx_ref"&gt;Chatterjee and Lafferty (2018)&lt;/a&gt;&lt;/cite&gt;; they cap the root value, $\mu(o)\leq V\text{,}$ where we fix it. For $n\geq 2$ the two constraints carry the same minimax risk up to universal constants: the capped body contains the slice, raising the root value of a capped signal to $V$ changes no other coordinate, and the cap therefore adds only the bounded scalar $\mu(o)\text{,}$ at a cost $\min\{V^{2},\sigma^{2}\}$ that the two-point bound &lt;a href="#S3.E8" title="In 3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.8&lt;/span&gt;&lt;/a&gt; absorbs; the estimator of &lt;a href="#Thmtheorem2" title="Theorem 2 (Efficient estimation). ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; transfers (&lt;a href="#S1a" title="S.1 The Profile Toolkit ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.1&lt;/span&gt;&lt;/a&gt;). We observe $Y=\mu+\sigma Z$ with $Z\sim N(0,I_{n})$ and $\mu\in\mathcal{F}_{V}(T)\text{,}$ and study the minimax risk&lt;/p&gt;
&lt;table id="S1.E3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{*}_{T}(V,\sigma):=\inf_{\widehat{\mu}}\ \sup_{\mu\in\mathcal{F}_{V}(T)}\mathbb{E}_{\mu}\bigl\|\widehat{\mu}(Y)-\mu\bigr\|_{2}^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(1.3)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1.SS1.p1.4" class="ltx_p"&gt;the infimum running over all measurable maps $\widehat{\mu}:\mathbb{R}^{\mathsf{V}}\to\mathbb{R}^{\mathsf{V}}\text{;}$ estimators are not required to take values in $\mathcal{F}_{V}(T)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS1.p2" class="ltx_para"&gt;
&lt;p id="S1.SS1.p2.1" class="ltx_p"&gt;An &lt;em id="S1.SS1.p2.1.1" class="ltx_emph ltx_font_italic"&gt;ancestor $r$-net&lt;/em&gt; is a set $R\subseteq\mathsf{V}$ such that every vertex $u$ has an ancestor $a\in R$ with $d_{T}(a,u)\leq r\text{,}$ and $N^{\uparrow}_{T}(r)$ denotes the minimum cardinality of an ancestor $r$-net. The &lt;em id="S1.SS1.p2.1.2" class="ltx_emph ltx_font_italic"&gt;truncated ancestor profile&lt;/em&gt; of $T$ is&lt;/p&gt;
&lt;table id="S1.E4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\alpha_{k}(T):=\sup_{r&amp;gt;0}\ r\,\min\Bigl\{k,\ \Bigl[\log\frac{N^{\uparrow}_{T}(r)}{k}\Bigr]_{+}\Bigr\},\qquad\delta_{k}(T):=\frac{\alpha_{k}(T)}{k}\qquad(k=1,2,\dots),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(1.4)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1.SS1.p2.2" class="ltx_p"&gt;where $[x]_{+}:=\max\{x,0\}\text{,}$ and the &lt;em id="S1.SS1.p2.2.1" class="ltx_emph ltx_font_italic"&gt;crossing index&lt;/em&gt; is&lt;/p&gt;
&lt;table id="S1.E5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$k_{0}=k_{0}(T,V,\sigma):=\min\Bigl\{k\geq 1:\ V^{2}\delta_{k}(T)\leq A_{0}\sigma^{2}k\ \text{ or }\ k&amp;gt;n/C_{\star}\Bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(1.5)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1.SS1.p2.3" class="ltx_p"&gt;where $A_{0}$ and $C_{\star}$ are fixed universal constants; one may take $A_{0}=144$ and $C_{\star}=e^{2}\text{.}$ The truncation is the one nonstandard feature: once describing the branching below a vertex costs more than the information budget $k\text{,}$ the cluster is blurred at its own diameter rather than charged per descendant (&lt;a href="#S2.Thmremark1" title="Remark 2.1 (Why the profile is truncated). ‣ 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Remark&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS1.p3" class="ltx_para"&gt;
&lt;p id="S1.SS1.p3.1" class="ltx_p"&gt;The crossing index determines the minimax risk: &lt;a href="#Thmtheorem1" title="Theorem 1 (Rate formula). ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;, proved in &lt;a href="#S3" title="3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;, shows that&lt;/p&gt;
&lt;table id="S1.Ex1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{*}_{T}(V,\sigma)\ \asymp\ \min\bigl\{V^{2}H_{T},\ \sigma^{2}k_{0}(T,V,\sigma)\bigr\}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1.SS1.p3.2" class="ltx_p"&gt;for every finite rooted tree and all $V,\sigma&amp;gt;0\text{.}$ The minimum has three readings: a diameter branch $V^{2}H_{T}\text{,}$ where the body is small and the constant estimator $Vp_{o}$ is already optimal; an information branch $\sigma^{2}k_{0}\text{,}$ the cost of $k_{0}$ effective coordinates; and, when the crossing clause never fires, a dimension branch $\sigma^{2}k_{0}\asymp\sigma^{2}n\text{,}$ where the identity estimator is optimal. The formula is computable: a surrogate index evaluates it to within a factor of two in $O(n\log(n+1))$ operations (&lt;a href="#S2.Thmlemma3" title="Lemma 2.3 (Profile toolkit). ‣ 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS1.p4" class="ltx_para"&gt;
&lt;p id="S1.SS1.p4.1" class="ltx_p"&gt;Behind the formula stands the entropy theory of Gaussian estimation, from global metric entropy to the local entropy fixed point of bounded convex constraints &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib11" title="" class="ltx_ref"&gt;Yang and Barron, 1999&lt;/a&gt;; &lt;a href="#bib.bib12" title="" class="ltx_ref"&gt;Neykov, 2023&lt;/a&gt;)&lt;/cite&gt;. That theory identifies the governing quantity; computing it on a given body, and constructing the packings it promises when the body is an asymmetric cone, are the separate problems solved in &lt;a href="#S3" title="3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;. For $t&amp;gt;0$ let $H^{c}_{T}(t)$ denote the metric entropy of the flow polytope at squared radius $t\text{:}$ the logarithm of the smallest number of Euclidean balls of radius $\sqrt{t}\text{,}$ centered anywhere, whose union contains $\mathcal{F}_{V}(T)\text{.}$ Define the associated fixed point&lt;/p&gt;
&lt;table id="S1.E6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\rho_{T}(V,\sigma)\ :=\ \inf_{t&amp;gt;0}\ \bigl[t+\sigma^{2}H^{c}_{T}(t)\bigr].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(1.6)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1.SS1.p4.2" class="ltx_p"&gt;Free centers are the convenient convention, because the covers of &lt;a href="#S3" title="3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; have centers outside the body; restricting centers to the body leaves &lt;a href="#S1.E6" title="In 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.6&lt;/span&gt;&lt;/a&gt; unchanged (&lt;a href="#S1a" title="S.1 The Profile Toolkit ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.1&lt;/span&gt;&lt;/a&gt;). &lt;a href="#Thmproposition1" title="Proposition 1 (Entropy fixed point). ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; gives $R^{*}_{T}(V,\sigma)\asymp\min\{\rho_{T}(V,\sigma),\ V^{2}H_{T},\ \sigma^{2}n\}\text{;}$ &lt;a href="#Thmtheorem1" title="Theorem 1 (Rate formula). ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; thus evaluates this entropy expression in closed combinatorial form.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="S1.T1" class="ltx_table"&gt;
&lt;figcaption class="ltx_caption"&gt;&lt;span class="ltx_tag ltx_tag_table"&gt;Table 1: &lt;/span&gt;The rate formula on three families
(&lt;a href="#Thmcorollary1" title="Corollary 1 (Path). ‣ 3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollaries&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;, &lt;a href="#Thmcorollary2" title="Corollary 2 (Star). ‣ 3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmcorollary3" title="Corollary 3 (Complete binary tree). ‣ 3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;), with $n$ the number of
vertices and universal constants in $\asymp\text{;}$ the path $P_{L}$ has $L$
edges, the star $S_{m}$ has $m$ leaves, and the complete binary tree
$B_{h}$ has height $h\text{.}$
The first two rows recover the classical phase diagrams; the third
carries a full logarithm that occurs at neither endpoint.&lt;/figcaption&gt;
&lt;table id="S1.T1.2" class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle"&gt;
&lt;thead class="ltx_thead"&gt;
&lt;tr id="S1.T1.2.1" class="ltx_tr"&gt;
&lt;th id="S1.T1.2.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_th_row ltx_border_t"&gt;Tree&lt;/th&gt;
&lt;th id="S1.T1.2.1.2" class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_th_row ltx_border_t"&gt;$R^{*}\asymp$&lt;/th&gt;
&lt;th id="S1.T1.2.1.3" class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_border_t"&gt;Classical counterpart&lt;/th&gt;
&lt;th id="S1.T1.2.1.4" class="ltx_td ltx_nopad_r ltx_align_left ltx_th ltx_th_column ltx_border_t"&gt;Phenomenon&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody class="ltx_tbody"&gt;
&lt;tr id="S1.T1.2.2" class="ltx_tr"&gt;
&lt;th id="S1.T1.2.2.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t"&gt;path $P_{L}$&lt;/th&gt;
&lt;th id="S1.T1.2.2.2" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t"&gt;$\min\bigl\{V^{2}L,\ V^{2/3}\sigma^{4/3}L^{1/3},\ \sigma^{2}(L{+}1)\bigr\}$&lt;/th&gt;
&lt;td id="S1.T1.2.2.3" class="ltx_td ltx_align_left ltx_border_t"&gt;bounded isotonic&lt;/td&gt;
&lt;td id="S1.T1.2.2.4" class="ltx_td ltx_nopad_r ltx_align_left ltx_border_t"&gt;cube root&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S1.T1.2.3" class="ltx_tr"&gt;
&lt;th id="S1.T1.2.3.1" class="ltx_td ltx_align_left ltx_th ltx_th_row"&gt;star $S_{m}$&lt;/th&gt;
&lt;th id="S1.T1.2.3.2" class="ltx_td ltx_align_left ltx_th ltx_th_row"&gt;$\min\bigl\{V^{2},\ \sigma V\sqrt{1+[\log(m\sigma/V)]_{+}},\ \sigma^{2}m\bigr\}$&lt;/th&gt;
&lt;td id="S1.T1.2.3.3" class="ltx_td ltx_align_left"&gt;simplex mean&lt;/td&gt;
&lt;td id="S1.T1.2.3.4" class="ltx_td ltx_nopad_r ltx_align_left"&gt;$\sqrt{\log}$&lt;/td&gt;&lt;/tr&gt;
&lt;tr id="S1.T1.2.4" class="ltx_tr"&gt;
&lt;th id="S1.T1.2.4.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_b"&gt;binary $B_{h}$&lt;/th&gt;
&lt;th id="S1.T1.2.4.2" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_b"&gt;$\min\bigl\{V^{2}h,\ \sigma V\bigl(1+[\log(n\sigma/V)]_{+}\bigr),\ \sigma^{2}n\bigr\}$&lt;/th&gt;
&lt;td id="S1.T1.2.4.3" class="ltx_td ltx_align_left ltx_border_b"&gt;no direct analogue&lt;/td&gt;
&lt;td id="S1.T1.2.4.4" class="ltx_td ltx_nopad_r ltx_align_left ltx_border_b"&gt;full logarithm&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/figure&gt;
&lt;div id="S1.SS1.p5" class="ltx_para"&gt;
&lt;p id="S1.SS1.p5.1" class="ltx_p"&gt;On three benchmark families the formula specializes in closed form; &lt;a href="#S1.T1" title="In 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Table&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; collects the three rates, proved as &lt;a href="#Thmcorollary1" title="Corollary 1 (Path). ‣ 3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollaries&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;, &lt;a href="#Thmcorollary2" title="Corollary 2 (Star). ‣ 3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmcorollary3" title="Corollary 3 (Complete binary tree). ‣ 3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; in &lt;a href="#S3.SS3" title="3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt;. The first two are external checks: the path recovers the bounded isotonic diagram &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib2" title="" class="ltx_ref"&gt;Zhang, 2002&lt;/a&gt;; &lt;a href="#bib.bib1" title="" class="ltx_ref"&gt;Chatterjee and Lafferty, 2018&lt;/a&gt;)&lt;/cite&gt;; the star recovers the simplex diagram of sparse estimation &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib5" title="" class="ltx_ref"&gt;Donoho and Johnstone, 1994&lt;/a&gt;; &lt;a href="#bib.bib6" title="" class="ltx_ref"&gt;Birgé and Massart, 2001&lt;/a&gt;)&lt;/cite&gt;. The complete binary tree resembles neither: branching entropy repeats across $\Theta(\log n)$ depth scales, making the profile $\alpha_{k}$ quadratic in $\log(n/k)$ once $k$ exceeds that logarithm, and the crossing takes a square root, leaving the single full logarithm.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS1.p6" class="ltx_para"&gt;
&lt;p id="S1.SS1.p6.1" class="ltx_p"&gt;An exactly evaluable estimator attains the rate. &lt;a href="#Thmtheorem2" title="Theorem 2 (Efficient estimation). ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;, proved in &lt;a href="#S4" title="4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;, constructs a deterministic estimator with worst-case risk $O(R^{*}_{T}(V,\sigma))$ on every tree, computed exactly in $O(n^{2}\log(n+1))$ arithmetic operations: an exponentially weighted aggregate over a class of integer states. Together with &lt;a href="#Thmtheorem5" title="Theorem 5 (Least squares). ‣ 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;, it answers the challenge of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib1" title="" class="ltx_ref"&gt;Chatterjee and Lafferty (2018)&lt;/a&gt;&lt;/cite&gt;: an efficient estimator closes the gap between least squares and the minimax risk.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS1.p7" class="ltx_para"&gt;
&lt;p id="S1.SS1.p7.1" class="ltx_p"&gt;The estimator of &lt;a href="#Thmtheorem2" title="Theorem 2 (Efficient estimation). ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; takes $V$ and $\sigma$ as inputs; the next two theorems remove them. &lt;a href="#Thmtheorem3" title="Theorem 3 (Budget adaptation). ‣ 4.3 Adaptation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;, proved in &lt;a href="#S4.SS3" title="4.3 Adaptation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.3&lt;/span&gt;&lt;/a&gt;, removes the budget: a deterministic polynomial-time estimator free of $V$ attains $C(R^{*}_{T}(V,\sigma)+\sigma^{2})\text{,}$ and no budget-free estimator stays below an $\Omega(\sigma^{2})$ floor on adjacent budgets. On the cone, where the original model carries no budget parameter, this adaptation is the return to the model as &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib1" title="" class="ltx_ref"&gt;Chatterjee and Lafferty (2018)&lt;/a&gt;&lt;/cite&gt; posed it. &lt;a href="#Thmtheorem4" title="Theorem 4 (Full adaptation). ‣ 4.3 Adaptation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; removes the noise level as well, in an explicit regime $Vw_{T}\leq c\sigma n\text{,}$ with $w_{T}$ a width functional that bounds how much of the tree’s difference structure the signal can contaminate, equal to $1$ on a path and $\Theta(\log n)$ on a balanced binary tree. Within the regime the noise dominates a majority of the tree’s difference statistics and a median estimates $\sigma\text{;}$ on families of bounded width, the regime sits within a $\sqrt{\log n}$ factor of a ceiling that no noise estimator can pass (&lt;a href="#S6" title="S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS1.p8" class="ltx_para"&gt;
&lt;p id="S1.SS1.p8.1" class="ltx_p"&gt;Every estimator above is built from the profile. The default estimator ignores it: the Euclidean projection onto the body, the tuning-free convex program of least squares at a known budget. &lt;a href="#Thmtheorem5" title="Theorem 5 (Least squares). ‣ 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;, proved in &lt;a href="#S5" title="5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;, determines its worst case: on every tree and at all $V,\sigma&amp;gt;0$ the projection loses at most a factor $C(1+\log(en))^{2/5}$ over the minimax risk, and on an explicit one-parameter family of brooms, at a single budget and noise level, it loses at least $c(\log n)^{2/5}\text{.}$ The separation is an exact power of the logarithm, matched from both sides, where the separations of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib14" title="" class="ltx_ref"&gt;Chatterjee (2014)&lt;/a&gt;; &lt;a href="#bib.bib15" title="" class="ltx_ref"&gt;Kur et al. (2024)&lt;/a&gt;&lt;/cite&gt; are polynomial in the sample size or the dimension. The equivalence of the fixed and capped budgets recorded above concerns minimax risks; &lt;a href="#Thmtheorem5" title="Theorem 5 (Least squares). ‣ 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; concerns the projection itself.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S1.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="technical-overview"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;1.2 &lt;/span&gt;Technical Overview&lt;/h3&gt;
&lt;div id="S1.SS2.p1" class="ltx_para"&gt;
&lt;p id="S1.SS2.p1.1" class="ltx_p"&gt;The upper bound in &lt;a href="#Thmtheorem1" title="Theorem 1 (Rate formula). ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; is soft: least squares over a covering net attains the entropy fixed point &lt;a href="#S1.E6" title="In 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.6&lt;/span&gt;&lt;/a&gt;, and two trivial estimators cap the risk at $V^{2}H_{T}$ and $\sigma^{2}n\text{.}$ Three tasks remain. The entropy must be &lt;em id="S1.SS2.p1.1.1" class="ltx_emph ltx_font_italic"&gt;realized&lt;/em&gt;, by hypotheses legal in a positive body (the lower bound); &lt;em id="S1.SS2.p1.1.2" class="ltx_emph ltx_font_italic"&gt;searched&lt;/em&gt;, exactly and quickly (the algorithm); and &lt;em id="S1.SS2.p1.1.3" class="ltx_emph ltx_font_italic"&gt;measured&lt;/em&gt; against the natural convex program (the least squares question). Two features of the flow polytope obstruct the classical routes to all three: positivity, the body being a simplex rather than a symmetric ball, so that a hypothesis moves only the leak mass it holds and sign-toggling lower bounds, whose one base point would have to fund every signed perturbation, fail; and overlap, root paths through a common vertex sharing coordinates, so that the contrast blocks realizing the entropy can overlap and are therefore priced (&lt;a href="#S3.SS2" title="3.2 The Packing Lower Bound ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.2&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS2.p2" class="ltx_para"&gt;
&lt;p id="S1.SS2.p2.1" class="ltx_p"&gt;The lower bound realizes the entropy inside the body. Ancestor-covering numbers force a separated vertex set (&lt;a href="#S3.Thmlemma2" title="Lemma 3.2 (Cover to packing). ‣ 3.2 The Packing Lower Bound ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.2&lt;/span&gt;&lt;/a&gt;); groups drawn from it, in subtrees with disjoint edge sets, share the budget exactly; a multiscale code fills each group; and a product form of Fano’s inequality (&lt;a href="#S3.Thmlemma3" title="Lemma 3.3 (Fano’s inequality for overlapping blocks). ‣ 3.2 The Packing Lower Bound ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt;) prices the overlap between scales once, through a normalized Gram row sum, returning $R^{*}_{T}\geq c\min\{V^{2}r/q,\ \sigma^{2}q\log(eM/q)\}$ for $M$ vertices at pairwise distance $r$ in $q$ groups; matching $q$ to the profile recovers its truncated logarithm. Where &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib1" title="" class="ltx_ref"&gt;Chatterjee and Lafferty (2018)&lt;/a&gt;&lt;/cite&gt; allocate mass across vertex-disjoint paths, the same budget discipline runs on arbitrarily overlapping routes.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS2.p3" class="ltx_para"&gt;
&lt;p id="S1.SS2.p3.1" class="ltx_p"&gt;The upper bound builds one coded cover for all signals. Dyadic ancestor nets and their cells depend only on the tree and the information budget $k\text{;}$ for each signal, heavy cells split and light cells collapse to their roots, sparse sampling restoring the light exits; every subtree is an interval of the depth-first preorder, so one scalar, the running floor of cumulative masses along it, rounds all subtree sums at once. The resulting approximant is within squared error $O(V^{2}\delta_{k})$ of its signal and carries a fixed root sum, a code length $O(k)\text{,}$ and flow states confined to an $O(k)$ range; counting the class at $e^{O(k)}$ gives the entropy bound &lt;a href="#S3.E2" title="In Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.2&lt;/span&gt;&lt;/a&gt;. An integer-leak net already appears in the upper bound of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib1" title="" class="ltx_ref"&gt;Chatterjee and Lafferty (2018)&lt;/a&gt;&lt;/cite&gt;, at cost $\log n$ per unit of mass and at the diameter scale; the activation charges lower this to $O(1)$ per unit and the profile scale, and these reductions are what the estimator consumes.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS2.p4" class="ltx_para"&gt;
&lt;p id="S1.SS2.p4.1" class="ltx_p"&gt;The two halves meet at the crossing. In the interior case the nonincreasing profile scale $V^{2}\delta_{k}$ first falls below $A_{0}\sigma^{2}k$ at $k_{0}\text{;}$ the cover gives the rate $\sigma^{2}k_{0}$ there, the packing gives $\sigma^{2}(k_{0}-1)$ one step earlier, and the corner regimes are collected by a two-point bound and the dimension cap. This proves &lt;a href="#Thmtheorem1" title="Theorem 1 (Rate formula). ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmproposition1" title="Proposition 1 (Entropy fixed point). ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition 1&lt;/span&gt;&lt;/a&gt; as four cases of one argument.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS2.p5" class="ltx_para"&gt;
&lt;p id="S1.SS2.p5.1" class="ltx_p"&gt;The estimator replaces the search over the cover by an average, an exponentially weighted aggregate under a Kraft-type prior built from the code length. Its risk analysis composes two exact identities, Stein’s and the Gibbs variational identity, with no union bound and approximation constant one (&lt;a href="#S4.Thmlemma1" title="Lemma 4.1 (Aggregation oracle). ‣ 4.1 Aggregation over Integer States ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.1&lt;/span&gt;&lt;/a&gt;). The confinement is what makes the computation possible: one integer state in $[0,3k]$ per vertex turns the partition function into a tree recursion of polynomial messages, evaluated exactly; one reverse-mode sweep then reads off the posterior mean at every coordinate. The recursion is dynamic programming over distributions, not values.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS2.p6" class="ltx_para"&gt;
&lt;p id="S1.SS2.p6.1" class="ltx_p"&gt;Adaptation reuses the cover. Removing the quantization from the approximant of &lt;a href="#S3.Thmlemma1" title="Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt; leaves amplitude-free profile subspaces; a Kraft-weighted penalized selection over them, joined with finite grids of candidate budgets, attains $C(R^{*}_{T}+\sigma^{2})$ without knowing $V\text{,}$ the additive $\sigma^{2}$ forced on adjacent budgets by a two-point test at the root. For unknown $\sigma\text{,}$ a median of tree difference statistics survives contamination when $Vw_{T}\leq c\sigma n\text{,}$ and the selection runs at the rounded estimate.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS2.p7" class="ltx_para"&gt;
&lt;p id="S1.SS2.p7.1" class="ltx_p"&gt;The broom of &lt;a href="#Thmtheorem5" title="Theorem 5 (Least squares). ‣ 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;, a handle of $L$ edges feeding $e^{\Theta(L^{5/2})}$ terminal leaves, makes the blindness of the projection quantitative: the extreme leaf noise repays the quadratic cost of the full-budget route through the handle, forcing least squares to lose $L^{3/2}\text{,}$ while the profile sees one ancestor covering the terminal star at every radius $r\geq 1$ and the minimax risk stays at order $\sqrt{L}\text{,}$ that of the handle alone; with $\log n\asymp L^{5/2}\text{,}$ the ratio is the $2/5$ power of the logarithm. For the matching upper bound, the localized-width analysis of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib14" title="" class="ltx_ref"&gt;Chatterjee (2014)&lt;/a&gt;&lt;/cite&gt; runs on the coded cover with centers chosen after the noise, and a width branch and a height branch meet at the same power.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS2.p8" class="ltx_para"&gt;
&lt;p id="S1.SS2.p8.1" class="ltx_p"&gt;Three devices are stated for reuse: the overlapping-block Fano inequality (&lt;a href="#S3.Thmlemma3" title="Lemma 3.3 (Fano’s inequality for overlapping blocks). ‣ 3.2 The Packing Lower Bound ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt;), which refers to no tree and prices overlap inside an arbitrary convex constraint; the positive packing of &lt;a href="#S3.SS2" title="3.2 The Packing Lower Bound ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.2&lt;/span&gt;&lt;/a&gt;, a template for bodies in which sign toggling is illegal; and the aggregate of &lt;a href="#S4" title="4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;, whose oracle inequality holds over any finite class and whose evaluation is exact whenever the class is dynamically
programmable. &lt;a href="#S2" title="2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Sections&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;, &lt;a href="#S3" title="3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;, &lt;a href="#S4" title="4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S5" title="5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; prove the results in turn; the remaining details are in the appendices.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S1.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="related-work"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;1.3 &lt;/span&gt;Related Work&lt;/h3&gt;
&lt;div id="S1.SS3.p1" class="ltx_para"&gt;
&lt;p id="S1.SS3.p1.1" class="ltx_p"&gt;The closest work is &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib1" title="" class="ltx_ref"&gt;Chatterjee and Lafferty (2018)&lt;/a&gt;&lt;/cite&gt;. They introduced tree flows and analyzed the projection onto the flow cone in two regimes: for trees of bounded depth they proved matching risk bounds in the principal range of budgets, and on trees consisting of many long disjoint paths they determined the exponents of both the projection and the minimax risk, which disagree. Their projection takes no budget input, and over part of that family its risk exceeds the minimax risk polynomially in $n$ at a fixed budget, by overfitting the zero signal where the cone has large statistical dimension; the projection of &lt;a href="#Thmtheorem5" title="Theorem 5 (Least squares). ‣ 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; receives the budget, which removes that failure and leaves exactly the $2/5$ power of the logarithm. The constraint family itself predates the statistics: &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib10" title="" class="ltx_ref"&gt;Benabbas et al. (2011)&lt;/a&gt;&lt;/cite&gt; smooth hierarchical data under the same inequalities in $\ell_{1}\text{.}$ Isotonic regression on richer orders &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib17" title="" class="ltx_ref"&gt;Han et al., 2019&lt;/a&gt;)&lt;/cite&gt; shares the ambient structure but not the geometry: it acts on differences, while the flow constraint transports mass, thereby making the body a simplex. On the path the model meets the isotonic tradition &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib2" title="" class="ltx_ref"&gt;Zhang, 2002&lt;/a&gt;; &lt;a href="#bib.bib4" title="" class="ltx_ref"&gt;Chatterjee et al., 2015&lt;/a&gt;; &lt;a href="#bib.bib20" title="" class="ltx_ref"&gt;Bellec, 2018&lt;/a&gt;; &lt;a href="#bib.bib24" title="" class="ltx_ref"&gt;Guntuboyina and Sen, 2018&lt;/a&gt;)&lt;/cite&gt;, in its bounded form &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib23" title="" class="ltx_ref"&gt;Luss and Rosset, 2017&lt;/a&gt;)&lt;/cite&gt;, and &lt;a href="#Thmcorollary1" title="Corollary 1 (Path). ‣ 3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; returns its phase diagram. The obstacle on trees is therefore the budget slice, the simplex geometry, not monotonicity.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS3.p2" class="ltx_para"&gt;
&lt;p id="S1.SS3.p2.1" class="ltx_p"&gt;Metric entropy has determined minimax rates since &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib11" title="" class="ltx_ref"&gt;Yang and Barron (1999)&lt;/a&gt;&lt;/cite&gt; tied them to the global entropy of the function class; for bounded convex constraints in the Gaussian sequence model, &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib12" title="" class="ltx_ref"&gt;Neykov (2023)&lt;/a&gt;&lt;/cite&gt; gives the exact rate through a local entropy fixed point. On the flow polytopes the two halves of that program take concrete form: the profile computes the rate that the fixed point governs, in closed combinatorial form and in near-linear time, and the packing of &lt;a href="#S3.SS2" title="3.2 The Packing Lower Bound ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.2&lt;/span&gt;&lt;/a&gt; realizes the entropy inside a cone with no symmetry, one-sided perturbations replacing sign toggling; compare the cone geometry of testing in &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib19" title="" class="ltx_ref"&gt;Wei et al. (2019)&lt;/a&gt;&lt;/cite&gt;. On the star, positivity leaves the sparse rate unchanged; what it changes is the lower bound, which must be built one-sided. The covering geometry has an operator-theoretic precedent: the body is $V$ times the image of the positive face of the $\ell_{1}$ ball under the tree’s summation operator, and &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib21" title="" class="ltx_ref"&gt;Lifshits and Linde (2011a)&lt;/a&gt;; &lt;a href="#bib.bib22" title="" class="ltx_ref"&gt;Lifshits and Linde (2011b)&lt;/a&gt;&lt;/cite&gt; bound the entropy numbers of such operators through ancestor covering numbers; the critical case stops a heavy–light partition at its light sets and counts the outcomes, the combinatorial core that &lt;a href="#S3.SS1" title="3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt; shares. Compactness of the symmetric image is their question; the positive slice, the minimax risk, and the certificates behind the estimator are this paper’s.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS3.p3" class="ltx_para"&gt;
&lt;p id="S1.SS3.p3.1" class="ltx_p"&gt;That the projection onto a convex body can miss the minimax rate by a large factor was shown by &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib3" title="" class="ltx_ref"&gt;Zhang (2013)&lt;/a&gt;&lt;/cite&gt; on an ellipsoid and by &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib14" title="" class="ltx_ref"&gt;Chatterjee (2014)&lt;/a&gt;&lt;/cite&gt; on a designed body, in both cases by a factor as large as $\sqrt{n}\text{;}$ the fixed-point analysis of least squares in the latter is the engine of our upper bound in &lt;a href="#S5" title="5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;. Separations of polynomial order in the sample size or the dimension are known for several natural programs &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib15" title="" class="ltx_ref"&gt;Kur et al., 2024&lt;/a&gt;; &lt;a href="#bib.bib16" title="" class="ltx_ref"&gt;Vaškevičius and Zhivotovskiy, 2023&lt;/a&gt;)&lt;/cite&gt;, and on an $\ell_{p}$ ball &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib31" title="" class="ltx_ref"&gt;Aolaritei et al. (2025)&lt;/a&gt;&lt;/cite&gt; separate the projection from the minimax rate by a power of the logarithm. &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib13" title="" class="ltx_ref"&gt;Prasadan and Neykov (2025)&lt;/a&gt;&lt;/cite&gt; characterize the boundary exactly: least squares is minimax optimal if and only if the local Gaussian width map is Lipschitz at the relevant scales. By that characterization, &lt;a href="#Thmtheorem5" title="Theorem 5 (Least squares). ‣ 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; shows the Lipschitz bound cannot hold uniformly along the brooms, and it goes past the optimal-or-not dichotomy by bounding the worst-case ratio of least squares to the minimax rate from both sides. The upper bound speaks for the projection as much as against it: a loss beyond the $2/5$ power of the logarithm is impossible on any tree.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS3.p4" class="ltx_para"&gt;
&lt;p id="S1.SS3.p4.1" class="ltx_p"&gt;The estimator of &lt;a href="#Thmtheorem2" title="Theorem 2 (Efficient estimation). ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; belongs to the aggregation tradition. &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib25" title="" class="ltx_ref"&gt;Leung and Barron (2006)&lt;/a&gt;&lt;/cite&gt; proved an exact Stein-based oracle inequality for exponentially weighted aggregates, and &lt;a href="#S4.Thmlemma1" title="Lemma 4.1 (Aggregation oracle). ‣ 4.1 Aggregation over Integer States ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.1&lt;/span&gt;&lt;/a&gt; descends from it; sharp PAC-Bayes bounds, optimal sparse aggregation, and unknown-variance mixing follow in &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib26" title="" class="ltx_ref"&gt;Dalalyan and Tsybakov (2008)&lt;/a&gt;; &lt;a href="#bib.bib27" title="" class="ltx_ref"&gt;Rigollet and Tsybakov (2011)&lt;/a&gt;; &lt;a href="#bib.bib28" title="" class="ltx_ref"&gt;Giraud (2008)&lt;/a&gt;&lt;/cite&gt;. Exact mixtures over combinatorial families have a computing tradition of their own: context-tree weighting &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib29" title="" class="ltx_ref"&gt;Willems et al., 1995&lt;/a&gt;)&lt;/cite&gt; and circuit differentiation for marginals &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib30" title="" class="ltx_ref"&gt;Darwiche, 2003&lt;/a&gt;)&lt;/cite&gt;, without squared-loss risk guarantees. The class of integer states sits in both traditions: its code length ties the Kraft prior, in the tradition of minimum description length &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib32" title="" class="ltx_ref"&gt;Barron and Cover, 1991&lt;/a&gt;)&lt;/cite&gt;, to the minimax rate, and its confined states make the posterior mean a tree recursion, evaluated exactly. Shape-constrained solvers compute hard projections &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib33" title="" class="ltx_ref"&gt;Robertson et al., 1988&lt;/a&gt;; &lt;a href="#bib.bib18" title="" class="ltx_ref"&gt;Kyng et al., 2015&lt;/a&gt;)&lt;/cite&gt;, the object that &lt;a href="#Thmtheorem5" title="Theorem 5 (Least squares). ‣ 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; measures; the recursion here averages where those optimize. A recent line attains polynomial-time near-optimality on symmetric bodies under further regularity and oracle hypotheses &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib34" title="" class="ltx_ref"&gt;Neykov, 2026&lt;/a&gt;)&lt;/cite&gt;; the flow polytope is a simplex. The trade is structure for exactness: a combinatorial family of bodies, in exchange for the exact rate and the exact estimator.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S2" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="the-flow-polytope-and-the-ancestor-profile"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;2 &lt;/span&gt;The Flow Polytope and the Ancestor Profile&lt;/h2&gt;
&lt;div id="S2.p1" class="ltx_para"&gt;
&lt;p id="S2.p1.1" class="ltx_p"&gt;This section records the interfaces used by the rest of the paper: the two normal forms of the flow polytope, the Euclidean realization of the tree metric, and the working properties of the ancestor profile, including the surrogate index through which the profile is computed. Proofs are collected in &lt;a href="#S1a" title="S.1 The Profile Toolkit ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.1&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S2.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-flow-polytope"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;2.1 &lt;/span&gt;The Flow Polytope&lt;/h3&gt;
&lt;div id="S2.SS1.p1" class="ltx_para"&gt;
&lt;p id="S2.SS1.p1.1" class="ltx_p"&gt;We complete the tree notation of &lt;a href="#S1.SS1" title="1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.1&lt;/span&gt;&lt;/a&gt;. For $v\neq o$ we write $\operatorname{pa}(v)$ for the parent of $v$ and identify $v$ with its parent edge $(\operatorname{pa}(v),v)\text{,}$ of which $v$ is the &lt;em id="S2.SS1.p1.1.1" class="ltx_emph ltx_font_italic"&gt;lower endpoint&lt;/em&gt;; $\operatorname{ch}(v)$ is the set of children of $v\text{,}$ and $T_{v}:=\{u\in\mathsf{V}:v\preceq u\}$ is the subtree rooted at $v\text{.}$ The depth of a vertex is its distance from the root, and the height of $T$ is $h_{T}:=\max_{v\in\mathsf{V}}\operatorname{depth}(v)\text{,}$ so that $h_{T}\leq H_{T}\leq 2h_{T}\text{.}$ Universal constants $c,C,c^{\prime},C^{\prime},\dots$ may change value from occurrence to occurrence, while subscripted constants such as $A_{0}$ and $C_{\star}$ keep their values fixed once introduced. Logarithms are natural. Complexity statements count arithmetic operations in the real-RAM model: arithmetic, comparisons, integer part, and evaluations of $\exp$ and $\log$ on real registers are exact unit-cost operations, and two polynomials of degree $m$ can be multiplied in $O(m\log m)$ operations by the fast Fourier transform &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib39" title="" class="ltx_ref"&gt;von zur Gathen and Gerhard, 2013&lt;/a&gt;)&lt;/cite&gt;; what exactness means for the estimator is stated in &lt;a href="#S4.Thmremark1" title="Remark 4.1 (Computational model). ‣ 4.2 Exact Evaluation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Remark&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.1&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS1.p2" class="ltx_para"&gt;
&lt;p id="S2.SS1.p2.1" class="ltx_p"&gt;The polytope has a barycentric normal form and a flow normal form: the first is the legality certificate behind every lower-bound construction of &lt;a href="#S3" title="3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;, the second identifies the body as a set of flows and explains its name.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmlemma1" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmlemma1.2" class="ltx_text ltx_font_bold"&gt;Lemma 2.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmlemma1.3" class="ltx_text ltx_font_bold"&gt; (Normal forms).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmlemma1.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmlemma1.p1.1" class="ltx_p"&gt;&lt;span id="S2.Thmlemma1.p1.1.1" class="ltx_text ltx_font_italic"&gt;For $\mu\in\mathbb{R}^{\mathsf{V}}$ the following are equivalent:&lt;/span&gt;&lt;/p&gt;
&lt;ol id="S2.I1" class="ltx_enumerate"&gt;
&lt;li id="S2.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;1.&lt;/span&gt;
&lt;div id="S2.I1.i1.p1" class="ltx_para"&gt;
&lt;p id="S2.I1.i1.p1.1" class="ltx_p"&gt;$\mu\in\mathcal{F}_{V}(T)$&lt;span id="S2.I1.i1.p1.1.1" class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S2.I1.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;2.&lt;/span&gt;
&lt;div id="S2.I1.i2.p1" class="ltx_para"&gt;
&lt;p id="S2.I1.i2.p1.1" class="ltx_p"&gt;$\mu=\sum_{u\in\mathsf{V}}s_{u}p_{u}$&lt;span id="S2.I1.i2.p1.1.1" class="ltx_text ltx_font_italic"&gt; with &lt;/span&gt;$s_{u}\geq 0$&lt;span id="S2.I1.i2.p1.1.2" class="ltx_text ltx_font_italic"&gt; for all
&lt;/span&gt;$u$&lt;span id="S2.I1.i2.p1.1.3" class="ltx_text ltx_font_italic"&gt; and &lt;/span&gt;$\sum_{u\in\mathsf{V}}s_{u}=V$&lt;span id="S2.I1.i2.p1.1.4" class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S2.I1.i3" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;3.&lt;/span&gt;
&lt;div id="S2.I1.i3.p1" class="ltx_para"&gt;
&lt;p id="S2.I1.i3.p1.1" class="ltx_p"&gt;$\mu(o)=V$&lt;span id="S2.I1.i3.p1.1.1" class="ltx_text ltx_font_italic"&gt; and
&lt;/span&gt;$\mu(v)\geq\sum_{c\in\operatorname{ch}(v)}\mu(c)$&lt;span id="S2.I1.i3.p1.1.2" class="ltx_text ltx_font_italic"&gt; for every &lt;/span&gt;$v\in\mathsf{V}$&lt;span id="S2.I1.i3.p1.1.3" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p id="S2.Thmlemma1.p1.2" class="ltx_p"&gt;&lt;span id="S2.Thmlemma1.p1.2.1" class="ltx_text ltx_font_italic"&gt;The coefficients in &lt;/span&gt;(&lt;a href="#S2.I1.i2" title="Item 2 ‣ Lemma 2.1 (Normal forms). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;)&lt;span id="S2.Thmlemma1.p1.2.2" class="ltx_text ltx_font_italic"&gt; are unique, and they are tied to the coordinates by the subtree sums&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.Ex1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mu(v)\ =\ \sum_{u\succeq v}s_{u},\qquad s_{v}\ =\ \mu(v)-\sum_{c\in\operatorname{ch}(v)}\mu(c)\qquad(v\in\mathsf{V}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS1.p3" class="ltx_para"&gt;
&lt;p id="S2.SS1.p3.1" class="ltx_p"&gt;Form (&lt;a href="#S2.I1.i3" title="Item 3 ‣ Lemma 2.1 (Normal forms). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;) exhibits $\mathcal{F}_{V}(T)$ as the set of monotone flows at budget $V\text{,}$ with $s_{v}$ the &lt;em id="S2.SS1.p3.1.1" class="ltx_emph ltx_font_italic"&gt;leak&lt;/em&gt; at $v\text{,}$ the mass that stops there &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib1" title="" class="ltx_ref"&gt;Chatterjee and Lafferty, 2018&lt;/a&gt;)&lt;/cite&gt;. In a linear order of $\mathsf{V}$ that places ancestors before descendants, the matrix with columns $(p_{u})_{u\in\mathsf{V}}$ is upper triangular with unit diagonal (&lt;a href="#S1a" title="S.1 The Profile Toolkit ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.1&lt;/span&gt;&lt;/a&gt;), so the $p_{u}$ are linearly independent and the body is a nondegenerate $(n-1)$-dimensional simplex with vertex set $\{Vp_{u}:u\in\mathsf{V}\}\text{.}$ Finally, $\mu(o)=V$ identically on the body: the root coordinate carries no statistical content, and all estimation error lives on the nonroot coordinates.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS1.p4" class="ltx_para"&gt;
&lt;p id="S2.SS1.p4.1" class="ltx_p"&gt;The second interface converts tree combinatorics into Euclidean geometry: squared Euclidean distance between root-path indicators is tree distance, which is why the ancestor profile, defined by the tree metric, controls Euclidean covering and packing of the body.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmlemma2" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmlemma2.2" class="ltx_text ltx_font_bold"&gt;Lemma 2.2&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmlemma2.3" class="ltx_text ltx_font_bold"&gt; (Isometry and edge supports).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmlemma2.p1" class="ltx_para"&gt;
&lt;ol id="S2.I2" class="ltx_enumerate"&gt;
&lt;li id="S2.I2.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;1.&lt;/span&gt;
&lt;div id="S2.I2.i1.p1" class="ltx_para"&gt;
&lt;p id="S2.I2.i1.p1.1" class="ltx_p"&gt;$\|p_{u}-p_{w}\|_{2}^{2}=d_{T}(u,w)$&lt;span id="S2.I2.i1.p1.1.1" class="ltx_text ltx_font_italic"&gt; for all &lt;/span&gt;$u,w\in\mathsf{V}$&lt;span id="S2.I2.i1.p1.1.2" class="ltx_text ltx_font_italic"&gt;;
consequently &lt;/span&gt;$\operatorname{diam}^{2}\mathcal{F}_{V}(T)=V^{2}H_{T}$&lt;span id="S2.I2.i1.p1.1.3" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S2.I2.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;2.&lt;/span&gt;
&lt;div id="S2.I2.i2.p1" class="ltx_para"&gt;
&lt;p id="S2.I2.i2.p1.1" class="ltx_p"&gt;&lt;span id="S2.I2.i2.p1.1.1" class="ltx_text ltx_font_italic"&gt;For &lt;/span&gt;$a\preceq b$&lt;span id="S2.I2.i2.p1.1.2" class="ltx_text ltx_font_italic"&gt;, &lt;/span&gt;$p_{b}-p_{a}=\mathbf{1}_{(a,b]}$&lt;span id="S2.I2.i2.p1.1.3" class="ltx_text ltx_font_italic"&gt;, the
indicator of &lt;/span&gt;$\{v:a\prec v\preceq b\}$&lt;span id="S2.I2.i2.p1.1.4" class="ltx_text ltx_font_italic"&gt;; in general, the support of
&lt;/span&gt;$p_{u}-p_{w}$&lt;span id="S2.I2.i2.p1.1.5" class="ltx_text ltx_font_italic"&gt; is exactly the set of lower endpoints of the edges on the
path from &lt;/span&gt;$u$&lt;span id="S2.I2.i2.p1.1.6" class="ltx_text ltx_font_italic"&gt; to &lt;/span&gt;$w$&lt;span id="S2.I2.i2.p1.1.7" class="ltx_text ltx_font_italic"&gt;. In particular, differences &lt;/span&gt;$p_{u}-p_{w}$&lt;span id="S2.I2.i2.p1.1.8" class="ltx_text ltx_font_italic"&gt; taken
within edge-disjoint connected subtrees have disjoint supports.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS1.p5" class="ltx_para"&gt;
&lt;p id="S2.SS1.p5.1" class="ltx_p"&gt;Behind (&lt;a href="#S2.I2.i1" title="Item 1 ‣ Lemma 2.2 (Isometry and edge supports). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;) is the ancestor count $\langle p_{u},p_{w}\rangle=\operatorname{depth}(u\wedge w)+1\text{,}$ where $u\wedge w$ denotes the deepest common ancestor of $u$ and $w\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S2.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-ancestor-profile"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;2.2 &lt;/span&gt;The Ancestor Profile&lt;/h3&gt;
&lt;div id="S2.SS2.p1" class="ltx_para"&gt;
&lt;p id="S2.SS2.p1.1" class="ltx_p"&gt;The profile $\alpha_{k},\delta_{k}$ and the crossing index $k_{0}$ were defined in &lt;a href="#S1.E4" title="In 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equations&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.4&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S1.E5" title="Equation 1.5 ‣ 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1.5&lt;/span&gt;&lt;/a&gt;; this subsection collects the properties used below. A star shows why the truncation is there.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmremark1" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmremark1.2" class="ltx_text ltx_font_bold"&gt;Remark 2.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmremark1.3" class="ltx_text ltx_font_bold"&gt; (Why the profile is truncated).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmremark1.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmremark1.p1.1" class="ltx_p"&gt;&lt;span id="S2.Thmremark1.p1.1.1" class="ltx_text ltx_font_italic"&gt;On the star with $m$ leaves rooted at the hub, a leaf is ancestor-covered only by itself or by the hub, so $N^{\uparrow}_{T}(r)=m+1$ for $0\leq r&amp;lt;1$ and $N^{\uparrow}_{T}(r)=1$ for $r\geq 1\text{;}$ the expression in &lt;a href="#S1.E4" title="In 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.4&lt;/span&gt;&lt;/a&gt; evaluates exactly to&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.Ex2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\alpha_{k}\ =\ \min\Bigl\{k,\ \Bigl[\log\frac{m+1}{k}\Bigr]_{+}\Bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.Thmremark1.p1.2" class="ltx_p"&gt;&lt;span id="S2.Thmremark1.p1.2.1" class="ltx_text ltx_font_italic"&gt;Without the truncation, a star with $\lceil e^{2k^{2}}\rceil$ leaves would be assigned $\alpha_{k}\geq k^{2}\text{,}$ hence $V^{2}\alpha_{k}/k\geq A_{0}\sigma^{2}k$ at $V^{2}=A_{0}\sigma^{2}\text{,}$ and the profile-to-risk half of &lt;a href="#S3" title="3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; would assert a minimax risk of order at least $\sigma^{2}k\text{;}$ for large $k$ this contradicts the bound $R^{*}_{T}\leq V^{2}H_{T}=2A_{0}\sigma^{2}$ furnished by the constant estimator $Vp_{o}\text{,}$ since the star has $H_{T}=2\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS2.p2" class="ltx_para"&gt;
&lt;p id="S2.SS2.p2.1" class="ltx_p"&gt;The root covers every vertex at radius $h_{T}\text{,}$ so $N^{\uparrow}_{T}(r)=1$ for $r\geq h_{T}$ and the supremum in &lt;a href="#S1.E4" title="In 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.4&lt;/span&gt;&lt;/a&gt; is effectively over $r&amp;lt;h_{T}\text{.}$ Evaluating the profile exactly involves every integer radius below $h_{T}\text{;}$ a factor-of-two surrogate needs only geometrically spaced ones, and it is the surrogate that the estimator of &lt;a href="#S4" title="4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; consumes. Define&lt;/p&gt;
&lt;table id="S2.E1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\overline{\delta}_{k}(T):=\frac{2}{k}\,\max_{\begin{subarray}{c}q=2^{\ell}-1,\ \ell\in\{0,1,2,\dots\}\\ 2^{\ell}\leq h_{T}\end{subarray}}\ (q+1)\,\min\Bigl\{k,\ \Bigl[\log\frac{N^{\uparrow}_{T}(q)}{k}\Bigr]_{+}\Bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(2.1)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.SS2.p2.2" class="ltx_p"&gt;with $\overline{\delta}_{k}(T):=0$ if $h_{T}=0\text{,}$ and the &lt;em id="S2.SS2.p2.2.1" class="ltx_emph ltx_font_italic"&gt;algorithmic crossing index&lt;/em&gt;&lt;/p&gt;
&lt;table id="S2.E2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$k_{\mathrm{alg}}=k_{\mathrm{alg}}(T,V,\sigma):=\min\Bigl\{k\geq 1:\ V^{2}\overline{\delta}_{k}(T)\leq 2A_{0}\sigma^{2}k\ \text{ or }\ k&amp;gt;n/C_{\star}\Bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(2.2)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S2.Thmlemma3" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmlemma3.2" class="ltx_text ltx_font_bold"&gt;Lemma 2.3&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmlemma3.3" class="ltx_text ltx_font_bold"&gt; (Profile toolkit).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmlemma3.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmlemma3.p1.1" class="ltx_p"&gt;&lt;span id="S2.Thmlemma3.p1.1.1" class="ltx_text ltx_font_italic"&gt;For every finite rooted tree $T\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;ol id="S2.I3" class="ltx_enumerate"&gt;
&lt;li id="S2.I3.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;1.&lt;/span&gt;
&lt;div id="S2.I3.i1.p1" class="ltx_para"&gt;
&lt;p id="S2.I3.i1.p1.1" class="ltx_p"&gt;$\delta_{k+1}(T)\leq\delta_{k}(T)\leq h_{T}$&lt;span id="S2.I3.i1.p1.1.1" class="ltx_text ltx_font_italic"&gt; for every
&lt;/span&gt;$k\geq 1$&lt;span id="S2.I3.i1.p1.1.2" class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S2.I3.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;2.&lt;/span&gt;
&lt;div id="S2.I3.i2.p1" class="ltx_para"&gt;
&lt;p id="S2.I3.i2.p1.1" class="ltx_p"&gt;&lt;span id="S2.I3.i2.p1.1.1" class="ltx_text ltx_font_italic"&gt;for &lt;/span&gt;$n\geq 2$&lt;span id="S2.I3.i2.p1.1.2" class="ltx_text ltx_font_italic"&gt; and every &lt;/span&gt;$k\geq 1$&lt;span id="S2.I3.i2.p1.1.3" class="ltx_text ltx_font_italic"&gt;,&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.E3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\alpha_{k}(T)=\max_{0\leq q&amp;lt;h_{T}}\ (q+1)\,\min\Bigl\{k,\ \Bigl[\log\frac{N^{\uparrow}_{T}(q)}{k}\Bigr]_{+}\Bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(2.3)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.I3.i2.p1.2" class="ltx_p"&gt;&lt;span id="S2.I3.i2.p1.2.1" class="ltx_text ltx_font_italic"&gt;the maximum running over integer radii, and &lt;/span&gt;$\alpha_{k}(T)=0$&lt;span id="S2.I3.i2.p1.2.2" class="ltx_text ltx_font_italic"&gt; when
&lt;/span&gt;$n=1$&lt;span id="S2.I3.i2.p1.2.3" class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S2.I3.i3" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;3.&lt;/span&gt;
&lt;div id="S2.I3.i3.p1" class="ltx_para"&gt;
&lt;p id="S2.I3.i3.p1.1" class="ltx_p"&gt;$\delta_{k}\leq\overline{\delta}_{k}\leq 2\delta_{k}$&lt;span id="S2.I3.i3.p1.1.1" class="ltx_text ltx_font_italic"&gt;
for every &lt;/span&gt;$k\geq 1$&lt;span id="S2.I3.i3.p1.1.2" class="ltx_text ltx_font_italic"&gt;, the map &lt;/span&gt;$k\mapsto\overline{\delta}_{k}(T)$&lt;span id="S2.I3.i3.p1.1.3" class="ltx_text ltx_font_italic"&gt; is
nonincreasing, and&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.Ex3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$k_{\mathrm{alg}}\ \leq\ k_{0}\ \leq\ 2\,k_{\mathrm{alg}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2.I3.i3.p1.2" class="ltx_p"&gt;&lt;span id="S2.I3.i3.p1.2.1" class="ltx_text ltx_font_italic"&gt;Moreover, a minimum ancestor &lt;/span&gt;$q$&lt;span id="S2.I3.i3.p1.2.2" class="ltx_text ltx_font_italic"&gt;-net can be computed exactly in &lt;/span&gt;$O(n)$&lt;span id="S2.I3.i3.p1.2.3" class="ltx_text ltx_font_italic"&gt;
operations for each integer &lt;/span&gt;$q\geq 0$&lt;span id="S2.I3.i3.p1.2.4" class="ltx_text ltx_font_italic"&gt;, by a one-pass
&lt;/span&gt;&lt;em id="S2.I3.i3.p1.2.5" class="ltx_emph"&gt;residual-depth greedy&lt;/em&gt;&lt;span id="S2.I3.i3.p1.2.6" class="ltx_text ltx_font_italic"&gt;; consequently &lt;/span&gt;$k_{\mathrm{alg}}$&lt;span id="S2.I3.i3.p1.2.7" class="ltx_text ltx_font_italic"&gt; is computable in
&lt;/span&gt;$O(n\log(n+1))$&lt;span id="S2.I3.i3.p1.2.8" class="ltx_text ltx_font_italic"&gt; operations, and &lt;/span&gt;$k_{0}$&lt;span id="S2.I3.i3.p1.2.9" class="ltx_text ltx_font_italic"&gt; in &lt;/span&gt;$O(n\,h_{T})$&lt;span id="S2.I3.i3.p1.2.10" class="ltx_text ltx_font_italic"&gt; operations.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS2.p3" class="ltx_para"&gt;
&lt;p id="S2.SS2.p3.1" class="ltx_p"&gt;The greedy selects a center $q$ levels above a deepest uncovered vertex, or the root when fewer remain; its exactness and the remaining proofs are in &lt;a href="#S1a" title="S.1 The Profile Toolkit ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.1&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS2.p4" class="ltx_para"&gt;
&lt;p id="S2.SS2.p4.1" class="ltx_p"&gt;&lt;a href="#S3" title="3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; now converts the profile into the minimax rate: an upper bound through a coded cover, and a matching lower bound through a positive packing.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S3" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="the-rate-formula"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;3 &lt;/span&gt;The Rate Formula&lt;/h2&gt;
&lt;div id="S3.p1" class="ltx_para"&gt;
&lt;p id="S3.p1.1" class="ltx_p"&gt;The main theorem of the paper is the rate formula.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem1" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="Thmtheorem1.2" class="ltx_text ltx_font_bold"&gt;Theorem 1&lt;/span&gt;&lt;/span&gt;&lt;span id="Thmtheorem1.3" class="ltx_text ltx_font_bold"&gt; (Rate formula).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p id="Thmtheorem1.p1.1" class="ltx_p"&gt;&lt;span id="Thmtheorem1.p1.1.1" class="ltx_text ltx_font_italic"&gt;There are universal constants $c,C&amp;gt;0$ such that for every finite rooted tree $T$ and all $V,\sigma&amp;gt;0\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$c\,R^{*}_{T}(V,\sigma)\ \leq\ \min\bigl\{V^{2}H_{T},\ \sigma^{2}k_{0}(T,V,\sigma)\bigr\}\ \leq\ C\,R^{*}_{T}(V,\sigma).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.p2" class="ltx_para"&gt;
&lt;p id="S3.p2.1" class="ltx_p"&gt;The formula is insensitive to the choice of $(A_{0},C_{\star})$ in &lt;a href="#S1.E5" title="In 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.5&lt;/span&gt;&lt;/a&gt;: any pair for which &lt;a href="#Thmtheorem1" title="Theorem 1 (Rate formula). ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; holds yields a formula $\asymp R^{*}_{T}\text{.}$ The entropy reading is the following.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmproposition1" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="Thmproposition1.2" class="ltx_text ltx_font_bold"&gt;Proposition 1&lt;/span&gt;&lt;/span&gt;&lt;span id="Thmproposition1.3" class="ltx_text ltx_font_bold"&gt; (Entropy fixed point).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="Thmproposition1.p1" class="ltx_para"&gt;
&lt;p id="Thmproposition1.p1.1" class="ltx_p"&gt;&lt;span id="Thmproposition1.p1.1.1" class="ltx_text ltx_font_italic"&gt;For every finite rooted tree $T$ and all $V,\sigma&amp;gt;0\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{*}_{T}(V,\sigma)\ \asymp\ \min\bigl\{\rho_{T}(V,\sigma),\ V^{2}H_{T},\ \sigma^{2}n\bigr\}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="Thmproposition1.p1.2" class="ltx_p"&gt;&lt;span id="Thmproposition1.p1.2.1" class="ltx_text ltx_font_italic"&gt;with universal constants.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.p3" class="ltx_para"&gt;
&lt;p id="S3.p3.1" class="ltx_p"&gt;&lt;a href="#S3.SS1" title="3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt; converts the profile into a coded cover of the flow polytope, yielding the upper bounds and the certificates that the estimators of &lt;a href="#S4" title="4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; later consume; &lt;a href="#S3.SS2" title="3.2 The Packing Lower Bound ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.2&lt;/span&gt;&lt;/a&gt; converts the same profile into legal packings and the matching lower bounds; and &lt;a href="#S3.SS3" title="3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt; joins the two at the crossing index, proves both statements above, and derives the benchmark corollaries. The assembly is given here; the proofs of the two halves are in &lt;a href="#S2a" title="S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Sections&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S3a" title="S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;S.3&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S3.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-coded-cover"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.1 &lt;/span&gt;The Coded Cover&lt;/h3&gt;
&lt;div id="S3.SS1.p1" class="ltx_para"&gt;
&lt;p id="S3.SS1.p1.1" class="ltx_p"&gt;Fix an integer $2\leq k\leq n/C_{\star}\text{.}$ The construction runs at the &lt;em id="S3.SS1.p1.1.1" class="ltx_emph ltx_font_italic"&gt;working scale&lt;/em&gt;&lt;/p&gt;
&lt;table id="S3.Ex3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\bar{\alpha}\ :=\ k\,\overline{\delta}_{k}(T),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS1.p1.2" class="ltx_p"&gt;built from the surrogate &lt;a href="#S2.E1" title="In 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;; the centers, and ultimately the estimator, owe their computability to this one choice. Everything rests on a fixed hierarchy of nets. Set $m_{j}:=2^{j}$ for $0\leq j\leq J\text{,}$ where $m_{J}$ is the largest power of two strictly below $k\text{,}$ let $S_{j}$ be the minimum ancestor $\lfloor\bar{\alpha}/m_{j}\rfloor$-net computed by the residual-depth greedy of &lt;a href="#S2.Thmlemma3" title="Lemma 2.3 (Profile toolkit). ‣ 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I3.i3" title="Item 3 ‣ Lemma 2.3 (Profile toolkit). ‣ 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;), and put $R_{j}:=S_{0}\cup\dots\cup S_{j}\text{,}$ so that $R_{0}\subseteq\dots\subseteq R_{J}$ and each $R_{j}$ is an ancestor $(\bar{\alpha}/m_{j})$-net containing the root. The nets depend only on $(T,k)\text{,}$ not on any signal; every counting statement below rests on this. Their sizes are controlled by the profile itself: $N^{\uparrow}_{T}(\lfloor\bar{\alpha}/m_{j}\rfloor)\leq ke^{m_{j}}\text{,}$ as $m_{j}&amp;lt;k$ and a larger count would make the term of &lt;a href="#S1.E4" title="In 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.4&lt;/span&gt;&lt;/a&gt; at that radius exceed $\bar{\alpha}\geq\alpha_{k}(T)\text{;}$ consequently $|R_{j}|\leq 2ke^{m_{j}}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p2" class="ltx_para"&gt;
&lt;p id="S3.SS1.p2.1" class="ltx_p"&gt;For $v\in\mathsf{V}$ let $a_{j}(v)$ be the deepest ancestor of $v$ in $R_{j}\text{,}$ and call the fibers $B_{a,j}:=\{v:a_{j}(v)=a\}\text{,}$ $a\in R_{j}\text{,}$ the level-$j$ &lt;em id="S3.SS1.p2.1.1" class="ltx_emph ltx_font_italic"&gt;cells&lt;/em&gt;. At each level the cells partition $\mathsf{V}\text{;}$ each cell is &lt;em id="S3.SS1.p2.1.2" class="ltx_emph ltx_font_italic"&gt;rooted-connected&lt;/em&gt;, containing with any of its vertices the whole segment from its root $a$ down to that vertex; the cells of level $j+1$ refine those of level $j\text{;}$ and every vertex of a cell is within tree distance $\bar{\alpha}/m_{j}$ of its root. These are elementary consequences of the net property (&lt;a href="#S2a" title="S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p3" class="ltx_para"&gt;
&lt;p id="S3.SS1.p3.1" class="ltx_p"&gt;Define the &lt;em id="S3.SS1.p3.1.1" class="ltx_emph ltx_font_italic"&gt;active support&lt;/em&gt;, the first-appearance weight, and the &lt;em id="S3.SS1.p3.1.2" class="ltx_emph ltx_font_italic"&gt;activation charge&lt;/em&gt;&lt;/p&gt;
&lt;table id="S3.Ex4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$A_{k}:=R_{J},\qquad\omega(v):=\min\{m_{j}:\ v\in R_{j}\},\qquad\widetilde{\omega}(v):=\omega(v)\,\mathbf{1}\{v\notin R_{0}\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS1.p3.2" class="ltx_p"&gt;and, for an integer vector $z$ supported on $A_{k}\text{,}$ the &lt;em id="S3.SS1.p3.2.1" class="ltx_emph ltx_font_italic"&gt;code length&lt;/em&gt;&lt;/p&gt;
&lt;table id="S3.E1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Gamma(z)\ :=\ \sum_{v\in A_{k}}\Bigl(|z_{v}|+\widetilde{\omega}(v)\,\mathbf{1}\{z_{v}\neq 0\}\Bigr):$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(3.1)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS1.p3.3" class="ltx_p"&gt;coefficient mass, plus a charge on each support vertex equal to its dyadic discovery cost, the coarsest level being free. &lt;a href="#S4" title="4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; converts exactly this additive functional into a prior.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p4" class="ltx_para"&gt;
&lt;p id="S3.SS1.p4.1" class="ltx_p"&gt;The next proposition is the key technical result of the upper half. Beyond the covering statement it certifies three additive budgets simultaneously: a fixed root sum, a bounded code length, and a confined flow state. It is through these certificates that the cover later becomes an estimator.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.Thmlemma1" class="ltx_theorem ltx_theorem_prop"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmlemma1.2" class="ltx_text ltx_font_bold"&gt;Proposition 3.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmlemma1.3" class="ltx_text ltx_font_bold"&gt; (Coded cover).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmlemma1.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmlemma1.p1.1" class="ltx_p"&gt;&lt;span id="S3.Thmlemma1.p1.1.1" class="ltx_text ltx_font_italic"&gt;There are universal constants $C_{0},C_{1}$ such that for every finite
rooted tree, every $V&amp;gt;0\text{,}$ and every integer $2\leq k\leq n/C_{\star}$ the
following hold.&lt;/span&gt;&lt;/p&gt;
&lt;ol id="S3.I1" class="ltx_enumerate"&gt;
&lt;li id="S3.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;1.&lt;/span&gt;
&lt;div id="S3.I1.i1.p1" class="ltx_para"&gt;
&lt;p id="S3.I1.i1.p1.1" class="ltx_p"&gt;&lt;span id="S3.I1.i1.p1.1.1" class="ltx_text ltx_font_italic"&gt;For every &lt;/span&gt;$\mu\in\mathcal{F}_{V}(T)$&lt;span id="S3.I1.i1.p1.1.2" class="ltx_text ltx_font_italic"&gt; there is an
integer vector &lt;/span&gt;$z$&lt;span id="S3.I1.i1.p1.1.3" class="ltx_text ltx_font_italic"&gt; supported on &lt;/span&gt;$A_{k}$&lt;span id="S3.I1.i1.p1.1.4" class="ltx_text ltx_font_italic"&gt; whose flow states
&lt;/span&gt;$x_{v}:=\sum_{u\succeq v}z_{u}$&lt;span id="S3.I1.i1.p1.1.5" class="ltx_text ltx_font_italic"&gt; satisfy&lt;/span&gt;&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="S3.EGx1"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S3.Ex5"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S3.Ex6"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{gathered}
\displaystyle\sum_{v}z_{v}=k,\qquad\Gamma(z)\leq 9k,\qquad 0\leq x_{v}\leq 3k\ \text{ for all }v\in\mathsf{V}, \\
\displaystyle\Bigl\|\mu-\frac{V}{k}\sum_{v}z_{v}p_{v}\Bigr\|_{2}^{2}\ \leq\ C_{0}V^{2}\delta_{k}(T).
\end{gathered}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S3.I1.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;2.&lt;/span&gt;
&lt;div id="S3.I1.i2.p1" class="ltx_para"&gt;
&lt;p id="S3.I1.i2.p1.1" class="ltx_p"&gt;&lt;span id="S3.I1.i2.p1.1.1" class="ltx_text ltx_font_italic"&gt;The integer vectors supported on &lt;/span&gt;$A_{k}$&lt;span id="S3.I1.i2.p1.1.2" class="ltx_text ltx_font_italic"&gt; that
satisfy the first three constraints displayed in
&lt;/span&gt;&lt;span id="S3.I1.i2.p1.1.3" class="ltx_text"&gt;(&lt;a href="#S3.I1.i1" title="Item 1 ‣ Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;)&lt;/span&gt;&lt;span id="S3.I1.i2.p1.1.4" class="ltx_text ltx_font_italic"&gt; number at most &lt;/span&gt;$e^{C_{1}k}$&lt;span id="S3.I1.i2.p1.1.5" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p id="S3.Thmlemma1.p1.2" class="ltx_p"&gt;&lt;span id="S3.Thmlemma1.p1.2.1" class="ltx_text ltx_font_italic"&gt;Since $A_{k}$ and $\widetilde{\omega}$ depend only on $(T,k)\text{,}$ the centers
built from these vectors form a class&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{D}_{k}\ :=\ \Bigl\{\tfrac{V}{k}\textstyle\sum_{v}z_{v}p_{v}:\ z\in\mathbb{Z}^{A_{k}},\ \sum_{v}z_{v}=k,\ \Gamma(z)\leq 9k,\ 0\leq x_{v}\leq 3k\ \forall v\Bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.Thmlemma1.p1.3" class="ltx_p"&gt;&lt;span id="S3.Thmlemma1.p1.3.1" class="ltx_text ltx_font_italic"&gt;the &lt;em id="S3.Thmlemma1.p1.3.1.1" class="ltx_emph ltx_font_upright"&gt;coded cover&lt;/em&gt;, which does not depend on the signal and covers
$\mathcal{F}_{V}(T)$ at squared radius $C_{0}V^{2}\delta_{k}(T)\text{;}$ in particular&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.E2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H^{c}_{T}\bigl(C_{0}V^{2}\delta_{k}(T)\bigr)\ \leq\ C_{1}k\qquad\text{for every integer }2\leq k\leq n/C_{\star}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(3.2)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p5" class="ltx_para"&gt;
&lt;p id="S3.SS1.p5.1" class="ltx_p"&gt;Members of $\mathcal{D}_{k}$ may carry negative coefficients $z_{v}\text{,}$ so the cover is external to the body, which is why $H^{c}_{T}$ was taken with free centers; in flow coordinates, every member is nonnegative with root coordinate exactly $V$ and no coordinate above $3V\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p6" class="ltx_para"&gt;
&lt;p id="S3.SS1.p6.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p7" class="ltx_para"&gt;
&lt;p id="S3.SS1.p7.1" class="ltx_p"&gt;By homogeneity take $V=1$ and write $f=\sum_{u}\lambda_{u}p_{u}$ in barycentric form (&lt;a href="#S2.Thmlemma1" title="Lemma 2.1 (Normal forms). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;), with $\lambda(B):=\sum_{u\in B}\lambda_{u}\text{.}$ The construction stops a refinement of the cells at the signal’s own masses, collapses each stopped cell to its root, rounds the resulting skeleton, and samples the light exits; the budgets are then read off and the class is counted. The cell properties above, the collapse and exit estimates, the charge and skeleton accounting, and the counting computation are carried out in &lt;a href="#S2a" title="S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p8" class="ltx_para"&gt;
&lt;p id="S3.SS1.p8.1" class="ltx_p"&gt;&lt;em id="S3.SS1.p8.1.1" class="ltx_emph ltx_font_italic"&gt;Stopped refinement.&lt;/em&gt; Call a level-$j$ cell $B$ &lt;em id="S3.SS1.p8.1.2" class="ltx_emph ltx_font_italic"&gt;heavy&lt;/em&gt; when $\lambda(B)&amp;gt;m_{j}/k$ and &lt;em id="S3.SS1.p8.1.3" class="ltx_emph ltx_font_italic"&gt;light&lt;/em&gt; otherwise. Starting from level $0\text{,}$ stop at every light cell, refine every heavy cell, and stop everything at level $J\text{.}$ The &lt;em id="S3.SS1.p8.1.4" class="ltx_emph ltx_font_italic"&gt;terminal&lt;/em&gt; cells partition $\mathsf{V}\text{;}$ write $\mathcal{L}$ for their collection, and for $L\in\mathcal{L}$ let $a_{L}$ be its root, $m(L)$ its level weight $m_{j}\text{,}$ and $\lambda_{L}:=\lambda(L)\text{.}$ Heaviness is inherited upward through the refinement, so the maximal heavy cells are pairwise disjoint (&lt;a href="#S2a" title="S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2&lt;/span&gt;&lt;/a&gt;) and each has mass exceeding its own $m_{j}/k\text{;}$ since their masses total at most one,&lt;/p&gt;
&lt;table id="S3.E3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{C\ \text{maximal heavy}}m(C)\ &amp;lt;\ k.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(3.3)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS1.p8.2" class="ltx_p"&gt;A heavy terminal cell sits at level $J$ and is maximal, so $m_{J}\geq k/2$ leaves room for at most one.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p9" class="ltx_para"&gt;
&lt;p id="S3.SS1.p9.1" class="ltx_p"&gt;&lt;em id="S3.SS1.p9.1.1" class="ltx_emph ltx_font_italic"&gt;Collapse.&lt;/em&gt; Let $g:=\sum_{L\in\mathcal{L}}\lambda_{L}\,p_{a_{L}}\text{.}$ The error blocks $e_{L}:=\sum_{u\in L}\lambda_{u}(p_{u}-p_{a_{L}})$ are supported in $L\setminus\{a_{L}\}$ by rooted-connectedness and &lt;a href="#S2.Thmlemma2" title="Lemma 2.2 (Isometry and edge supports). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I2.i2" title="Item 2 ‣ Lemma 2.2 (Isometry and edge supports). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;), so they have pairwise disjoint supports; each is controlled by the radius of its cell and, on a light cell, by its mass, and summing the disjoint blocks gives&lt;/p&gt;
&lt;table id="S3.E4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\|f-g\|_{2}^{2}\ \leq\ \frac{3\bar{\alpha}}{k}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(3.4)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS1.p9.2" class="ltx_p"&gt;(&lt;a href="#S2a" title="S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p10" class="ltx_para"&gt;
&lt;p id="S3.SS1.p10.1" class="ltx_p"&gt;&lt;em id="S3.SS1.p10.1.1" class="ltx_emph ltx_font_italic"&gt;Skeleton and exits.&lt;/em&gt; Let $U$ consist of $R_{0}$ together with the roots of all heavy cells. Attach each terminal cell to $U\text{:}$ set $h(L):=a_{L}$ if $L$ is a level-$0$ cell or the heavy terminal cell; otherwise the parent cell of $L$ is heavy, since $L$ was reached by the refinement, and $h(L)$ is its root, so that $h(L)\in U$ and $h(L)\preceq a_{L}\text{.}$ With $q_{L}:=p_{a_{L}}-p_{h(L)}\text{,}$ &lt;a href="#S2.Thmlemma2" title="Lemma 2.2 (Isometry and edge supports). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I2.i1" title="Item 1 ‣ Lemma 2.2 (Isometry and edge supports). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;) and the parent cell’s radius give $\|q_{L}\|_{2}^{2}=d_{T}(h(L),a_{L})\leq 2\bar{\alpha}/m(L)\text{,}$ and&lt;/p&gt;
&lt;table id="S3.Ex8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$g\ =\ g_{0}+\sum_{L}\lambda_{L}\,q_{L},\qquad g_{0}:=\sum_{h\in U}b_{h}\,p_{h},\quad b_{h}:=\sum_{L:\,h(L)=h}\lambda_{L}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS1.p10.2" class="ltx_p"&gt;The nonzero $q_{L}$ are the &lt;em id="S3.SS1.p10.2.1" class="ltx_emph ltx_font_italic"&gt;light exits&lt;/em&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p11" class="ltx_para"&gt;
&lt;p id="S3.SS1.p11.1" class="ltx_p"&gt;&lt;em id="S3.SS1.p11.1.1" class="ltx_emph ltx_font_italic"&gt;Preorder rounding.&lt;/em&gt; The skeleton masses are rounded through one scalar. List $U$ as $h_{1},\dots,h_{s}$ in a fixed depth-first preorder of $T\text{,}$ write $b_{i}:=b_{h_{i}}$ for the masses in this order, set $B_{0}:=0$ and $B_{i}:=\sum_{\ell\leq i}b_{\ell}\text{,}$ and put&lt;/p&gt;
&lt;table id="S3.Ex9" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$Q_{i}\ :=\ \lfloor kB_{i}\rfloor-\lfloor kB_{i-1}\rfloor\ \in\ \mathbb{Z}_{\geq 0},\qquad\text{so that}\qquad\Bigl|\sum_{i\in I}Q_{i}-k\sum_{i\in I}b_{i}\Bigr|\ &amp;lt;\ 1$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS1.p11.2" class="ltx_p"&gt;for every interval $I$ of the list, the left side being a difference of two floor errors. Write $Q$ for the vector with entry $Q_{i}$ at $h_{i}$ and zero elsewhere, a nonnegative integer leak vector of total mass $k$ supported on $U$ (&lt;a href="#S2a" title="S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2&lt;/span&gt;&lt;/a&gt;). The point of the preorder is that every subtree $T_{v}$ is a contiguous block of it, so $U\cap T_{v}$ is an interval of the list; coordinates being subtree sums (&lt;a href="#S2.Thmlemma1" title="Lemma 2.1 (Normal forms). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;), the skeleton and its rounding $\bar{g}_{0}:=\frac{1}{k}\sum_{h\in U}Q_{h}\,p_{h}$ differ by less than $1/k$ at every vertex simultaneously. Both signals vanish outside the minimal rooted subtree spanning $U\text{,}$ which has $O(\bar{\alpha}k)$ edges (a chaining argument over the nets; &lt;a href="#S2a" title="S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2&lt;/span&gt;&lt;/a&gt;), whence&lt;/p&gt;
&lt;table id="S3.E5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\|g_{0}-\bar{g}_{0}\|_{2}^{2}\ \leq\ C\,\frac{\bar{\alpha}}{k}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(3.5)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p12" class="ltx_para"&gt;
&lt;p id="S3.SS1.p12.1" class="ltx_p"&gt;&lt;em id="S3.SS1.p12.1.1" class="ltx_emph ltx_font_italic"&gt;Exit quantization.&lt;/em&gt; A light exit has $\lambda_{L}\leq m(L)/k\text{,}$ so the independent variables $Z_{L}:=\frac{m(L)}{k}\,\xi_{L}$ with $\xi_{L}\sim\mathrm{Bernoulli}(k\lambda_{L}/m(L))$ are well defined and unbiased. Independence makes the cross terms vanish in expectation no matter how the exits overlap, so $\mathbb{E}\|\sum_{L}(Z_{L}-\lambda_{L})q_{L}\|_{2}^{2}=\sum_{L}\operatorname{Var}(Z_{L})\|q_{L}\|_{2}^{2}\leq 2\bar{\alpha}/k\text{.}$ The selection weight $W:=\sum_{L}m(L)\mathbf{1}\{Z_{L}\neq 0\}$ has $\mathbb{E}W\leq k\text{;}$ by Markov’s inequality, some realization satisfies both $W\leq 2k$ and squared exit error at most $8\bar{\alpha}/k$ (&lt;a href="#S2a" title="S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2&lt;/span&gt;&lt;/a&gt;). Fix one and define, with $e_{v}$ the coordinate vector at $v\text{,}$ $z:=Q+\sum_{L:\,Z_{L}\neq 0}m(L)\bigl(e_{a_{L}}-e_{h(L)}\bigr)\text{.}$ Each transfer has coefficient sum zero, so $\sum_{v}z_{v}=k\text{;}$ and $z$ is supported on $A_{k}$ with $\|z\|_{1}\leq 5k\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p13" class="ltx_para"&gt;
&lt;p id="S3.SS1.p13.1" class="ltx_p"&gt;&lt;em id="S3.SS1.p13.1.1" class="ltx_emph ltx_font_italic"&gt;The flow states.&lt;/em&gt; Since $x_{v}=\sum_{u}z_{u}p_{u}(v)\text{,}$ the flow states of $z$ are the coordinates of $\sum_{u}z_{u}p_{u}\text{.}$ The skeleton $Q$ is a nonnegative leak vector of total mass $k\text{,}$ so its states lie in $[0,k]\text{;}$ and each selected transfer contributes $m(L)(p_{a_{L}}-p_{h(L)})=m(L)\mathbf{1}_{(h(L),a_{L}]}\geq 0$ by &lt;a href="#S2.Thmlemma2" title="Lemma 2.2 (Isometry and edge supports). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I2.i2" title="Item 2 ‣ Lemma 2.2 (Isometry and edge supports). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;), a downward transport of mass that never creates a negative state and adds at most $m(L)$ to any state. Hence $0\leq x_{v}\leq k+W\leq 3k$ at every vertex.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p14" class="ltx_para"&gt;
&lt;p id="S3.SS1.p14.1" class="ltx_p"&gt;&lt;em id="S3.SS1.p14.1.1" class="ltx_emph ltx_font_italic"&gt;Code length and error.&lt;/em&gt; The code length collects the activation charges: the selected exit roots contribute at most $W\leq 2k\text{,}$ and the heavy roots at most $2k\text{,}$ because the level weights along a chain of heavy cells total less than twice that of the maximal cell it descends to, which &lt;a href="#S3.E3" title="In 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt; caps; so $\Gamma(z)\leq 9k$ (&lt;a href="#S2a" title="S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2&lt;/span&gt;&lt;/a&gt;). The error separates along the three stages of the construction,&lt;/p&gt;
&lt;table id="S3.Ex10" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$f-\frac{1}{k}\sum_{v}z_{v}p_{v}\ =\ (f-g)+(g_{0}-\bar{g}_{0})+\sum_{L}(\lambda_{L}-Z_{L})q_{L},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS1.p14.2" class="ltx_p"&gt;so &lt;a href="#S3.E4" title="In 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equations&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.4&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S3.E5" title="Equation 3.5 ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.5&lt;/span&gt;&lt;/a&gt; and the fixed realization give $\bigl\|f-\frac{1}{k}\sum_{v}z_{v}p_{v}\bigr\|_{2}^{2}\leq C\bar{\alpha}/k=C\overline{\delta}_{k}(T)\leq 2C\delta_{k}(T)$ by &lt;a href="#S2.Thmlemma3" title="Lemma 2.3 (Profile toolkit). ‣ 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I3.i3" title="Item 3 ‣ Lemma 2.3 (Profile toolkit). ‣ 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;). Restoring the amplitude proves (&lt;a href="#S3.I1.i1" title="Item 1 ‣ Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p15" class="ltx_para"&gt;
&lt;p id="S3.SS1.p15.1" class="ltx_p"&gt;&lt;em id="S3.SS1.p15.1.1" class="ltx_emph ltx_font_italic"&gt;Counting.&lt;/em&gt; A vector obeying the three budgets has support split into a free part inside $R_{0}$ and a charged part of total activation charge at most $9k\text{;}$ the net sizes bound each charge group, so a generating-function estimate controls the number of supports, and on a fixed support, $\|z\|_{1}\leq 9k$ bounds the number of coefficient vectors. Multiplying the counts gives (&lt;a href="#S3.I1.i2" title="Item 2 ‣ Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;) (&lt;a href="#S2a" title="S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2&lt;/span&gt;&lt;/a&gt;). The covering statement and &lt;a href="#S3.E2" title="In Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.2&lt;/span&gt;&lt;/a&gt; follow from (&lt;a href="#S3.I1.i1" title="Item 1 ‣ Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;) and (&lt;a href="#S3.I1.i2" title="Item 2 ‣ Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;).
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p16" class="ltx_para"&gt;
&lt;p id="S3.SS1.p16.1" class="ltx_p"&gt;Two displays close the upper half. The first is generic. For any $t&amp;gt;0\text{,}$ least squares over a covering of the body at squared radius $t$ with $\log$-cardinality $H^{c}_{T}(t)\text{,}$ or the single center itself when one ball suffices, has risk at most $C(t+\sigma^{2}H^{c}_{T}(t))$ uniformly over the body, by the oracle inequality for least squares over a finite set of candidates (&lt;a href="#S3a" title="S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.3&lt;/span&gt;&lt;/a&gt;). We optimize over $t$ and adjoin the constant estimator $Vp_{o}\text{,}$ whose risk is at most $\sup_{\mu}\|\mu-Vp_{o}\|_{2}^{2}\leq V^{2}h_{T}$ by convexity and &lt;a href="#S2.Thmlemma2" title="Lemma 2.2 (Isometry and edge supports). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt;, and the identity estimator $Y\text{,}$ whose risk is $\sigma^{2}n\text{.}$ This gives&lt;/p&gt;
&lt;table id="S3.E6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{*}_{T}(V,\sigma)\ \leq\ C\bigl(\rho_{T}(V,\sigma)\wedge V^{2}H_{T}\wedge\sigma^{2}n\bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(3.6)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS1.p16.2" class="ltx_p"&gt;the upper half of &lt;a href="#Thmproposition1" title="Proposition 1 (Entropy fixed point). ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;. The second display is where the profile enters: evaluating the infimum &lt;a href="#S1.E6" title="In 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.6&lt;/span&gt;&lt;/a&gt; at $t=C_{0}V^{2}\delta_{k}(T)$ and inserting &lt;a href="#S3.E2" title="In Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.2&lt;/span&gt;&lt;/a&gt;,&lt;/p&gt;
&lt;table id="S3.E7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\rho_{T}(V,\sigma)\ \leq\ C\bigl(V^{2}\delta_{k}(T)+\sigma^{2}k\bigr)\qquad\text{for every integer }2\leq k\leq n/C_{\star}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(3.7)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS1.p16.3" class="ltx_p"&gt;&lt;a href="#S3.E6" title="In 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.6&lt;/span&gt;&lt;/a&gt; knows nothing of the profile; &lt;a href="#S3.E7" title="In 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.7&lt;/span&gt;&lt;/a&gt; is what the crossing argument of &lt;a href="#S3.SS3" title="3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt; consumes.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S3.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-packing-lower-bound"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.2 &lt;/span&gt;The Packing Lower Bound&lt;/h3&gt;
&lt;div id="S3.SS2.p1" class="ltx_para"&gt;
&lt;p id="S3.SS2.p1.1" class="ltx_p"&gt;The lower bound must realize the same entropy through hypotheses that live in the polytope, and here the two structural features of the body bind: a hypothesis may only move leak mass that it actually possesses, and root paths through a common vertex share coordinates, so the hypotheses cannot be taken orthogonal on an arbitrary tree. The construction of this subsection allocates disjoint mass budgets exactly, and measures the overlap it cannot remove.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.Thmlemma2" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmlemma2.2" class="ltx_text ltx_font_bold"&gt;Lemma 3.2&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmlemma2.3" class="ltx_text ltx_font_bold"&gt; (Cover to packing).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmlemma2.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmlemma2.p1.1" class="ltx_p"&gt;&lt;span id="S3.Thmlemma2.p1.1.1" class="ltx_text ltx_font_italic"&gt;For every $r&amp;gt;0$ there exist at least $N^{\uparrow}_{T}(r)$ vertices of $T$ whose pairwise tree distances are all at least $r/9\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p2" class="ltx_para"&gt;
&lt;p id="S3.SS2.p2.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof sketch.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p3" class="ltx_para"&gt;
&lt;p id="S3.SS2.p3.1" class="ltx_p"&gt;Under the isometry of &lt;a href="#S2.Thmlemma2" title="Lemma 2.2 (Isometry and edge supports). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I2.i1" title="Item 1 ‣ Lemma 2.2 (Isometry and edge supports). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;), a maximal $(\sqrt{r}/3)$-separated subset of $\{p_{u}:u\in\mathsf{V}\}$ is a packing at pairwise tree distances at least $r/9$ and, by maximality, a cover of the same set at Euclidean radius $\sqrt{r}/3\text{.}$ Each covering ball yields one ancestor: the deepest common ancestor of the vertices it captures lies within tree distance $\tfrac{4}{9}\,r$ of each of them, because every captured vertex below it meets some other captured vertex exactly there. Collecting one ancestor per ball gives an ancestor $r$-net, so the balls, and with them the separated vertices, number at least $N^{\uparrow}_{T}(r)$ (&lt;a href="#S3a" title="S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.3&lt;/span&gt;&lt;/a&gt;).
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p4" class="ltx_para"&gt;
&lt;p id="S3.SS2.p4.1" class="ltx_p"&gt;A product form of Fano’s inequality extracts risk from overlapping hypotheses. The construction in this subsection supplies all three assumptions: blockwise scalability is legality under shrinking toward a reference point, the aspect bound rules out degenerate alphabets, and the Gram row sum is the one quantity through which arbitrary overlap enters.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.Thmlemma3" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmlemma3.2" class="ltx_text ltx_font_bold"&gt;Lemma 3.3&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmlemma3.3" class="ltx_text ltx_font_bold"&gt; (Fano’s inequality for overlapping blocks).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmlemma3.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmlemma3.p1.1" class="ltx_p"&gt;&lt;span id="S3.Thmlemma3.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $K\subseteq\mathbb{R}^{N}$ be convex, let $\mathcal{A}_{1},\dots,\mathcal{A}_{J}$ be finite alphabets with $|\mathcal{A}_{j}|\geq 2\text{,}$ and let&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex11" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mu_{\mathbf{a}}\ =\ \mu_{0}+\sum_{j=1}^{J}g_{j}(a_{j}),\qquad\mathbf{a}\in\textstyle\prod_{j}\mathcal{A}_{j},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.Thmlemma3.p1.2" class="ltx_p"&gt;&lt;span id="S3.Thmlemma3.p1.2.1" class="ltx_text ltx_font_italic"&gt;be a family of points of $K\text{.}$ Write $d_{j}^{2}:=\min_{a\neq b}\|g_{j}(a)-g_{j}(b)\|_{2}^{2}\text{,}$ $D_{j}^{2}:=\max_{a,b}\|g_{j}(a)-g_{j}(b)\|_{2}^{2}\text{,}$ and $h_{j}:=\log|\mathcal{A}_{j}|\text{,}$ and assume, for constants $A\geq 1$ and $\gamma&amp;lt;1\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;ol id="S3.I4" class="ltx_enumerate"&gt;
&lt;li id="S3.I4.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;1.&lt;/span&gt;
&lt;div id="S3.I4.i1.p1" class="ltx_para"&gt;
&lt;p id="S3.I4.i1.p1.1" class="ltx_p"&gt;$\mu_{0}+\sum_{j}\tau_{j}g_{j}(a_{j})\in K$&lt;span id="S3.I4.i1.p1.1.1" class="ltx_text ltx_font_italic"&gt; for every
&lt;/span&gt;$\tau\in[0,1]^{J}$&lt;span id="S3.I4.i1.p1.1.2" class="ltx_text ltx_font_italic"&gt; and every &lt;/span&gt;$\mathbf{a}$&lt;span id="S3.I4.i1.p1.1.3" class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S3.I4.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;2.&lt;/span&gt;
&lt;div id="S3.I4.i2.p1" class="ltx_para"&gt;
&lt;p id="S3.I4.i2.p1.1" class="ltx_p"&gt;$0&amp;lt;D_{j}^{2}\leq A\,d_{j}^{2}$&lt;span id="S3.I4.i2.p1.1.1" class="ltx_text ltx_font_italic"&gt; for every &lt;/span&gt;$j$&lt;span id="S3.I4.i2.p1.1.2" class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S3.I4.i3" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;3.&lt;/span&gt;
&lt;div id="S3.I4.i3.p1" class="ltx_para"&gt;
&lt;p id="S3.I4.i3.p1.1" class="ltx_p"&gt;&lt;span id="S3.I4.i3.p1.1.1" class="ltx_text ltx_font_italic"&gt;every family of nonzero contrasts
&lt;/span&gt;$\Delta_{j}=g_{j}(a_{j})-g_{j}(b_{j})$&lt;span id="S3.I4.i3.p1.1.2" class="ltx_text ltx_font_italic"&gt; satisfies
&lt;/span&gt;$\ \sup_{i}\sum_{j\neq i}\frac{|\langle\Delta_{i},\Delta_{j}\rangle|}{\|\Delta_{i}\|_{2}\,\|\Delta_{j}\|_{2}}\leq\gamma$&lt;span id="S3.I4.i3.p1.1.3" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p id="S3.Thmlemma3.p1.3" class="ltx_p"&gt;&lt;span id="S3.Thmlemma3.p1.3.1" class="ltx_text ltx_font_italic"&gt;Then the minimax risk over $K$ in the model $Y\sim N(\mu,\sigma^{2}I_{N})\text{,}$ $\mu\in K\text{,}$ satisfies&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex12" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{*}(K,\sigma)\ \geq\ c_{A}(1-\gamma)\sum_{j=1}^{J}\min\bigl\{d_{j}^{2},\ \sigma^{2}h_{j}\bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.Thmlemma3.p1.4" class="ltx_p"&gt;&lt;span id="S3.Thmlemma3.p1.4.1" class="ltx_text ltx_font_italic"&gt;where $c_{A}&amp;gt;0$ depends only on $A\text{.}$ The bound holds already for the Bayes risk of an explicit product prior on a blockwise-shrunken subfamily; and if every contrast $g_{j}(a)-g_{j}(b)$ is supported in a common coordinate set $S\text{,}$ it holds for the loss restricted to $S\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p5" class="ltx_para"&gt;
&lt;p id="S3.SS2.p5.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof sketch.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p6" class="ltx_para"&gt;
&lt;p id="S3.SS2.p6.1" class="ltx_p"&gt;For a small universal $\eta\text{,}$ shrink each block into its information budget by $\tau_{j}^{2}:=\min\{1,\,\eta\sigma^{2}h_{j}/D_{j}^{2}\}\text{,}$ legal by (&lt;a href="#S3.I4.i1" title="Item 1 ‣ Lemma 3.3 (Fano’s inequality for overlapping blocks). ‣ 3.2 The Packing Lower Bound ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;), and place the uniform product prior on $\mathbf{a}\text{.}$ The scale-invariant Gram bound (&lt;a href="#S3.I4.i3" title="Item 3 ‣ Lemma 3.3 (Fano’s inequality for overlapping blocks). ‣ 3.2 The Packing Lower Bound ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;) separates any two shrunken members by $(1-\gamma)\sum_{j}\tau_{j}^{2}\|\Delta_{j}\|_{2}^{2}\text{,}$ overlap paid for once through $\gamma\text{.}$ Revealing all other labels reduces block $j$ to a finite Gaussian test of Kullback–Leibler diameter $O(\eta h_{j})\text{,}$ on which Fano’s inequality &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib36" title="" class="ltx_ref"&gt;Tsybakov, 2009&lt;/a&gt;)&lt;/cite&gt;, or a direct binary test, makes every decoder err with probability at least $\tfrac{1}{4}\text{.}$ Decoding to the nearest shrunken member makes an error at block $j$ cost squared loss of order $(1-\gamma)\tau_{j}^{2}d_{j}^{2}\geq(\eta/A)(1-\gamma)\min\{d_{j}^{2},\sigma^{2}h_{j}\}$ by (&lt;a href="#S3.I4.i2" title="Item 2 ‣ Lemma 3.3 (Fano’s inequality for overlapping blocks). ‣ 3.2 The Packing Lower Bound ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;). Taking expectations assembles the bound; the per-block constants, the binary-alphabet test, and the restricted-loss variant are in &lt;a href="#S3a" title="S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.3&lt;/span&gt;&lt;/a&gt;.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p7" class="ltx_para"&gt;
&lt;p id="S3.SS2.p7.1" class="ltx_p"&gt;The next proposition realizes these hypotheses inside the flow polytope.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.Thmlemma4" class="ltx_theorem ltx_theorem_prop"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmlemma4.2" class="ltx_text ltx_font_bold"&gt;Proposition 3.4&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmlemma4.3" class="ltx_text ltx_font_bold"&gt; (Positive packing).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmlemma4.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmlemma4.p1.1" class="ltx_p"&gt;&lt;span id="S3.Thmlemma4.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $U\subseteq\mathsf{V}$ consist of $M\geq 2$ vertices with pairwise tree
distances at least $r&amp;gt;0\text{.}$ Then for every integer $1\leq q\leq M/2\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex13" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{*}_{T}(V,\sigma)\ \geq\ c\,\min\Bigl\{\frac{V^{2}r}{q},\ \sigma^{2}q\log\frac{eM}{q}\Bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p8" class="ltx_para"&gt;
&lt;p id="S3.SS2.p8.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof sketch.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p9" class="ltx_para"&gt;
&lt;p id="S3.SS2.p9.1" class="ltx_p"&gt;The construction distributes the budget exactly and lets &lt;a href="#S3.Thmlemma3" title="Lemma 3.3 (Fano’s inequality for overlapping blocks). ‣ 3.2 The Packing Lower Bound ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt; price the overlap; the proof is completed in &lt;a href="#S3a" title="S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.3&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p10" class="ltx_para"&gt;
&lt;p id="S3.SS2.p10.1" class="ltx_p"&gt;&lt;em id="S3.SS2.p10.1.1" class="ltx_emph ltx_font_italic"&gt;Disjoint budgets.&lt;/em&gt; A bin-packing pass from the leaves of the minimal subtree spanning $U$ upward, sealing a connected component whenever it has collected on the order of $M/q$ marked vertices, extracts from $U$ marked sets $U_{1},\dots,U_{q^{\prime}}$ of sizes $M_{i}\asymp M/q$ lying in connected subtrees $\mathcal{C}_{1},\dots,\mathcal{C}_{q^{\prime}}$ with pairwise disjoint edge sets, where $q^{\prime}\asymp q$ (&lt;a href="#S3a" title="S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.3&lt;/span&gt;&lt;/a&gt;). Give every group the budget $a:=V/q^{\prime}\text{;}$ the budgets sum to $V\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p11" class="ltx_para"&gt;
&lt;p id="S3.SS2.p11.1" class="ltx_p"&gt;&lt;em id="S3.SS2.p11.1.1" class="ltx_emph ltx_font_italic"&gt;A multiscale code in each group.&lt;/em&gt; Fix a group with marked set $U_{i}\text{.}$ Set $r_{\ell}:=16^{\ell}r$ and let $N_{\ell}\subseteq N_{\ell-1}$ be nested maximal $r_{\ell}$-separated subsets of $N_{0}:=U_{i}\text{;}$ assigning each point of $N_{\ell-1}$ to a point of $N_{\ell}$ within distance $r_{\ell}$ organizes $U_{i}$ into a hierarchy with a singleton top. Descend from the top along children of maximal weight, the weight of a node being the number of members of $U_{i}$ at or below it, so that the child counts along the chain multiply to at least $M_{i}\text{.}$ Discarding single-child levels and keeping one residue class $I$ of the rest modulo four produces alphabets $\mathcal{A}_{\ell}\text{,}$ $\ell\in I\text{,}$ the children of the chain node at level $\ell\text{,}$ with $h_{\ell}:=\log|\mathcal{A}_{\ell}|$ and total entropy $H:=\sum_{\ell\in I}h_{\ell}\geq\tfrac{1}{4}\log M_{i}\text{.}$ Two points of $\mathcal{A}_{\ell}$ are $r_{\ell-1}$-separated and within $2r_{\ell}$ of each other, so each block has aspect at most $32$ (&lt;a href="#S2.Thmlemma2" title="Lemma 2.2 (Isometry and edge supports). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I2.i1" title="Item 1 ‣ Lemma 2.2 (Isometry and edge supports). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;)). The per-scale masses $a_{\ell}:=a\sqrt{h_{\ell}/r_{\ell-1}}/S\text{,}$ with normalizer $S:=\sum_{\ell^{\prime}\in I}\sqrt{h_{\ell^{\prime}}/r_{\ell^{\prime}-1}}\text{,}$ spend $\sum_{\ell\in I}a_{\ell}=a$ exactly, and Cauchy–Schwarz against the geometric radii gives&lt;/p&gt;
&lt;table id="S3.Ex14" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{\ell\in I}\min\{a_{\ell}^{2}r_{\ell-1},\,\sigma^{2}h_{\ell}\}\ \geq\ c\min\{a^{2}r,\,\sigma^{2}\log M_{i}\}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS2.p11.2" class="ltx_p"&gt;(&lt;a href="#S3a" title="S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.3&lt;/span&gt;&lt;/a&gt;).
Fix a reference letter $u^{0}_{\ell}\in\mathcal{A}_{\ell}$ at each retained scale; the group’s hypotheses are $\mu_{\mathbf{u}}=\mu_{0}+\sum_{\ell\in I}g_{\ell}(u_{\ell})$ with $\mu_{0}:=\sum_{\ell\in I}a_{\ell}\,p_{u^{0}_{\ell}}$ and $g_{\ell}(u):=a_{\ell}(p_{u}-p_{u^{0}_{\ell}})\text{,}$ so that $\mu_{\mathbf{u}}=\sum_{\ell\in I}a_{\ell}p_{u_{\ell}}$ places mass $a_{\ell}$ at the letter chosen from $\mathcal{A}_{\ell}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p12" class="ltx_para"&gt;
&lt;p id="S3.SS2.p12.1" class="ltx_p"&gt;&lt;em id="S3.SS2.p12.1.1" class="ltx_emph ltx_font_italic"&gt;Overlap.&lt;/em&gt; A level-$\ell$ contrast has entries bounded by $a_{\ell}$ and support of size at most $32\,r_{\ell-1}$ (&lt;a href="#S2.Thmlemma2" title="Lemma 2.2 (Isometry and edge supports). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I2.i2" title="Item 2 ‣ Lemma 2.2 (Isometry and edge supports). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;)), so its normalized inner product with a level-$\ell^{\prime}$ contrast, $\ell&amp;lt;\ell^{\prime}$ in $I\text{,}$ is at most $32\cdot 4^{-(\ell^{\prime}-\ell)}\text{;}$ retained levels differ by at least four, so every normalized Gram row sums to at most $\gamma=64/255&amp;lt;\tfrac{1}{2}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p13" class="ltx_para"&gt;
&lt;p id="S3.SS2.p13.1" class="ltx_p"&gt;&lt;em id="S3.SS2.p13.1.1" class="ltx_emph ltx_font_italic"&gt;Assembly.&lt;/em&gt; Each blockwise contraction $\mu_{0}+\sum_{\ell}\tau_{\ell}g_{\ell}(u_{\ell})$ replaces $p_{u^{0}_{\ell}}$ by a convex combination of $p_{u^{0}_{\ell}}$ and $p_{u_{\ell}}\text{,}$ so it remains a nonnegative leak combination of total mass $a\text{;}$ &lt;a href="#S3.Thmlemma3" title="Lemma 3.3 (Fano’s inequality for overlapping blocks). ‣ 3.2 The Packing Lower Bound ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt; therefore applies with $A=32$ and $\gamma=64/255$ and bounds the group’s Bayes risk from below by $c\min\{a^{2}r,\sigma^{2}\log M_{i}\}$ in the group’s own coordinates. Sums of one member per group are legal points of $\mathcal{F}_{V}(T)$ (&lt;a href="#S2.Thmlemma1" title="Lemma 2.1 (Normal forms). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;), and the groups’ contrasts occupy the pairwise disjoint edge supports of the $\mathcal{C}_{i}$ (&lt;a href="#S2.Thmlemma2" title="Lemma 2.2 (Isometry and edge supports). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I2.i2" title="Item 2 ‣ Lemma 2.2 (Isometry and edge supports). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;)), so the joint Bayes risk dominates the sum of the isolated group bounds (&lt;a href="#S3a" title="S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.3&lt;/span&gt;&lt;/a&gt;). With $q^{\prime}\asymp q$ and $M_{i}\asymp M/q\text{,}$ the group bounds sum to $R^{*}_{T}(V,\sigma)\geq c\,q\min\{V^{2}r/q^{2},\,\sigma^{2}\log(eM/q)\}\text{,}$ which is the claim.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p14" class="ltx_para"&gt;
&lt;p id="S3.SS2.p14.1" class="ltx_p"&gt;The lower half of the crossing now follows by matching the free parameter $q$ to the profile.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.Thmlemma5" class="ltx_theorem ltx_theorem_prop"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmlemma5.2" class="ltx_text ltx_font_bold"&gt;Proposition 3.5&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmlemma5.3" class="ltx_text ltx_font_bold"&gt; (Profile to risk).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmlemma5.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmlemma5.p1.1" class="ltx_p"&gt;&lt;span id="S3.Thmlemma5.p1.1.1" class="ltx_text ltx_font_italic"&gt;There is a universal constant $c_{0}&amp;gt;0$ such that for every finite
rooted tree, every integer $k\geq 1\text{,}$ and all $V,\sigma&amp;gt;0\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex15" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$V^{2}\delta_{k}(T)\ \geq\ A_{0}\sigma^{2}k\qquad\Longrightarrow\qquad R^{*}_{T}(V,\sigma)\ \geq\ c_{0}\,\sigma^{2}k.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p15" class="ltx_para"&gt;
&lt;p id="S3.SS2.p15.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p16" class="ltx_para"&gt;
&lt;p id="S3.SS2.p16.1" class="ltx_p"&gt;The supremum in &lt;a href="#S1.E4" title="In 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.4&lt;/span&gt;&lt;/a&gt; need not be attained, so choose $r&amp;gt;0$ whose term is at least half the supremum:&lt;/p&gt;
&lt;table id="S3.Ex16" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$V^{2}r\,\min\Bigl\{1,\ \tfrac{1}{k}\Bigl[\log\tfrac{N^{\uparrow}_{T}(r)}{k}\Bigr]_{+}\Bigr\}\ \geq\ \tfrac{1}{2}\,V^{2}\delta_{k}(T)\ \geq\ \tfrac{A_{0}}{2}\,\sigma^{2}k\ &amp;gt;\ 0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS2.p16.2" class="ltx_p"&gt;Positivity forces $N^{\uparrow}_{T}(r)&amp;gt;k\text{.}$ &lt;a href="#S3.Thmlemma2" title="Lemma 3.2 (Cover to packing). ‣ 3.2 The Packing Lower Bound ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.2&lt;/span&gt;&lt;/a&gt; supplies $M\geq N^{\uparrow}_{T}(r)&amp;gt;k$ vertices with pairwise tree distances at least $r^{\prime}:=r/9\text{,}$ and the displayed inequality survives with $(r^{\prime},M)$ in place of $(r,N^{\uparrow}_{T}(r))$ at the cost of a factor $18\text{,}$ absorbed into $A_{0}\text{.}$ It remains to choose $q$ in &lt;a href="#S3.Thmlemma4" title="Proposition 3.4 (Positive packing). ‣ 3.2 The Packing Lower Bound ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.4&lt;/span&gt;&lt;/a&gt;: the mass branch $V^{2}r^{\prime}/q$ shrinks and the entropy branch $\sigma^{2}q\log(eM/q)$ grows as $q$ increases, and at $q\asymp\max\bigl\{1,\ k/(1+\log(M/k))\bigr\}$ both sit above $\sigma^{2}k$ times a universal constant. This scalar matching, including the boundary cases, is proved in &lt;a href="#S3a" title="S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.3&lt;/span&gt;&lt;/a&gt;.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S3.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-crossing-and-the-benchmarks"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.3 &lt;/span&gt;The Crossing and the Benchmarks&lt;/h3&gt;
&lt;div id="S3.SS3.p1" class="ltx_para"&gt;
&lt;p id="S3.SS3.p1.1" class="ltx_p"&gt;The two halves now meet. Throughout, $K:=\lfloor n/C_{\star}\rfloor\text{,}$ so that $k_{0}\leq K+1$ by &lt;a href="#S1.E5" title="In 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.5&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p2" class="ltx_para"&gt;
&lt;p id="S3.SS3.p2.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof of &lt;a class="ltx_ref" href="#Thmtheorem1"&gt;Theorem 1&lt;/a&gt; and &lt;a class="ltx_ref" href="#Thmproposition1"&gt;Proposition 1&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p3" class="ltx_para"&gt;
&lt;p id="S3.SS3.p3.1" class="ltx_p"&gt;The upper half of &lt;a href="#Thmproposition1" title="Proposition 1 (Entropy fixed point). ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; is &lt;a href="#S3.E6" title="In 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.6&lt;/span&gt;&lt;/a&gt;; it remains to prove&lt;/p&gt;
&lt;table id="S3.Ex17" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\text{(I)}\quad R^{*}_{T}\ \geq\ c\,\bigl(\rho_{T}\wedge V^{2}H_{T}\wedge\sigma^{2}n\bigr),\qquad\qquad\text{(II)}\quad R^{*}_{T}\ \asymp\ \min\bigl\{V^{2}H_{T},\ \sigma^{2}k_{0}\bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS3.p3.2" class="ltx_p"&gt;For $n=1$ the body is the single point $Vp_{o}$ and $H_{T}=0\text{,}$ so $R^{*}_{T}=0$ and both sides of (I) and (II) vanish; assume $n\geq 2\text{.}$ Testing two points at distance $\min\{V\sqrt{H_{T}},\sigma\}$ along the diameter segment of the body, which lies in $\mathcal{F}_{V}(T)$ by &lt;a href="#S2.Thmlemma2" title="Lemma 2.2 (Isometry and edge supports). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I2.i1" title="Item 1 ‣ Lemma 2.2 (Isometry and edge supports). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;), records a two-point bound&lt;/p&gt;
&lt;table id="S3.E8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{*}_{T}(V,\sigma)\ \geq\ c\,\min\bigl\{V^{2}H_{T},\ \sigma^{2}\bigr\}\qquad(n\geq 2)$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(3.8)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS3.p3.3" class="ltx_p"&gt;(&lt;a href="#S3a" title="S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.3&lt;/span&gt;&lt;/a&gt;). The proof of (I) and (II) now splits into four exhaustive cases, according to how the crossing index fires.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p4" class="ltx_para"&gt;
&lt;p id="S3.SS3.p4.1" class="ltx_p"&gt;&lt;em id="S3.SS3.p4.1.1" class="ltx_emph ltx_font_italic"&gt;Case $n&amp;lt;C_{\star}\text{.}$&lt;/em&gt; Here $k_{0}=1$ through the dimension clause, and $\sigma^{2}\geq\sigma^{2}n/C_{\star}\text{,}$ so &lt;a href="#S3.E8" title="In 3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.8&lt;/span&gt;&lt;/a&gt; gives (I) and the lower half of (II), while &lt;a href="#S3.E6" title="In 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.6&lt;/span&gt;&lt;/a&gt; gives the upper half (&lt;a href="#S3a" title="S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.3&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p5" class="ltx_para"&gt;
&lt;p id="S3.SS3.p5.1" class="ltx_p"&gt;&lt;em id="S3.SS3.p5.1.1" class="ltx_emph ltx_font_italic"&gt;Case $n\geq C_{\star}$ and $V^{2}\delta_{1}\leq A_{0}\sigma^{2}\text{.}$&lt;/em&gt; Here $k_{0}=1$ through the crossing clause. &lt;a href="#S3.Thmlemma1" title="Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt; starts at $k=2\text{,}$ so we supply the missing entropy bound at $k=1\text{.}$ Every ancestor $r$-net with $r&amp;lt;h_{T}$ has at least two elements: the root lies in every net, being its own only ancestor, and it covers no deepest vertex. Hence $N^{\uparrow}_{T}(r)\geq 2$ for all $r&amp;lt;h_{T}\text{,}$ and letting $r\uparrow h_{T}$ in &lt;a href="#S1.E4" title="In 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.4&lt;/span&gt;&lt;/a&gt; gives $\alpha_{1}\geq h_{T}\log 2\text{.}$ On the other hand the single center $Vp_{o}$ covers the body at squared radius $V^{2}h_{T}\text{,}$ since $\|\mu-Vp_{o}\|_{2}\leq\max_{u}\|Vp_{u}-Vp_{o}\|_{2}=V\sqrt{h_{T}}$ by convexity, so $H^{c}_{T}(V^{2}h_{T})=0$ and&lt;/p&gt;
&lt;table id="S3.Ex18" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\rho_{T}\ \leq\ V^{2}h_{T}\ \leq\ \frac{V^{2}\delta_{1}}{\log 2}\ \leq\ \frac{A_{0}}{\log 2}\,\sigma^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS3.p5.2" class="ltx_p"&gt;Both (I) and (II) follow, with &lt;a href="#S3.E8" title="In 3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.8&lt;/span&gt;&lt;/a&gt; for the lower bounds and &lt;a href="#S3.E6" title="In 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.6&lt;/span&gt;&lt;/a&gt; for the upper ones (&lt;a href="#S3a" title="S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.3&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p6" class="ltx_para"&gt;
&lt;p id="S3.SS3.p6.1" class="ltx_p"&gt;&lt;em id="S3.SS3.p6.1.1" class="ltx_emph ltx_font_italic"&gt;Case $2\leq k_{0}\leq K\text{.}$&lt;/em&gt; The crossing clause fired at $k_{0}\text{:}$ $V^{2}\delta_{k_{0}}\leq A_{0}\sigma^{2}k_{0}\text{,}$ and $k_{0}\leq n/C_{\star}\text{,}$ so &lt;a href="#S3.E7" title="In 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.7&lt;/span&gt;&lt;/a&gt; at $k_{0}$ gives&lt;/p&gt;
&lt;table id="S3.E9" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\rho_{T}\ \leq\ C\bigl(V^{2}\delta_{k_{0}}+\sigma^{2}k_{0}\bigr)\ \leq\ C(A_{0}+1)\,\sigma^{2}k_{0}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(3.9)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS3.p6.2" class="ltx_p"&gt;By minimality neither clause holds at $k_{0}-1\text{;}$ in particular $V^{2}\delta_{k_{0}-1}&amp;gt;A_{0}\sigma^{2}(k_{0}-1)\text{,}$ so &lt;a href="#S3.Thmlemma5" title="Proposition 3.5 (Profile to risk). ‣ 3.2 The Packing Lower Bound ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.5&lt;/span&gt;&lt;/a&gt; at $k_{0}-1$ gives&lt;/p&gt;
&lt;table id="S3.E10" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{*}_{T}\ \geq\ c_{0}\,\sigma^{2}(k_{0}-1)\ \geq\ \frac{c_{0}}{2}\,\sigma^{2}k_{0}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(3.10)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.SS3.p6.3" class="ltx_p"&gt;Combining &lt;a href="#S3.E9" title="In 3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equations&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.9&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S3.E10" title="Equation 3.10 ‣ 3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.10&lt;/span&gt;&lt;/a&gt; proves (I). For (II) the same two inequalities identify the information branch: $V^{2}H_{T}\geq V^{2}h_{T}\geq V^{2}\delta_{k_{0}-1}&amp;gt;A_{0}\sigma^{2}(k_{0}-1)\geq\sigma^{2}k_{0}$ by &lt;a href="#S2.Thmlemma3" title="Lemma 2.3 (Profile toolkit). ‣ 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I3.i1" title="Item 1 ‣ Lemma 2.3 (Profile toolkit). ‣ 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;), so $\min\{V^{2}H_{T},\sigma^{2}k_{0}\}=\sigma^{2}k_{0}\text{,}$ which &lt;a href="#S3.E10" title="In 3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.10&lt;/span&gt;&lt;/a&gt; bounds below and &lt;a href="#S3.E6" title="In 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equations&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.6&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S3.E9" title="Equation 3.9 ‣ 3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.9&lt;/span&gt;&lt;/a&gt; bound above.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p7" class="ltx_para"&gt;
&lt;p id="S3.SS3.p7.1" class="ltx_p"&gt;&lt;em id="S3.SS3.p7.1.1" class="ltx_emph ltx_font_italic"&gt;Case $k_{0}=K+1$ with $n\geq C_{\star}\text{.}$&lt;/em&gt; No clause fired on $[1,K]\text{;}$ in particular $V^{2}\delta_{K}&amp;gt;A_{0}\sigma^{2}K\text{,}$ so &lt;a href="#S3.Thmlemma5" title="Proposition 3.5 (Profile to risk). ‣ 3.2 The Packing Lower Bound ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.5&lt;/span&gt;&lt;/a&gt; at $K$ gives $R^{*}_{T}\geq c_{0}\sigma^{2}K\geq c\,\sigma^{2}n\text{,}$ using $K=\lfloor n/C_{\star}\rfloor\geq n/(2C_{\star})\text{.}$ This is (I), the three-term minimum being at most $\sigma^{2}n\text{;}$ and (II) follows because $\sigma^{2}k_{0}\asymp\sigma^{2}n$ while $V^{2}H_{T}\geq V^{2}\delta_{K}&amp;gt;A_{0}\sigma^{2}K$ (&lt;a href="#S3a" title="S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.3&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p8" class="ltx_para"&gt;
&lt;p id="S3.SS3.p8.1" class="ltx_p"&gt;The four cases are exhaustive: for $n\geq C_{\star}\text{,}$ either the crossing clause fires at $k=1\text{,}$ or it first fires at some $2\leq k_{0}\leq K\text{,}$ or it never fires on $[1,K]$ and the dimension clause fires at $K+1\text{.}$ This proves (I) and (II). In the interior case the computation also pins the fixed point itself, $\rho_{T}\asymp\sigma^{2}k_{0}$ (&lt;a href="#S3a" title="S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.3&lt;/span&gt;&lt;/a&gt;).
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p9" class="ltx_para"&gt;
&lt;p id="S3.SS3.p9.1" class="ltx_p"&gt;The rate formula specializes in closed form on the three families of &lt;a href="#S1.T1" title="In 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Table&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;; in each corollary the equivalence holds for all $V,\sigma&amp;gt;0$ with universal constants.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmcorollary1" class="ltx_theorem ltx_theorem_corollary"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="Thmcorollary1.2" class="ltx_text ltx_font_bold"&gt;Corollary 1&lt;/span&gt;&lt;/span&gt;&lt;span id="Thmcorollary1.3" class="ltx_text ltx_font_bold"&gt; (Path).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="Thmcorollary1.p1" class="ltx_para"&gt;
&lt;p id="Thmcorollary1.p1.1" class="ltx_p"&gt;&lt;span id="Thmcorollary1.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $P_{L}$ be the path with $L\geq 1$ edges, rooted at one endpoint, so that $\mathcal{F}_{V}(P_{L})=\{\mu:V=\mu_{0}\geq\mu_{1}\geq\cdots\geq\mu_{L}\geq 0\}\text{.}$ Then&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex19" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{*}_{P_{L}}(V,\sigma)\ \asymp\ \min\bigl\{V^{2}L,\ \ V^{2/3}\sigma^{4/3}L^{1/3},\ \ \sigma^{2}(L+1)\bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="Thmcorollary2" class="ltx_theorem ltx_theorem_corollary"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="Thmcorollary2.2" class="ltx_text ltx_font_bold"&gt;Corollary 2&lt;/span&gt;&lt;/span&gt;&lt;span id="Thmcorollary2.3" class="ltx_text ltx_font_bold"&gt; (Star).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="Thmcorollary2.p1" class="ltx_para"&gt;
&lt;p id="Thmcorollary2.p1.1" class="ltx_p"&gt;&lt;span id="Thmcorollary2.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $S_{m}$ be the star with $m\geq 2$ leaves rooted at the hub; the hub coordinate is pinned at $V\text{,}$ and in leaf coordinates $\mathcal{F}_{V}(S_{m})=\{\mu\in\mathbb{R}_{\geq 0}^{m}:\sum_{i\leq m}\mu_{i}\leq V\}\text{.}$ Then&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex20" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{*}_{S_{m}}(V,\sigma)\ \asymp\ \min\Bigl\{V^{2},\ \ \sigma V\sqrt{1+\bigl[\log(m\sigma/V)\bigr]_{+}},\ \ \sigma^{2}m\Bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="Thmcorollary3" class="ltx_theorem ltx_theorem_corollary"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="Thmcorollary3.2" class="ltx_text ltx_font_bold"&gt;Corollary 3&lt;/span&gt;&lt;/span&gt;&lt;span id="Thmcorollary3.3" class="ltx_text ltx_font_bold"&gt; (Complete binary tree).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="Thmcorollary3.p1" class="ltx_para"&gt;
&lt;p id="Thmcorollary3.p1.1" class="ltx_p"&gt;&lt;span id="Thmcorollary3.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $B_{h}$ be the complete binary tree of height $h\geq 1\text{:}$ every internal vertex has two children and all $2^{h}$ leaves lie at depth $h\text{,}$ so that $n=2^{h+1}-1\text{.}$ Then&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex21" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{*}_{B_{h}}(V,\sigma)\ \asymp\ \min\bigl\{V^{2}h,\ \ \sigma V\bigl(1+[\log(n\sigma/V)]_{+}\bigr),\ \ \sigma^{2}n\bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p10" class="ltx_para"&gt;
&lt;p id="S3.SS3.p10.1" class="ltx_p"&gt;The three corollaries follow one recipe: the ancestor-covering counts determine the profile through &lt;a href="#S2.E3" title="In Item 2 ‣ Lemma 2.3 (Profile toolkit). ‣ 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt;, and the crossing selects the active branch. Interval covering gives the path counts $\lceil(L+1)/(q+1)\rceil\text{;}$ on the star only the radius $q=0$ contributes, and the profile is the exact expression of &lt;a href="#S2.Thmremark1" title="Remark 2.1 (Why the profile is truncated). ‣ 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Remark&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;; on the binary tree the counts decay geometrically in the radius, and, for $k\leq n/C_{\star}\text{,}$ the profile $\alpha_{k}$ is quadratic in $\log(n/k)$ wherever $k$ exceeds that logarithm. The counts, the profiles, and the scalar optimizations that locate $k_{0}$ and match the branches in every parameter regime are carried out in &lt;a href="#S4a" title="S.4 Benchmark and Broom Profiles ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.4&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p11" class="ltx_para"&gt;
&lt;p id="S3.SS3.p11.1" class="ltx_p"&gt;The crossing consumed &lt;a href="#S3.Thmlemma1" title="Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt; only through &lt;a href="#S3.E2" title="In Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.2&lt;/span&gt;&lt;/a&gt;; the further certificates are spent in &lt;a href="#S4" title="4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;, the code length becoming a prior, the root sum an exact constraint, and the confined states a one-dimensional computation.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S4" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="efficient-and-adaptive-estimation"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;4 &lt;/span&gt;Efficient and Adaptive Estimation&lt;/h2&gt;
&lt;div id="S4.p1" class="ltx_para"&gt;
&lt;p id="S4.p1.1" class="ltx_p"&gt;This section proves the three estimation theorems; the first is stated here, the adaptation pair in &lt;a href="#S4.SS3" title="4.3 Adaptation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.3&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem2" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="Thmtheorem2.2" class="ltx_text ltx_font_bold"&gt;Theorem 2&lt;/span&gt;&lt;/span&gt;&lt;span id="Thmtheorem2.3" class="ltx_text ltx_font_bold"&gt; (Efficient estimation).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="Thmtheorem2.p1" class="ltx_para"&gt;
&lt;p id="Thmtheorem2.p1.1" class="ltx_p"&gt;&lt;span id="Thmtheorem2.p1.1.1" class="ltx_text ltx_font_italic"&gt;There is a deterministic estimator $\widehat{\mu}=\widehat{\mu}(T,V,\sigma,Y)\text{,}$ computed exactly in $O(n^{2}\log(n+1))$ arithmetic operations of the real-RAM model fixed in &lt;a href="#S2.SS1" title="2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;, such that for every finite rooted tree $T$ and all $V,\sigma&amp;gt;0\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sup_{\mu\in\mathcal{F}_{V}(T)}\mathbb{E}_{\mu}\bigl\|\widehat{\mu}-\mu\bigr\|_{2}^{2}\ \leq\ C\,R^{*}_{T}(V,\sigma)$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="Thmtheorem2.p1.2" class="ltx_p"&gt;&lt;span id="Thmtheorem2.p1.2.1" class="ltx_text ltx_font_italic"&gt;with a universal constant $C\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.p2" class="ltx_para"&gt;
&lt;p id="S4.p2.1" class="ltx_p"&gt;The estimator is an exponentially weighted aggregate over a class of integer states, evaluated exactly in the sense fixed by &lt;a href="#S4.Thmremark1" title="Remark 4.1 (Computational model). ‣ 4.2 Exact Evaluation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Remark&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.1&lt;/span&gt;&lt;/a&gt;. &lt;a href="#S4.SS1" title="4.1 Aggregation over Integer States ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.1&lt;/span&gt;&lt;/a&gt; constructs it and proves the risk bound, &lt;a href="#S4.SS2" title="4.2 Exact Evaluation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt; gives the algorithm, and &lt;a href="#S4.SS3" title="4.3 Adaptation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.3&lt;/span&gt;&lt;/a&gt; removes first the budget and then the noise level.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S4.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="aggregation-over-integer-states"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;4.1 &lt;/span&gt;Aggregation over Integer States&lt;/h3&gt;
&lt;div id="S4.SS1.p1" class="ltx_para"&gt;
&lt;p id="S4.SS1.p1.1" class="ltx_p"&gt;Least squares over the coded cover converts &lt;a href="#S3.E2" title="In Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.2&lt;/span&gt;&lt;/a&gt; into the rate, but it is a search through as many as $e^{C_{1}k}$ centers (&lt;a href="#S3.Thmlemma1" title="Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt;). The estimator of &lt;a href="#Thmtheorem2" title="Theorem 2 (Efficient estimation). ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; replaces the search by an average under a prior built from the code length.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS1.p2" class="ltx_para"&gt;
&lt;p id="S4.SS1.p2.1" class="ltx_p"&gt;Fix an integer $2\leq k\leq n/C_{\star}$ and recall the active support $A_{k}\text{,}$ the charges $\widetilde{\omega}\text{,}$ and the code length &lt;a href="#S3.E1" title="In 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt;. The &lt;em id="S4.SS1.p2.1.1" class="ltx_emph ltx_font_italic"&gt;integer states&lt;/em&gt; at budget $k$ are the vectors&lt;/p&gt;
&lt;table id="S4.E1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{X}_{k}\ :=\ \Bigl\{x\in\{0,1,\dots,3k\}^{\mathsf{V}}:\ x_{o}=k\ \text{ and }\ z_{v}:=x_{v}-\textstyle\sum_{c\in\operatorname{ch}(v)}x_{c}=0\ \text{ for all }v\notin A_{k}\Bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(4.1)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.SS1.p2.2" class="ltx_p"&gt;each with its leak vector $z\text{,}$ its code length $\Gamma(x):=\Gamma(z)\text{,}$ and its center $\nu_{x}:=\frac{V}{k}\,x\text{;}$ the leaks telescope to the root state, $\sum_{v}z_{v}=x_{o}=k\text{.}$ The approximant of &lt;a href="#S3.Thmlemma1" title="Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt; is an integer state: its coordinates lie in $[0,3k]\text{,}$ its root coordinate is $k\text{,}$ and its leaks are supported on $A_{k}\text{.}$ The class relaxes the coded cover in exactly one respect: the budget $\Gamma\leq 9k$ is dropped from the constraints, so that $\mathcal{D}_{k}=\{\nu_{x}:\ x\in\mathcal{X}_{k},\ \Gamma(x)\leq 9k\}\text{.}$ The dropped budget resurfaces as the prior: as a constraint it would add a second dimension to the recursions of &lt;a href="#S4.SS2" title="4.2 Exact Evaluation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt;; as a soft penalty it costs only a normalizing sum. Their leaks may be negative, as for the coded cover.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS1.p3" class="ltx_para"&gt;
&lt;p id="S4.SS1.p3.1" class="ltx_p"&gt;The estimator at budget $k$ is the exponentially weighted aggregate&lt;/p&gt;
&lt;table id="S4.E2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widehat{\mu}_{k}\ :=\ \frac{\sum_{x\in\mathcal{X}_{k}}\nu_{x}\,e^{-2\Gamma(x)}\,e^{-\|Y-\nu_{x}\|_{2}^{2}/(4\sigma^{2})}}{\sum_{x\in\mathcal{X}_{k}}e^{-2\Gamma(x)}\,e^{-\|Y-\nu_{x}\|_{2}^{2}/(4\sigma^{2})}}\ ,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(4.2)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.SS1.p3.2" class="ltx_p"&gt;the posterior mean at temperature $4\sigma^{2}$ under the Kraft-type prior $\pi_{k}(x)\propto e^{-2\Gamma(x)}\text{.}$ The normalizing sum $\sum_{x\in\mathcal{X}_{k}}e^{-2\Gamma(x)}\text{,}$ which cancels from &lt;a href="#S4.E2" title="In 4.1 Aggregation over Integer States ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt; and is never computed, is at most $e^{k}\text{,}$ by a generating-function estimate from the net sizes of &lt;a href="#S3.SS1" title="3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt; (&lt;a href="#S5a" title="S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5&lt;/span&gt;&lt;/a&gt;). Every integer state has root coordinate $k$ and coordinates at most $3k\text{,}$ so $\widehat{\mu}_{k}(o)=V$ identically and every coordinate of $\widehat{\mu}_{k}$ lies in $[0,3V]\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS1.p4" class="ltx_para"&gt;
&lt;p id="S4.SS1.p4.1" class="ltx_p"&gt;The risk of an exponentially weighted aggregate is controlled through the prior mass at a single candidate; no cardinality of the class enters &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib25" title="" class="ltx_ref"&gt;Leung and Barron, 2006&lt;/a&gt;, cf.)&lt;/cite&gt;. In the next lemma the true mean is arbitrary.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmlemma1" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmlemma1.2" class="ltx_text ltx_font_bold"&gt;Lemma 4.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmlemma1.3" class="ltx_text ltx_font_bold"&gt; (Aggregation oracle).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmlemma1.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmlemma1.p1.1" class="ltx_p"&gt;&lt;span id="S4.Thmlemma1.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $F\subseteq\mathbb{R}^{N}$ be finite and nonempty, let $\pi$ be a probability vector on $F$ with $\pi_{f}&amp;gt;0$ for all $f\text{,}$ and let $Y=\mu+\sigma Z$ with $Z\sim N(0,I_{N})$ and $\mu\in\mathbb{R}^{N}\text{.}$ Define&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widehat{f}_{\pi}(Y)\ :=\ \sum_{f\in F}\widehat{\pi}_{f}(Y)\,f,\qquad\widehat{\pi}_{f}(Y)\ :=\ \frac{\pi_{f}\,e^{-\|Y-f\|_{2}^{2}/(4\sigma^{2})}}{\sum_{g\in F}\pi_{g}\,e^{-\|Y-g\|_{2}^{2}/(4\sigma^{2})}}\ .$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.Thmlemma1.p1.2" class="ltx_p"&gt;&lt;span id="S4.Thmlemma1.p1.2.1" class="ltx_text ltx_font_italic"&gt;Then&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}_{\mu}\bigl\|\widehat{f}_{\pi}-\mu\bigr\|_{2}^{2}\ \leq\ \min_{f\in F}\Bigl\{\|f-\mu\|_{2}^{2}+4\sigma^{2}\log\frac{1}{\pi_{f}}\Bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS1.p5" class="ltx_para"&gt;
&lt;p id="S4.SS1.p5.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof sketch.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS1.p6" class="ltx_para"&gt;
&lt;p id="S4.SS1.p6.1" class="ltx_p"&gt;Two exact identities. Differentiating the weights shows that the aggregate is smooth and bounded and identifies its Jacobian as $\frac{1}{2\sigma^{2}}$ times the posterior covariance of $f\text{,}$ so Stein’s identity &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib35" title="" class="ltx_ref"&gt;Stein, 1981&lt;/a&gt;)&lt;/cite&gt; writes the risk through the divergence, a covariance trace; the bias–variance split of the posterior loss $\sum_{f}\widehat{\pi}_{f}(y)\,\|y-f\|_{2}^{2}$ produces the same trace with the opposite sign, and at this temperature the two cancel exactly, leaving $\mathbb{E}_{\mu}\|\widehat{f}_{\pi}-\mu\|_{2}^{2}=\mathbb{E}\sum_{f}\widehat{\pi}_{f}(Y)\,\|Y-f\|_{2}^{2}-N\sigma^{2}\text{.}$ The weights are the Gibbs minimizer of the posterior loss penalized by $4\sigma^{2}$ times the relative entropy to $\pi$ &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(see, e.g., &lt;a href="#bib.bib37" title="" class="ltx_ref"&gt;Boucheron et al., 2013&lt;/a&gt;, Section 4.9)&lt;/cite&gt;, so the value of the penalized objective at the point mass on any $f_{0}\in F$ bounds the posterior loss pathwise by $\|Y-f_{0}\|_{2}^{2}+4\sigma^{2}\log(1/\pi_{f_{0}})\text{;}$ take expectations and insert $\mathbb{E}\|Y-f_{0}\|^{2}=\|f_{0}-\mu\|^{2}+N\sigma^{2}\text{.}$ The differentiation, the domain of Stein’s identity, and the two expansions are carried out in &lt;a href="#S5a" title="S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5&lt;/span&gt;&lt;/a&gt;.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS1.p7" class="ltx_para"&gt;
&lt;p id="S4.SS1.p7.1" class="ltx_p"&gt;Set $K:=\lfloor n/C_{\star}\rfloor$ as in &lt;a href="#S3.SS3" title="3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt;. From here through &lt;a href="#S4.SS2" title="4.2 Exact Evaluation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt;, set $k:=k_{\mathrm{alg}}(T,V,\sigma)\text{,}$ the algorithmic crossing index of &lt;a href="#S2.Thmlemma3" title="Lemma 2.3 (Profile toolkit). ‣ 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I3.i3" title="Item 3 ‣ Lemma 2.3 (Profile toolkit). ‣ 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;), so that $k\leq K+1\text{.}$ The root coordinate carries no statistical content (&lt;a href="#S2.SS1" title="2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;), so define the root-corrected observation $\widetilde{Y}$ by $\widetilde{Y}(o):=V$ and $\widetilde{Y}(v):=Y(v)$ for $v\neq o\text{.}$ The estimator of &lt;a href="#Thmtheorem2" title="Theorem 2 (Efficient estimation). ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; is&lt;/p&gt;
&lt;table id="S4.E3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widehat{\mu}\ :=\ \begin{cases}Vp_{o},&amp;amp;V^{2}H_{T}\leq\sigma^{2}k,\\ \widetilde{Y},&amp;amp;V^{2}H_{T}&amp;gt;\sigma^{2}k\ \text{ and }\ k&amp;gt;K,\\ Vp_{o},&amp;amp;V^{2}H_{T}&amp;gt;\sigma^{2}k\ \text{ and }\ k=1\leq K,\\ \widehat{\mu}_{k},&amp;amp;V^{2}H_{T}&amp;gt;\sigma^{2}k\ \text{ and }\ 2\leq k\leq K,\end{cases},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(4.3)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.SS1.p7.2" class="ltx_p"&gt;four exclusive and exhaustive branches: when the diameter is not the active scale, the index $k$ either exceeds the dimension range, or is too small for &lt;a href="#S3.Thmlemma1" title="Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt;, or is interior.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS1.p8" class="ltx_para"&gt;
&lt;p id="S4.SS1.p8.1" class="ltx_p"&gt;The risk bound of &lt;a href="#Thmtheorem2" title="Theorem 2 (Efficient estimation). ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; follows. In the interior branch &lt;a href="#S3.Thmlemma1" title="Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt; applies, and evaluating the oracle of &lt;a href="#S4.Thmlemma1" title="Lemma 4.1 (Aggregation oracle). ‣ 4.1 Aggregation over Integer States ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.1&lt;/span&gt;&lt;/a&gt; at the approximant $x^{\star}$ of a given $\mu\in\mathcal{F}_{V}(T)\text{,}$ with $\log(1/\pi_{k}(x^{\star}))\leq 2\Gamma(x^{\star})+k\leq 19k\text{,}$ gives&lt;/p&gt;
&lt;table id="S4.E4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sup_{\mu\in\mathcal{F}_{V}(T)}\mathbb{E}_{\mu}\bigl\|\widehat{\mu}_{k}-\mu\bigr\|_{2}^{2}\ \leq\ C_{0}V^{2}\delta_{k}(T)+C\sigma^{2}k\ \leq\ C\,\sigma^{2}k\ =\ C\min\{V^{2}H_{T},\ \sigma^{2}k\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(4.4)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.SS1.p8.2" class="ltx_p"&gt;the second inequality because the surrogate crossing clause fired at $k=k_{\mathrm{alg}}\leq K\text{,}$ so that $V^{2}\delta_{k}\leq V^{2}\overline{\delta}_{k}\leq 2A_{0}\sigma^{2}k\text{,}$ and the equality by the branch condition. The three elementary branches obey the same bound by the diameter and first-budget facts of &lt;a href="#S3.SS3" title="3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt; (&lt;a href="#S5a" title="S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5&lt;/span&gt;&lt;/a&gt;). Since $k_{\mathrm{alg}}\leq k_{0}$ by &lt;a href="#S2.Thmlemma3" title="Lemma 2.3 (Profile toolkit). ‣ 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I3.i3" title="Item 3 ‣ Lemma 2.3 (Profile toolkit). ‣ 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;), $\min\{V^{2}H_{T},\sigma^{2}k_{\mathrm{alg}}\}\leq\min\{V^{2}H_{T},\sigma^{2}k_{0}\}\text{,}$ which &lt;a href="#Thmtheorem1" title="Theorem 1 (Rate formula). ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; bounds by $C\,R^{*}_{T}(V,\sigma)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S4.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="exact-evaluation"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;4.2 &lt;/span&gt;Exact Evaluation&lt;/h3&gt;
&lt;div id="S4.SS2.p1" class="ltx_para"&gt;
&lt;p id="S4.SS2.p1.1" class="ltx_p"&gt;It remains to evaluate &lt;a href="#S4.E2" title="In 4.1 Aggregation over Integer States ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt;, a ratio of sums over a class of exponential size. Computing $k_{\mathrm{alg}}$ and the nets behind $A_{k}$ costs $O(n\log(n+1))$ operations (&lt;a href="#S2.Thmlemma3" title="Lemma 2.3 (Profile toolkit). ‣ 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt;), and the elementary branches are linear; the content is the interior branch.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS2.p2" class="ltx_para"&gt;
&lt;p id="S4.SS2.p2.1" class="ltx_p"&gt;The confined states are the mechanism. Every coordinate of an integer state lies in $\{0,\dots,3k\}\text{,}$ so subtree weights factorize over one integer state per vertex. Write $\varphi_{v}(x):=e^{-(Y_{v}-(V/k)x)^{2}/(4\sigma^{2})}$ for the local weight, so that the summand of &lt;a href="#S4.E2" title="In 4.1 Aggregation over Integer States ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt; at $x$ is $e^{-2\Gamma(x)}\prod_{v}\varphi_{v}(x_{v})\text{,}$ and define for each vertex the &lt;em id="S4.SS2.p2.1.1" class="ltx_emph ltx_font_italic"&gt;message&lt;/em&gt;&lt;/p&gt;
&lt;table id="S4.E5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$P_{v}(\zeta)\ :=\ \sum_{x=0}^{3k}P_{v}[x]\,\zeta^{x},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(4.5)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.SS2.p2.2" class="ltx_p"&gt;a polynomial of degree at most $3k$ in an indeterminate $\zeta\text{,}$ whose coefficient $P_{v}[x]$ is the total weight, local weights times prior kernel, of the admissible assignments on the subtree $T_{v}$ with state $x$ at $v\text{.}$ The message at $v$ arises from the product $\prod_{c\in\operatorname{ch}(v)}P_{c}(\zeta)$ of its children’s messages by pairwise polynomial multiplications and an $O(k)$ local pass, and correctness is an induction over subtrees; since every integer state has root coordinate $k\text{,}$ the denominator of &lt;a href="#S4.E2" title="In 4.1 Aggregation over Integer States ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt; is the single coefficient $P_{o}[k]\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS2.p3" class="ltx_para"&gt;
&lt;p id="S4.SS2.p3.1" class="ltx_p"&gt;A child sum can exceed $3k$ where a state cannot. At an inactive vertex conservation kills such terms; at an active vertex the prior kernel is geometric in the leak, so they enter through one scalar, the child product evaluated at $e^{-2}\text{;}$ evaluations multiply where messages multiply, so the scalar travels with each message, and no coefficient beyond degree $3k$ outlives a merge (&lt;a href="#S5a" title="S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS2.p4" class="ltx_para"&gt;
&lt;p id="S4.SS2.p4.1" class="ltx_p"&gt;The tree off the active support carries no state: a subtree disjoint from $A_{k}$ contributes a constant factor and is pruned, and a maximal chain of inactive vertices, each left with one child whose state it copies, compresses to a single edge whose diagonal kernel is generated in $O(k)$ from the chain’s length and observation sum.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS2.p5" class="ltx_para"&gt;
&lt;p id="S4.SS2.p5.1" class="ltx_p"&gt;The numerator of &lt;a href="#S4.E2" title="In 4.1 Aggregation over Integer States ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt; is recovered by differentiation. Treat the $3k+1$ local weights at each vertex as formal inputs of the arithmetic circuit that computes $P_{o}[k]\text{;}$ every admissible assignment carries the factor $\varphi_{v}(x_{v})$ exactly once, so&lt;/p&gt;
&lt;table id="S4.E6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widehat{\mu}_{k}(v)\ =\ \frac{V}{k}\,\sum_{x=0}^{3k}x\cdot\frac{\varphi_{v}(x)}{P_{o}[k]}\,\frac{\partial P_{o}[k]}{\partial\varphi_{v}(x)}\ ,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(4.6)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.SS2.p5.2" class="ltx_p"&gt;the ratio under the sum being the posterior probability of $\{x_{v}=x\}\text{.}$ One reverse-mode sweep of the circuit computes all these derivatives at once, at the same asymptotic cost as the forward pass (&lt;a href="#S5a" title="S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS2.p6" class="ltx_para"&gt;
&lt;p id="S4.SS2.p6.1" class="ltx_p"&gt;Each vertex contributes $O(k)$ local work, each of the fewer than $n$ merges costs one multiplication of degree-$3k$ polynomials, $O(k\log(k+1))$ operations in the model of &lt;a href="#S2.SS1" title="2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;, and the reverse sweep matches the forward cost, so with the preprocessing the total is $O(n\log(n+1)+nk\log(k+1))\leq O(n^{2}\log(n+1))$ operations, the count of &lt;a href="#Thmtheorem2" title="Theorem 2 (Efficient estimation). ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;. On structured trees the account improves: sibling messages that agree up to a dilation of the variable multiply in batch through power sums, and on stars the entire evaluation takes $O(n\log^{2}n)$ operations. Every tie break is fixed, so the estimator is a deterministic function of $(T,V,\sigma,Y)\text{;}$ together with the risk bound of &lt;a href="#S4.SS1" title="4.1 Aggregation over Integer States ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.1&lt;/span&gt;&lt;/a&gt;, this proves &lt;a href="#Thmtheorem2" title="Theorem 2 (Efficient estimation). ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;. The evaluation identities, the operation count, and the instance-sensitive refinements are proved in &lt;a href="#S5a" title="S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmremark1" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmremark1.2" class="ltx_text ltx_font_bold"&gt;Remark 4.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmremark1.3" class="ltx_text ltx_font_bold"&gt; (Computational model).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmremark1.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmremark1.p1.1" class="ltx_p"&gt;&lt;span id="S4.Thmremark1.p1.1.1" class="ltx_text ltx_font_italic"&gt;“Exact” refers to the estimator itself, not only to its risk order: in the arithmetic model fixed in &lt;a href="#S2.SS1" title="2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;, the messages, the overflow scalars, the compressed kernels, and the reverse sweep are algebraic identities, and the returned vector is &lt;a href="#S4.E2" title="In 4.1 Aggregation over Integer States ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt; with $k=k_{\mathrm{alg}}\text{,}$ evaluated without error.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S4.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="adaptation"&gt;&lt;span class="ltx_tag ltx_tag_subsection"&gt;4.3 &lt;/span&gt;Adaptation&lt;/h3&gt;
&lt;div id="S4.SS3.p1" class="ltx_para"&gt;
&lt;p id="S4.SS3.p1.1" class="ltx_p"&gt;The budget is not external to the model: on the cone &lt;a href="#S1.E1" title="In 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.1&lt;/span&gt;&lt;/a&gt; it is the root value of the signal, observed directly as $Y_{o}=V+\sigma Z_{o}\text{,}$ so adaptation to it is cheap but not free.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem3" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="Thmtheorem3.2" class="ltx_text ltx_font_bold"&gt;Theorem 3&lt;/span&gt;&lt;/span&gt;&lt;span id="Thmtheorem3.3" class="ltx_text ltx_font_bold"&gt; (Budget adaptation).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="Thmtheorem3.p1" class="ltx_para"&gt;
&lt;p id="Thmtheorem3.p1.1" class="ltx_p"&gt;&lt;span id="Thmtheorem3.p1.1.1" class="ltx_text ltx_font_italic"&gt;There are universal constants $c,C&amp;gt;0$ and a deterministic polynomial-time estimator $\widehat{\mu}=\widehat{\mu}(T,\sigma,Y)\text{,}$ not depending on $V\text{,}$ such that for every finite rooted tree $T\text{,}$ all $V,\sigma&amp;gt;0\text{,}$ and every $\mu\in\mathcal{F}_{V}(T)\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}_{\mu}\|\widehat{\mu}-\mu\|_{2}^{2}\ \leq\ C\bigl(R^{*}_{T}(V,\sigma)+\sigma^{2}\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="Thmtheorem3.p1.2" class="ltx_p"&gt;&lt;span id="Thmtheorem3.p1.2.1" class="ltx_text ltx_font_italic"&gt;Conversely, every estimator $\widehat{\mu}(T,\sigma,Y)$ satisfies, for every finite rooted tree $T$ and all $V,\sigma&amp;gt;0\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\max_{V^{\prime}\in\{V,\,V+\sigma\}}\ \sup_{\mu\in\mathcal{F}_{V^{\prime}}(T)}\mathbb{E}_{\mu}\|\widehat{\mu}-\mu\|_{2}^{2}\ \geq\ c\,\sigma^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p2" class="ltx_para"&gt;
&lt;p id="S4.SS3.p2.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof of &lt;a class="ltx_ref" href="#Thmtheorem3"&gt;Theorem 3&lt;/a&gt;, necessity.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p3" class="ltx_para"&gt;
&lt;p id="S4.SS3.p3.1" class="ltx_p"&gt;The points $Vp_{o}$ and $(V+\sigma)p_{o}$ lie in the slices at budgets $V$ and $V+\sigma$ and are at distance $\sigma\text{.}$ For any estimator $\widehat{\mu}(T,\sigma,Y)\text{,}$ decode the nearer of the two points: a decoding error forces squared loss at least $\sigma^{2}/4\text{,}$ and deciding between two Gaussian means at distance $\sigma$ is a one-dimensional shift of size one, on which every test errs with probability at least a universal constant under the uniform two-point prior. The larger of the two risks is therefore at least $c\,\sigma^{2}\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p4" class="ltx_para"&gt;
&lt;p id="S4.SS3.p4.1" class="ltx_p"&gt;The sufficiency halves of &lt;a href="#Thmtheorem3" title="Theorem 3 (Budget adaptation). ‣ 4.3 Adaptation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorems&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmtheorem4" title="Theorem 4 (Full adaptation). ‣ 4.3 Adaptation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; rest on candidate families free of the unknown parameters. The construction behind &lt;a href="#S3.Thmlemma1" title="Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt; consumes the budget in exactly one place, the quantization of leaks in units of $V/k\text{;}$ dropping the quantization leaves subspaces. For an integer $2\leq k\leq n/C_{\star}\text{,}$ call $S\subseteq A_{k}\setminus R_{0}$ &lt;em id="S4.SS3.p4.1.1" class="ltx_emph ltx_font_italic"&gt;admissible&lt;/em&gt; when $\sum_{v\in S}\widetilde{\omega}(v)\leq 4k\text{,}$ and define the &lt;em id="S4.SS3.p4.1.2" class="ltx_emph ltx_font_italic"&gt;profile subspaces&lt;/em&gt; $\mathcal{V}_{k,S}:=\operatorname{span}\{p_{v}:\ v\in R_{0}\cup S\}\text{,}$ of dimension $O(k)\text{.}$ Everything here depends on $(T,k)$ alone, and the admissible supports number at most $e^{C_{1}k}\text{,}$ by the counting argument of &lt;a href="#S3.Thmlemma1" title="Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt;. Every body point is close to one of these subspaces at the profile scale:&lt;/p&gt;
&lt;table id="S4.E7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\min_{S\ \mathrm{admissible}}\ \operatorname{dist}^{2}\bigl(\mu,\ \mathcal{V}_{k,S}\bigr)\ \leq\ C\,V^{2}\overline{\delta}_{k}(T)\qquad\text{for every }\mu\in\mathcal{F}_{V}(T),\ 2\leq k\leq n/C_{\star}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(4.7)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.SS3.p4.2" class="ltx_p"&gt;The unrounded skeleton and the sampled exits of the proof of &lt;a href="#S3.Thmlemma1" title="Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt; realize the bound, their support carrying total charge at most $4k$ (&lt;a href="#S6" title="S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p5" class="ltx_para"&gt;
&lt;p id="S4.SS3.p5.1" class="ltx_p"&gt;Selection is by penalized least squares with Kraft weights. &lt;a href="#S6" title="S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6&lt;/span&gt;&lt;/a&gt; proves the following oracle, of Birgé–Massart type &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib6" title="" class="ltx_ref"&gt;Birgé and Massart, 2001&lt;/a&gt;)&lt;/cite&gt;, in the weighted and random-penalty form needed here: for Gaussian data on $\mathbb{R}^{N}$ with independent coordinates of variances at most $\sigma^{2}$ and mean $\theta\text{,}$ a countable collection $\mathcal{M}$ of affine models $m$ with weights $\Delta_{m}$ obeying $\sum_{m}e^{-\Delta_{m}}\leq 1\text{,}$ penalties $C_{2}\sigma^{2}(\dim m+\Delta_{m})$ for a sufficiently large universal $C_{2}\text{,}$ and a full model penalized at $C_{2}\sigma^{2}N\text{,}$ every minimizer $\widehat{\theta}$ of the criterion obeys&lt;/p&gt;
&lt;table id="S4.E8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\bigl\|\widehat{\theta}-\theta\bigr\|_{2}^{2}\ \leq\ C\,\min\Bigl\{\ \inf_{m\in\mathcal{M}}\bigl(\operatorname{dist}^{2}(\theta,m)+\sigma^{2}(\dim m+\Delta_{m}+1)\bigr),\ \ \sigma^{2}N\Bigr\}\ +\ C\sigma^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(4.8)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.SS3.p5.2" class="ltx_p"&gt;If the penalties are random, nonnegative, and bracketed on an event $E$ between fixed multiples of the displayed ones, the same right side bounds $\mathbb{E}\bigl[\|\widehat{\theta}-\theta\|_{2}^{2}\mathbf{1}_{E}\bigr]\text{;}$ this is how the estimated noise scale enters in &lt;a href="#Thmtheorem4" title="Theorem 4 (Full adaptation). ‣ 4.3 Adaptation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p6" class="ltx_para"&gt;
&lt;p id="S4.SS3.p6.1" class="ltx_p"&gt;For $n$ below a universal threshold the estimator of &lt;a href="#Thmtheorem3" title="Theorem 3 (Budget adaptation). ‣ 4.3 Adaptation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; returns $Y\text{,}$ at risk $O(\sigma^{2})\text{;}$ above it, the estimator is one such selection, conditional on the root observation, over three groups of candidates: the amplitude-free subspaces $\mathcal{V}_{k,S}$ at dyadic budgets $2\leq k\leq k^{\star}:=\lfloor\log n/(2C_{1})\rfloor\text{;}$ the integer-state points $\tfrac{V^{\prime}}{k}\,x\text{,}$ $x\in\mathcal{X}_{k}\text{,}$ at the $O(\log n)$ amplitudes $V^{\prime}$ of a root-anchored geometric grid and a low-amplitude dyadic grid, with $\operatorname{span}(p_{o})$ and the root points $V^{\prime}p_{o}$ adjoined; and the full model, each candidate weighted by its dimension and code length. The system depends on $Y$ through $Y_{o}$ alone, so conditionally on $Y_{o}$ it is deterministic while the noise in the remaining coordinates is unchanged, and unconditioning costs $\mathbb{E}(Y_{o}-V)^{2}=\sigma^{2}\text{;}$ the precise grids, weights, and thresholds are fixed in &lt;a href="#S6" title="S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p7" class="ltx_para"&gt;
&lt;p id="S4.SS3.p7.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof sketch of &lt;a class="ltx_ref" href="#Thmtheorem3"&gt;Theorem 3&lt;/a&gt;, sufficiency.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p8" class="ltx_para"&gt;
&lt;p id="S4.SS3.p8.1" class="ltx_p"&gt;By &lt;a href="#Thmtheorem1" title="Theorem 1 (Rate formula). ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; and the sandwich of &lt;a href="#S2.Thmlemma3" title="Lemma 2.3 (Profile toolkit). ‣ 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I3.i3" title="Item 3 ‣ Lemma 2.3 (Profile toolkit). ‣ 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;), $\min\{V^{2}H_{T},\sigma^{2}k_{\mathrm{alg}}\}\asymp R^{*}_{T}(V,\sigma)\text{,}$ and there are three regimes, according to the candidate at which the oracle &lt;a href="#S4.E8" title="In 4.3 Adaptation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.8&lt;/span&gt;&lt;/a&gt; is evaluated. In the diameter regime $V^{2}H_{T}\leq\sigma^{2}k_{\mathrm{alg}}\text{,}$ the model $\operatorname{span}(p_{o})$ is within squared distance $V^{2}h_{T}$ of $\mu\text{,}$ at constant dimension and weight. In the entropy regime with small crossing, $k_{\mathrm{alg}}\leq k^{\star}/2\text{,}$ the smallest dyadic $k\geq\max\{k_{\mathrm{alg}},2\}$ stays below $k^{\star}\text{,}$ and &lt;a href="#S4.E7" title="In 4.3 Adaptation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.7&lt;/span&gt;&lt;/a&gt; with the surrogate clause fired at $k_{\mathrm{alg}}$ gives an amplitude-free admissible subspace within squared distance $C\sigma^{2}k_{\mathrm{alg}}$ of $\mu\text{,}$ at dimension plus weight $O(k_{\mathrm{alg}})\text{,}$ so no quantization is paid. In the entropy regime with large crossing, $k_{\mathrm{alg}}&amp;gt;k^{\star}/2\text{,}$ the grids take over: for $V\geq\sigma/2\text{,}$ outside an event of loss contribution $O(\sigma^{2})\text{,}$ the anchored grid contains an amplitude $V^{\prime}\geq V$ with $\mathbb{E}(V^{\prime}/V)^{2}=O(1)$ and index price $O(\sigma^{2})\text{,}$ and, according to the regime that $V^{\prime}$ sees, the approximant of &lt;a href="#S3.Thmlemma1" title="Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt; at the dyadic budget nearest its crossing, the root candidate, or the full model is a candidate whose oracle value is $C(R^{*}_{T}(V,\sigma)+\sigma^{2})$ in expectation, by the scale bound $R^{*}_{T}(cV,\sigma)\leq Cc^{2}R^{*}_{T}(V,\sigma)$ for $c\geq 1\text{;}$ for $V&amp;lt;\sigma/2$ the low-amplitude grid plays the same role, its index price absorbed because $k_{\mathrm{alg}}&amp;gt;k^{\star}/2$ places the rate above $c\,\sigma^{2}\log n$ (&lt;a href="#S6" title="S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6&lt;/span&gt;&lt;/a&gt;). The additive $\sigma^{2}$ collects the root replacement, the anchored-grid prices, and the constant floor in &lt;a href="#S4.E8" title="In 4.3 Adaptation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.8&lt;/span&gt;&lt;/a&gt;; the two families are complementary, amplitude quantization being expensive only at small crossing, where the subspaces are few enough to enumerate. The selection runs in deterministic polynomial time, each grid candidate’s inner minimization over $\mathcal{X}_{k}$ being a min-plus analogue of &lt;a href="#S4.SS2" title="4.2 Exact Evaluation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt;; the operation counts, the grid moment bounds, and the conditioning argument are completed in &lt;a href="#S6" title="S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6&lt;/span&gt;&lt;/a&gt;.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p9" class="ltx_para"&gt;
&lt;p id="S4.SS3.p9.1" class="ltx_p"&gt;It remains to remove the noise level, which enters the selection only through the penalties; these tolerate a constant-factor error, so a robust estimate suffices. The regime in which the estimate succeeds is described by a width functional of the tree. At each internal vertex of $T$ fix a child $c$ maximizing the number of vertices $u$ with $c\preceq u\text{,}$ breaking ties by a fixed rule; call the edge to that child &lt;em id="S4.SS3.p9.1.1" class="ltx_emph ltx_font_italic"&gt;heavy&lt;/em&gt;, every other child edge &lt;em id="S4.SS3.p9.1.2" class="ltx_emph ltx_font_italic"&gt;light&lt;/em&gt;, and a vertex &lt;em id="S4.SS3.p9.1.3" class="ltx_emph ltx_font_italic"&gt;branching&lt;/em&gt; when it has at least two children. Set $w_{T}:=w_{\mathrm{lt}}(T)+w_{\mathrm{br}}(T)\text{,}$ where $w_{\mathrm{lt}}(T)$ is one plus the maximum number of light edges on a root-to-leaf path, and $w_{\mathrm{br}}(T)$ is the maximum number of branching vertices on such a path.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem4" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="Thmtheorem4.2" class="ltx_text ltx_font_bold"&gt;Theorem 4&lt;/span&gt;&lt;/span&gt;&lt;span id="Thmtheorem4.3" class="ltx_text ltx_font_bold"&gt; (Full adaptation).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="Thmtheorem4.p1" class="ltx_para"&gt;
&lt;p id="Thmtheorem4.p1.1" class="ltx_p"&gt;&lt;span id="Thmtheorem4.p1.1.1" class="ltx_text ltx_font_italic"&gt;There are universal constants $c,C&amp;gt;0$ and a deterministic polynomial-time estimator $\widehat{\mu}=\widehat{\mu}(T,Y)\text{,}$ depending on neither $V$ nor $\sigma\text{,}$ such that for every finite rooted tree $T$ and all $V,\sigma&amp;gt;0\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sup_{\mu\in\mathcal{F}_{V}(T)}\mathbb{E}_{\mu}\|\widehat{\mu}-\mu\|_{2}^{2}\ \leq\ C\bigl(R^{*}_{T}(V,\sigma)+\sigma^{2}\bigr)\qquad\text{whenever}\quad Vw_{T}\leq c\sigma n.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p10" class="ltx_para"&gt;
&lt;p id="S4.SS3.p10.1" class="ltx_p"&gt;For $n$ below a universal threshold the estimator behind &lt;a href="#Thmtheorem4" title="Theorem 4 (Full adaptation). ‣ 4.3 Adaptation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; returns $Y\text{,}$ at risk $O(\sigma^{2})\text{;}$ above it, the estimator rounds a median. The tree supplies at least $(n-1)/2$ difference statistics: heavy-edge and sibling differences, each Gaussian of variance $2\sigma^{2}$ around a signal difference. Monotonicity caps the contamination collectively: heavy differences telescope along vertex-disjoint heavy paths to their tops, sibling excesses charge their branching vertices, and a root path meets at most $w_{T}$ of these sites; for every $\varepsilon&amp;gt;0\text{,}$ at most $Vw_{T}/(\varepsilon\sigma)$ statistics therefore have mean magnitude at least $\varepsilon\sigma\text{.}$ Under $Vw_{T}\leq c\sigma n\text{,}$ the normalized median of the absolute values of an independent subfamily then lands in $[\sigma/2,\,2\sigma]$ except with probability $2e^{-cn}\text{;}$ rounded upward to a power of two, the estimate takes at most four values on that event, the penalties of &lt;a href="#Thmtheorem3" title="Theorem 3 (Budget adaptation). ‣ 4.3 Adaptation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; stay bracketed at the estimated scale, a constant weight shift pays for the union over the four values, and the off-event loss contributes $O(\sigma^{2})\text{.}$ The statistics, the contamination count, the concentration of the median, and the moment bookkeeping are carried out in &lt;a href="#S6" title="S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p11" class="ltx_para"&gt;
&lt;p id="S4.SS3.p11.1" class="ltx_p"&gt;Uniform recovery of the noise level has a ceiling: once monotone flows with root value of order $\sigma n\sqrt{\log n}$ are admitted, every estimator of $\sigma$ fails, with constant probability, to land strictly within a factor $\sqrt{2}$ of the truth (&lt;a href="#S6" title="S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6&lt;/span&gt;&lt;/a&gt;). On families of bounded width, stars and brooms among them, the scale-based route of &lt;a href="#Thmtheorem4" title="Theorem 4 (Full adaptation). ‣ 4.3 Adaptation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; thus operates within a $\sqrt{\log n}$ factor of its ceiling.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S5" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="the-suboptimality-of-least-squares"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;5 &lt;/span&gt;The Suboptimality of Least Squares&lt;/h2&gt;
&lt;div id="S5.p1" class="ltx_para"&gt;
&lt;p id="S5.p1.1" class="ltx_p"&gt;The last theorem prices the default estimator. The body is compact and convex, so the data have a unique Euclidean projection onto it, the &lt;em id="S5.p1.1.1" class="ltx_emph ltx_font_italic"&gt;constrained least squares estimator&lt;/em&gt;&lt;/p&gt;
&lt;table id="S5.Ex1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widehat{\mu}_{\mathrm{LSE}}\ :=\ \Pi_{\mathcal{F}_{V}(T)}(Y)\ =\ \operatorname*{arg\,min}_{\theta\in\mathcal{F}_{V}(T)}\ \bigl\|Y-\theta\bigr\|_{2}^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.p1.2" class="ltx_p"&gt;the solution of a tuning-free convex program; write&lt;/p&gt;
&lt;table id="S5.Ex2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{\mathrm{worst}}_{\mathrm{LSE}}(T,V,\sigma)\ :=\ \sup_{\mu\in\mathcal{F}_{V}(T)}\mathbb{E}_{\mu}\bigl\|\widehat{\mu}_{\mathrm{LSE}}-\mu\bigr\|_{2}^{2}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.p1.3" class="ltx_p"&gt;for its worst-case risk.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem5" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="Thmtheorem5.2" class="ltx_text ltx_font_bold"&gt;Theorem 5&lt;/span&gt;&lt;/span&gt;&lt;span id="Thmtheorem5.3" class="ltx_text ltx_font_bold"&gt; (Least squares).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="Thmtheorem5.p1" class="ltx_para"&gt;
&lt;p id="Thmtheorem5.p1.1" class="ltx_p"&gt;&lt;span id="Thmtheorem5.p1.1.1" class="ltx_text ltx_font_italic"&gt;There is a universal constant $C$ such that for every finite rooted tree with $n\geq 2$ and all $V,\sigma&amp;gt;0\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{\mathrm{worst}}_{\mathrm{LSE}}(T,V,\sigma)\ \leq\ C\,\bigl(1+\log(en)\bigr)^{2/5}\,R^{*}_{T}(V,\sigma).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="Thmtheorem5.p1.2" class="ltx_p"&gt;&lt;span id="Thmtheorem5.p1.2.1" class="ltx_text ltx_font_italic"&gt;Conversely, there are universal constants $c&amp;gt;0$ and $n_{0}$ such that the following holds for every integer $n\geq n_{0}\text{.}$ Let $L$ be the largest integer with $e^{20L^{5/2}}\leq\sqrt{n}\text{,}$ and let $T_{L}$ be the broom on $n$ vertices whose handle $o=v_{0},v_{1},\dots,v_{L}$ is a path of $L$ edges and whose endpoint $v_{L}$ has $m:=n-L-1$ leaf children. Then, at budget $V=L^{1/4}$ and noise level $\sigma=1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{\mathrm{worst}}_{\mathrm{LSE}}\bigl(T_{L},L^{1/4},1\bigr)\ \geq\ c\,(\log n)^{2/5}\,R^{*}_{T_{L}}\bigl(L^{1/4},1\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.p2" class="ltx_para"&gt;
&lt;p id="S5.p2.1" class="ltx_p"&gt;We prove the broom lower bound first: the broom isolates the mechanism, extreme-value forcing through a terminal star, and every numerical threshold in the forcing step is explicit (&lt;a href="#S4a" title="S.4 Benchmark and Broom Profiles ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.4&lt;/span&gt;&lt;/a&gt;). The universal upper bound shows the resulting separation extremal over all trees and parameters; its proof, sketched at the end of the section, runs the coded cover of &lt;a href="#S3.SS1" title="3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt; through a localized-width analysis.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.p3" class="ltx_para"&gt;
&lt;p id="S5.p3.1" class="ltx_p"&gt;The broom couples the two classical geometries in series, a path feeding a star. For integers $L\geq 1$ and $m\geq 1\text{,}$ the broom $T_{L}$ consists of a &lt;em id="S5.p3.1.1" class="ltx_emph ltx_font_italic"&gt;handle&lt;/em&gt;, the path $o=v_{0},v_{1},\dots,v_{L}$ of $L$ edges, and of $m$ &lt;em id="S5.p3.1.2" class="ltx_emph ltx_font_italic"&gt;terminal leaves&lt;/em&gt; $w_{1},\dots,w_{m}\text{,}$ the children of $v_{L}\text{,}$ so that $n=L+1+m$ and $h_{T_{L}}=H_{T_{L}}=L+1\text{;}$ the budget and the noise level are fixed at $V:=L^{1/4}$ and $\sigma:=1\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.p4" class="ltx_para"&gt;
&lt;p id="S5.p4.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof of &lt;a class="ltx_ref" href="#Thmtheorem5"&gt;Theorem 5&lt;/a&gt;, lower bound.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.p5" class="ltx_para"&gt;
&lt;p id="S5.p5.1" class="ltx_p"&gt;Fix $n\geq n_{0}\text{,}$ with $n_{0}$ a universal constant large enough for the estimates below. The maximality of $L$ gives $e^{20L^{5/2}}\leq\sqrt{n}&amp;lt;e^{20(L+1)^{5/2}}\text{;}$ for $n\geq n_{0}$ it forces $L\geq 4$ and $L+1\leq\sqrt{n}\text{,}$ whence $m=n-L-1\geq n-\sqrt{n}\geq\sqrt{n}\geq e^{20L^{5/2}}\text{.}$ The true signal is $\mu=Vp_{o}\text{:}$ all mass rests at the root, and every nonroot coordinate vanishes. We show that one extreme leaf noise forces the projection to carry more than half the budget through the entire handle, at squared loss exceeding $L^{3/2}/4\text{,}$ on an event of probability at least $3/8\text{;}$ and that the minimax risk of the broom is of order $\sqrt{L}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.p6" class="ltx_para"&gt;
&lt;p id="S5.p6.1" class="ltx_p"&gt;&lt;em id="S5.p6.1.1" class="ltx_emph ltx_font_italic"&gt;Coordinates.&lt;/em&gt; Write $h_{j}$ for the coordinate of a body point at $v_{j}$ and $\ell_{i}$ for its coordinate at $w_{i}\text{.}$ By &lt;a href="#S2.Thmlemma1" title="Lemma 2.1 (Normal forms). ‣ 2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;, nonnegativity of the leaks identifies the body, in these coordinates, with the chain&lt;/p&gt;
&lt;table id="S5.E1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$V\ \geq\ h_{1}\ \geq\ h_{2}\ \geq\ \cdots\ \geq\ h_{L}\ \geq\ \sum_{i=1}^{m}\ell_{i},\qquad\ell_{i}\ \geq\ 0\quad(1\leq i\leq m).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(5.1)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.p6.2" class="ltx_p"&gt;The root coordinate equals $V$ on the whole body, and at the true signal the nonroot data are pure noise: $Y_{v_{j}}=Z_{v_{j}}$ and $Y_{w_{i}}=Z_{w_{i}}\text{.}$ Expanding $\|Y-\theta\|_{2}^{2}$ and discarding the terms that do not depend on $\theta$ shows that the nonroot coordinates of the projection maximize over &lt;a href="#S5.E1" title="In 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.1&lt;/span&gt;&lt;/a&gt; the objective&lt;/p&gt;
&lt;table id="S5.E2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi(h,\ell)\ :=\ 2\sum_{j=1}^{L}Z_{v_{j}}h_{j}-\sum_{j=1}^{L}h_{j}^{2}\ +\ 2\sum_{i=1}^{m}Z_{w_{i}}\ell_{i}-\sum_{i=1}^{m}\ell_{i}^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(5.2)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S5.p7" class="ltx_para"&gt;
&lt;p id="S5.p7.1" class="ltx_p"&gt;&lt;em id="S5.p7.1.1" class="ltx_emph ltx_font_italic"&gt;The forcing inequality.&lt;/em&gt; Aggregate the noise into three statistics, local to this proof:&lt;/p&gt;
&lt;table id="S5.Ex5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$W:=\sum_{j=1}^{L}Z_{v_{j}},\qquad Q:=\sum_{j=1}^{L}\bigl[Z_{v_{j}}\bigr]_{+}^{2},\qquad M:=\max_{1\leq i\leq m}Z_{w_{i}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.p7.2" class="ltx_p"&gt;Routing the full budget to a leaf attaining $M\text{,}$ that is, taking $h_{j}=V$ for every $j\text{,}$ $\ell_{i^{\star}}=V$ at one index $i^{\star}$ with $Z_{w_{i^{\star}}}=M\text{,}$ and $\ell_{i}=0$ elsewhere, is feasible in &lt;a href="#S5.E1" title="In 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.1&lt;/span&gt;&lt;/a&gt;. Its objective value is $2VW+2VM-(L+1)V^{2}\text{.}$ On the other side, suppose $M&amp;gt;0\text{;}$ then every feasible point with $h_{L}\leq V/2$ obeys&lt;/p&gt;
&lt;table id="S5.E3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Psi(h,\ell)\ \leq\ Q+MV,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(5.3)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.p7.3" class="ltx_p"&gt;since $2Z_{v_{j}}h_{j}-h_{j}^{2}\leq[Z_{v_{j}}]_{+}^{2}$ for every $h_{j}\geq 0\text{,}$ while discarding $-\sum_{i}\ell_{i}^{2}$ and replacing each $Z_{w_{i}}$ by $M$ bounds the leaf part by $2M\sum_{i}\ell_{i}\leq 2Mh_{L}\leq MV\text{,}$ the last two steps by &lt;a href="#S5.E1" title="In 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.1&lt;/span&gt;&lt;/a&gt; and by the hypothesis $h_{L}\leq V/2$ (&lt;a href="#S4a" title="S.4 Benchmark and Broom Profiles ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.4&lt;/span&gt;&lt;/a&gt;). The routed candidate beats the cap &lt;a href="#S5.E3" title="In 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.3&lt;/span&gt;&lt;/a&gt; exactly when&lt;/p&gt;
&lt;table id="S5.E4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$M\ &amp;gt;\ (L+1)V-2W+\frac{Q}{V}\ .$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(5.4)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.p7.4" class="ltx_p"&gt;When $M&amp;gt;0$ and &lt;a href="#S5.E4" title="In 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.4&lt;/span&gt;&lt;/a&gt; hold, no maximizer of $\Psi$ can have $h_{L}\leq V/2\text{,}$ so the coordinates $(\widehat{h},\widehat{\ell})$ of $\widehat{\mu}_{\mathrm{LSE}}$ satisfy $\widehat{h}_{L}&amp;gt;V/2\text{;}$ the chain &lt;a href="#S5.E1" title="In 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.1&lt;/span&gt;&lt;/a&gt; propagates the bound up the handle, and since the true nonroot signal is zero,&lt;/p&gt;
&lt;table id="S5.E5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\bigl\|\widehat{\mu}_{\mathrm{LSE}}-Vp_{o}\bigr\|_{2}^{2}\ \geq\ \sum_{j=1}^{L}\widehat{h}_{j}^{\,2}\ &amp;gt;\ L\,\frac{V^{2}}{4}\ =\ \frac{L^{3/2}}{4}\ .$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(5.5)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S5.p8" class="ltx_para"&gt;
&lt;p id="S5.p8.1" class="ltx_p"&gt;&lt;em id="S5.p8.1.1" class="ltx_emph ltx_font_italic"&gt;The forcing event.&lt;/em&gt; Let&lt;/p&gt;
&lt;table id="S5.Ex6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$E\ :=\ \{W\geq-2\sqrt{L}\}\cap\{Q\leq 2L\}\cap\{M\geq 4L^{5/4}\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.p8.2" class="ltx_p"&gt;On $E\text{,}$ with $V=L^{1/4}\text{,}$ the right side of &lt;a href="#S5.E4" title="In 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.4&lt;/span&gt;&lt;/a&gt; is less than $4L^{5/4}\leq M$ for $L\geq 4\text{,}$ so the forcing inequality holds; Markov’s inequality on the handle statistics and a Gaussian tail estimate on the leaf maximum, using $m\geq e^{20L^{5/2}}\text{,}$ give $\mathbb{P}(E)\geq\tfrac{3}{8}$ (&lt;a href="#S4a" title="S.4 Benchmark and Broom Profiles ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.4&lt;/span&gt;&lt;/a&gt;). Combining with &lt;a href="#S5.E5" title="In 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.5&lt;/span&gt;&lt;/a&gt;,&lt;/p&gt;
&lt;table id="S5.E6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}_{Vp_{o}}\bigl\|\widehat{\mu}_{\mathrm{LSE}}-Vp_{o}\bigr\|_{2}^{2}\ \geq\ \frac{L^{3/2}}{4}\,\mathbb{P}(E)\ \geq\ \frac{3}{32}\,L^{3/2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(5.6)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S5.p9" class="ltx_para"&gt;
&lt;p id="S5.p9.1" class="ltx_p"&gt;&lt;em id="S5.p9.1.1" class="ltx_emph ltx_font_italic"&gt;The minimax rate.&lt;/em&gt; The ancestor-covering numbers of the broom are explicit: $N^{\uparrow}_{T}(0)=n\text{,}$ and for integers $1\leq j\leq L\text{,}$&lt;/p&gt;
&lt;table id="S5.E7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$N^{\uparrow}_{T}(j)\ =\ \Bigl\lceil\frac{L+2}{j+1}\Bigr\rceil.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(5.7)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.p9.2" class="ltx_p"&gt;Both directions follow by counting along the root-to-leaf path $v_{0},\dots,v_{L},w_{1}\text{;}$ the single center $v_{L+1-j}$ covers every leaf at distance exactly $j$ (&lt;a href="#S4a" title="S.4 Benchmark and Broom Profiles ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.4&lt;/span&gt;&lt;/a&gt;). Thus every radius $r\geq 1$ sees a covering count independent of $m\text{:}$ the terminal star enters the profile &lt;a href="#S1.E4" title="In 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.4&lt;/span&gt;&lt;/a&gt; only through radii $r&amp;lt;1\text{,}$ where the truncation caps its term at $k\text{.}$ What survives is path geometry: &lt;a href="#S4a" title="S.4 Benchmark and Broom Profiles ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.4&lt;/span&gt;&lt;/a&gt; turns &lt;a href="#S5.E7" title="In 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.7&lt;/span&gt;&lt;/a&gt; into the profile bounds&lt;/p&gt;
&lt;table id="S5.E8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\delta_{k}(T_{L})\ \leq\ \max\Bigl\{1,\ \frac{2(L+2)}{ek^{2}}\Bigr\}\quad\text{for }k\geq 1,\qquad\quad\delta_{k}(T_{L})\ \geq\ \frac{L+2}{2ek^{2}}\quad\text{for }k\leq\frac{L+2}{2e}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(5.8)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.p9.3" class="ltx_p"&gt;The crossing then solves at $k_{0}\asymp(V^{2}(L+2)/\sigma^{2})^{1/3}\asymp\sqrt{L}\text{,}$ with the dimension clause of &lt;a href="#S1.E5" title="In 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.5&lt;/span&gt;&lt;/a&gt; silent and the diameter branch of &lt;a href="#Thmtheorem1" title="Theorem 1 (Rate formula). ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; inactive, so&lt;/p&gt;
&lt;table id="S5.E9" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{*}_{T_{L}}\bigl(L^{1/4},1\bigr)\ \asymp\ k_{0}\ \asymp\ \sqrt{L}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(5.9)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.p9.4" class="ltx_p"&gt;(&lt;a href="#S4a" title="S.4 Benchmark and Broom Profiles ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.4&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.p10" class="ltx_para"&gt;
&lt;p id="S5.p10.1" class="ltx_p"&gt;&lt;em id="S5.p10.1.1" class="ltx_emph ltx_font_italic"&gt;Conclusion.&lt;/em&gt; The maximality of $L$ gives $\sqrt{n}&amp;lt;e^{20(L+1)^{5/2}}\text{,}$ so $\log n&amp;lt;40(L+1)^{5/2}$ and $L\geq c(\log n)^{2/5}\text{.}$ Dividing &lt;a href="#S5.E6" title="In 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.6&lt;/span&gt;&lt;/a&gt; by &lt;a href="#S5.E9" title="In 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.9&lt;/span&gt;&lt;/a&gt; gives a ratio at least $cL\geq c^{\prime}(\log n)^{2/5}$ at this signal, and the worst-case risk dominates this single-signal risk.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.p11" class="ltx_para"&gt;
&lt;p id="S5.p11.1" class="ltx_p"&gt;The upper half is a statement about every tree and every parameter pair at once; its proof has three blocks, completed in &lt;a href="#S7" title="S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.p12" class="ltx_para"&gt;
&lt;p id="S5.p12.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof sketch of &lt;a class="ltx_ref" href="#Thmtheorem5"&gt;Theorem 5&lt;/a&gt;, upper bound.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.p13" class="ltx_para"&gt;
&lt;p id="S5.p13.1" class="ltx_p"&gt;&lt;em id="S5.p13.1.1" class="ltx_emph ltx_font_italic"&gt;A localized projection principle.&lt;/em&gt; For $\mu\in\mathcal{F}_{V}(T)$ and $t&amp;gt;0\text{,}$ let&lt;/p&gt;
&lt;table id="S5.Ex7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$w_{\mu}(t)\ :=\ \mathbb{E}\,\sup\bigl\{\langle Z,\theta-\mu\rangle:\ \theta\in\mathcal{F}_{V}(T),\ \|\theta-\mu\|_{2}\leq t\bigr\}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.p13.2" class="ltx_p"&gt;be the localized Gaussian width of the body at the truth. If $t\geq\sigma$ and $\sigma\,w_{\mu}(s)\leq s^{2}/4$ for every $s\geq t\text{,}$ then $\mathbb{E}_{\mu}\|\widehat{\mu}_{\mathrm{LSE}}-\mu\|_{2}^{2}\leq 33\,t^{2}\text{.}$ On the event $\|\widehat{\mu}_{\mathrm{LSE}}-\mu\|_{2}\geq s\text{,}$ projection optimality forces the supremum defining $w_{\mu}(s)$ above twice its mean; the supremum is $s$-Lipschitz in $Z\text{,}$ so Gaussian concentration bounds its probability, and integrating the tail from $t$ gives the claim (&lt;a href="#S7" title="S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7&lt;/span&gt;&lt;/a&gt;). Localizing least squares at a fixed point of the width is Chatterjee’s argument &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib14" title="" class="ltx_ref"&gt;Chatterjee, 2014&lt;/a&gt;)&lt;/cite&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.p14" class="ltx_para"&gt;
&lt;p id="S5.p14.1" class="ltx_p"&gt;&lt;em id="S5.p14.1.1" class="ltx_emph ltx_font_italic"&gt;The width of the body through the coded cover.&lt;/em&gt; Fix an integer $2\leq k\leq n/C_{\star}\text{,}$ write $\overline{\delta}:=\overline{\delta}_{k}(T)$ for the surrogate profile &lt;a href="#S2.E1" title="In 2.2 The Ancestor Profile ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;, and let $\ell_{n}:=1+\log(en)\text{.}$ &lt;a href="#S7" title="S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7&lt;/span&gt;&lt;/a&gt; proves the truth-localized width bound&lt;/p&gt;
&lt;table id="S5.E10" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$w_{\mu}(t)\ \leq\ C\,\bigl(t+V\sqrt{\overline{\delta}}\,\bigr)\sqrt{k}\ +\ C\,V\Bigl[\sqrt{k\overline{\delta}}\,\log(2+\ell_{n})+\sqrt{\overline{\delta}\,\ell_{n}}\,\Bigr]\qquad\text{for all }t&amp;gt;0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(5.10)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.p14.2" class="ltx_p"&gt;The first term is the width of the coded cover $\mathcal{D}_{k}$ seen from the truth: recentering at a deterministic center $\nu_{\mu}\in\mathcal{D}_{k}$ (&lt;a href="#S3.Thmlemma1" title="Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt;) confines every center met by the local ball to distance $t+2CV\sqrt{\overline{\delta}}\text{,}$ and the class has logarithmic cardinality $O(k)\text{,}$ so the maximum of the recentered pairings obeys a $\sqrt{k}$ bound. The second term bounds the residual $\theta-\nu_{\theta}\text{,}$ uniformly over the body, through the three components of the construction behind &lt;a href="#S3.Thmlemma1" title="Proposition 3.1 (Coded cover). ‣ 3.1 The Coded Cover ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt;: the collapse and rounding residuals, bounded by a capped order-statistics sum and a union of norm concentrations over $e^{Ck}$ subspaces at $CV\sqrt{k\overline{\delta}}$ (&lt;a href="#S7" title="S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7&lt;/span&gt;&lt;/a&gt;); and the exit quantization. Conditionally on $(\theta,Z)\text{,}$ the pairing of $Z$ with the quantization error is centered, so on the sampling event of that construction, of probability at least $\tfrac{1}{4}\text{,}$ its conditional expectation is at most four conditional standard deviations. Some realization in the event meets this bound, and the randomized rounding becomes, for each noise outcome, a deterministic choice of a nearby center in $\mathcal{D}_{k}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.p15" class="ltx_para"&gt;
&lt;p id="S5.p15.1" class="ltx_p"&gt;&lt;em id="S5.p15.1.1" class="ltx_emph ltx_font_italic"&gt;Closure of the exponent.&lt;/em&gt; Let $2\leq k_{0}\leq K\text{,}$ where $R^{*}_{T}\asymp\sigma^{2}k_{0}$ (&lt;a href="#S3.SS3" title="3.3 The Crossing and the Benchmarks ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt;). The crossing &lt;a href="#S1.E5" title="In 1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.5&lt;/span&gt;&lt;/a&gt; and the sandwich $\overline{\delta}_{k_{0}}\leq 2\delta_{k_{0}}$ give $V\sqrt{\overline{\delta}_{k_{0}}}\leq C\sigma\sqrt{k_{0}}\text{,}$ hence also $V\sqrt{k_{0}\overline{\delta}_{k_{0}}}\leq C\sigma k_{0}\text{.}$ Inserting these into &lt;a href="#S5.E10" title="In 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.10&lt;/span&gt;&lt;/a&gt; at $k=k_{0}$ and feeding the result to the localization principle at $t^{2}\asymp\sigma^{2}[\,k_{0}\log(2+\ell_{n})+\sqrt{k_{0}\,\ell_{n}}\,]$ gives&lt;/p&gt;
&lt;table id="S5.E11" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{R^{\mathrm{worst}}_{\mathrm{LSE}}(T,V,\sigma)}{R^{*}_{T}(V,\sigma)}\ \leq\ C\,\Bigl[\log(2+\ell_{n})+\sqrt{\ell_{n}/k_{0}}\,\Bigr].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(5.11)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.p15.2" class="ltx_p"&gt;This bound deteriorates as $k_{0}$ shrinks, but a small crossing index strengthens the projection: the profile remembers the height, $\delta_{k}\geq cH_{T}/k^{2}$ for $k\leq n/C_{\star}$ (&lt;a href="#S7" title="S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7&lt;/span&gt;&lt;/a&gt;), so the crossing forces $V^{2}H_{T}\leq C\sigma^{2}k_{0}^{3}\text{,}$ while $R^{\mathrm{worst}}_{\mathrm{LSE}}\leq V^{2}H_{T}$ holds, the truth and its projection lying in the body. Hence&lt;/p&gt;
&lt;table id="S5.E12" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{R^{\mathrm{worst}}_{\mathrm{LSE}}(T,V,\sigma)}{R^{*}_{T}(V,\sigma)}\ \leq\ C\,k_{0}^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(5.12)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.p15.3" class="ltx_p"&gt;The two bounds meet at $k_{0}=\ell_{n}^{1/5}\text{:}$ for $k_{0}\leq\ell_{n}^{1/5}\text{,}$ &lt;a href="#S5.E12" title="In 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.12&lt;/span&gt;&lt;/a&gt; is at most $C\ell_{n}^{2/5}\text{;}$ for $k_{0}&amp;gt;\ell_{n}^{1/5}\text{,}$ &lt;a href="#S5.E11" title="In 5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.11&lt;/span&gt;&lt;/a&gt; is at most $C[\log(2+\ell_{n})+\ell_{n}^{2/5}]\leq C^{\prime}\ell_{n}^{2/5}\text{.}$ At the endpoints $k_{0}=K+1$ and $k_{0}=1$ the deterministic caps $R^{\mathrm{worst}}_{\mathrm{LSE}}\leq\min\{V^{2}H_{T},\ \sigma^{2}n\}$ close the argument against $R^{*}_{T}$ (&lt;a href="#S7" title="S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7&lt;/span&gt;&lt;/a&gt;).
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.p16" class="ltx_para"&gt;
&lt;p id="S5.p16.1" class="ltx_p"&gt;The broom is where the two geometries of this paper part ways. Euclidean geometry sees $m$ orthogonal leaf directions, and the extreme noise among them pulls the projection through the handle; the ancestor geometry sees, at every radius $r\geq 1\text{,}$ one vertex that covers the entire star, and the truncation caps its cost at the information budget rather than per leaf. The truncated ancestor profile is therefore the right geometry for this body. On every finite tree it determines the minimax rate and yields an estimator evaluated exactly, one that survives the removal of the budget at an additive cost of order $\sigma^{2}\text{;}$ across all trees it prices the blindness of the default convex program at the power $2/5$ of the logarithm.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="ltx_pagination ltx_role_newpage"&gt;&lt;/div&gt;
&lt;div id="S5.p17" class="ltx_para"&gt;
&lt;p id="S5.p17.1" class="ltx_p"&gt;The appendices below contain the complete proofs. References of the form Lemma 2.3, (1.4), or Section 2 point to the main body above; statements and equations proved here carry the prefix S, and the notation of the main body remains in force.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S1a" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="the-profile-toolkit"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;S.1 &lt;/span&gt;The Profile Toolkit&lt;/h2&gt;
&lt;div id="S1a.p1" class="ltx_para"&gt;
&lt;p id="S1a.p1.1" class="ltx_p"&gt;This section proves the statements deferred from Section 2, Lemmas 2.1 to 2.3, and verifies two comparisons stated in Section 1.1: the center convention behind (1.6), and the capped constraint of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib1" title="" class="ltx_ref"&gt;Chatterjee and Lafferty (2018)&lt;/a&gt;&lt;/cite&gt;. The two normal forms and the isometry come first; the computational claims of Lemma 2.3 then rest on an exact linear-time algorithm for minimum ancestor nets.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p2" class="ltx_para"&gt;
&lt;p id="S1a.p2.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof of Lemma&amp;nbsp;2.1.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p3" class="ltx_para"&gt;
&lt;p id="S1a.p3.1" class="ltx_p"&gt;&lt;em id="S1a.p3.1.1" class="ltx_emph ltx_font_italic"&gt;Item &lt;span id="S1a.p3.1.1.1" class="ltx_text ltx_font_upright"&gt;(1)&lt;/span&gt; is equivalent to item &lt;span id="S1a.p3.1.1.2" class="ltx_text ltx_font_upright"&gt;(2)&lt;/span&gt;.&lt;/em&gt; Definition (1.2) reads $\mu=V\sum_{u}\lambda_{u}p_{u}$ with $\lambda$ a probability vector on $\mathsf{V}\text{,}$ and the substitution $s_{u}=V\lambda_{u}$ turns this into $\mu=\sum_{u}s_{u}p_{u}$ with $s_{u}\geq 0$ and $\sum_{u}s_{u}=V\text{.}$ For uniqueness, order $\mathsf{V}$ so that every vertex precedes its descendants, for instance by nondecreasing depth, and let $P$ be the matrix with columns $(p_{u})_{u\in\mathsf{V}}$ in that order. Its entry at row $v$ and column $u$ is $\mathbf{1}\{v\preceq u\}\text{,}$ which vanishes when $v$ follows $u\text{,}$ because a strict ancestor of $u$ precedes $u\text{;}$ and $p_{u}(u)=1$ on the diagonal. So $P$ is upper triangular with unit diagonal, hence $\det P=1$ and $P$ is invertible, and the coefficient vector is determined by $\mu\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p4" class="ltx_para"&gt;
&lt;p id="S1a.p4.1" class="ltx_p"&gt;&lt;em id="S1a.p4.1.1" class="ltx_emph ltx_font_italic"&gt;Item &lt;span id="S1a.p4.1.1.1" class="ltx_text ltx_font_upright"&gt;(2)&lt;/span&gt; implies item &lt;span id="S1a.p4.1.1.2" class="ltx_text ltx_font_upright"&gt;(3)&lt;/span&gt; and both displayed identities.&lt;/em&gt; Evaluating $\mu=\sum_{u}s_{u}p_{u}$ at $v$ gives&lt;/p&gt;
&lt;table id="S1.E1a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mu(v)\ =\ \sum_{u\in\mathsf{V}}s_{u}\,\mathbf{1}\{v\preceq u\}\ =\ \sum_{u\succeq v}s_{u},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.1.1)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p4.2" class="ltx_p"&gt;the first identity; at $v=o$ it reads $\mu(o)=\sum_{u}s_{u}=V\text{,}$ every vertex being a descendant of the root. The strict descendants of $v$ are partitioned by the subtrees $T_{c}\text{,}$ $c\in\operatorname{ch}(v)\text{,}$ so subtracting &lt;a href="#S1.E1a" title="In S.1 The Profile Toolkit ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.1.1&lt;/span&gt;&lt;/a&gt; at the children from &lt;a href="#S1.E1a" title="In S.1 The Profile Toolkit ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.1.1&lt;/span&gt;&lt;/a&gt; at $v$ leaves the single term $u=v\text{:}$&lt;/p&gt;
&lt;table id="S1.Ex1a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mu(v)-\sum_{c\in\operatorname{ch}(v)}\mu(c)\ =\ \sum_{u\succeq v}s_{u}-\sum_{c\in\operatorname{ch}(v)}\sum_{u\succeq c}s_{u}\ =\ s_{v}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p4.3" class="ltx_p"&gt;This is the second identity; since $s\geq 0$ it gives $\mu(v)\geq\sum_{c\in\operatorname{ch}(v)}\mu(c)\text{,}$ which with $\mu(o)=V$ is item (3).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p5" class="ltx_para"&gt;
&lt;p id="S1a.p5.1" class="ltx_p"&gt;&lt;em id="S1a.p5.1.1" class="ltx_emph ltx_font_italic"&gt;Item &lt;span id="S1a.p5.1.1.1" class="ltx_text ltx_font_upright"&gt;(3)&lt;/span&gt; implies item &lt;span id="S1a.p5.1.1.2" class="ltx_text ltx_font_upright"&gt;(2)&lt;/span&gt;.&lt;/em&gt; Set $s_{v}:=\mu(v)-\sum_{c\in\operatorname{ch}(v)}\mu(c)\text{,}$ nonnegative by hypothesis. We prove &lt;a href="#S1.E1a" title="In S.1 The Profile Toolkit ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.1.1&lt;/span&gt;&lt;/a&gt; by induction from the leaves upward. At a leaf the sum over children is empty, so $s_{v}=\mu(v)\text{,}$ which is the claim. At an internal vertex, the same partition of the strict descendants of $v$ and the inductive hypothesis at the children give&lt;/p&gt;
&lt;table id="S1.Ex2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{u\succeq v}s_{u}\ =\ s_{v}+\sum_{c\in\operatorname{ch}(v)}\sum_{u\succeq c}s_{u}\ =\ s_{v}+\sum_{c\in\operatorname{ch}(v)}\mu(c)\ =\ \mu(v).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p5.2" class="ltx_p"&gt;At $v=o$ this yields $\sum_{u}s_{u}=\mu(o)=V\text{,}$ and reading &lt;a href="#S1.E1a" title="In S.1 The Profile Toolkit ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.1.1&lt;/span&gt;&lt;/a&gt; at every coordinate says exactly $\mu=\sum_{u}s_{u}p_{u}\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p6" class="ltx_para"&gt;
&lt;p id="S1a.p6.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof of Lemma&amp;nbsp;2.2.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p7" class="ltx_para"&gt;
&lt;p id="S1a.p7.1" class="ltx_p"&gt;&lt;em id="S1a.p7.1.1" class="ltx_emph ltx_font_italic"&gt;Part &lt;span id="S1a.p7.1.1.1" class="ltx_text ltx_font_upright"&gt;(1)&lt;/span&gt;.&lt;/em&gt; A vertex is a common ancestor of $u$ and $w$ precisely when it is an ancestor of their deepest common ancestor $u\wedge w\text{,}$ and a vertex $x$ has exactly $\operatorname{depth}(x)+1$ ancestors, namely the vertices of the segment from $o$ to $x\text{.}$ Hence&lt;/p&gt;
&lt;table id="S1.Ex3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\langle p_{u},p_{w}\rangle\ =\ \#\{v:\ v\preceq u\ \text{and}\ v\preceq w\}\ =\ \operatorname{depth}(u\wedge w)+1,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p7.2" class="ltx_p"&gt;and in particular $\|p_{x}\|_{2}^{2}=\operatorname{depth}(x)+1\text{.}$ Expanding the square,&lt;/p&gt;
&lt;table id="S1.Ex4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\|p_{u}-p_{w}\|_{2}^{2}\ =\ \operatorname{depth}(u)+\operatorname{depth}(w)-2\operatorname{depth}(u\wedge w)\ =\ d_{T}(u,w),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p7.3" class="ltx_p"&gt;the last equality because the $u$-to-$w$ path is the concatenation of the segments from $u$ up to $u\wedge w$ and from $u\wedge w$ down to $w\text{.}$ The diameter of a convex hull equals that of its generating set, so $\operatorname{diam}^{2}\mathcal{F}_{V}(T)=\max_{u,w}\|Vp_{u}-Vp_{w}\|_{2}^{2}=V^{2}H_{T}$ by (1.2).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p8" class="ltx_para"&gt;
&lt;p id="S1a.p8.1" class="ltx_p"&gt;&lt;em id="S1a.p8.1.1" class="ltx_emph ltx_font_italic"&gt;Part &lt;span id="S1a.p8.1.1.1" class="ltx_text ltx_font_upright"&gt;(2)&lt;/span&gt;.&lt;/em&gt; For $a\preceq b$ every ancestor of $a$ is an ancestor of $b\text{,}$ so&lt;/p&gt;
&lt;table id="S1.Ex5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(p_{b}-p_{a})(v)\ =\ \mathbf{1}\{v\preceq b\}-\mathbf{1}\{v\preceq a\}\ =\ \mathbf{1}\{a\prec v\preceq b\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p8.2" class="ltx_p"&gt;that is, $p_{b}-p_{a}=\mathbf{1}_{(a,b]}\text{.}$ For general $u,w$ put $m:=u\wedge w$ and subtract the two vertical cases,&lt;/p&gt;
&lt;table id="S1.Ex6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$p_{u}-p_{w}\ =\ (p_{u}-p_{m})-(p_{w}-p_{m})\ =\ \mathbf{1}_{(m,u]}-\mathbf{1}_{(m,w]}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p8.3" class="ltx_p"&gt;The sets $(m,u]$ and $(m,w]$ are disjoint, since a common element would be a common ancestor of $u$ and $w$ strictly below $m\text{;}$ their union is the set of lower endpoints of the edges on the $u$-to-$w$ path, by the description of that path just used.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p9" class="ltx_para"&gt;
&lt;p id="S1a.p9.1" class="ltx_p"&gt;For the last assertion, let $u$ and $w$ lie in a connected subtree $C\text{.}$ The $u$-to-$w$ path then runs inside $C\text{,}$ so the support of $p_{u}-p_{w}$ consists of lower endpoints of edges of $C\text{.}$ Distinct edges have distinct lower endpoints, an edge being determined by its lower endpoint, so differences taken within edge-disjoint connected subtrees occupy disjoint coordinate sets.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p10" class="ltx_para"&gt;
&lt;p id="S1a.p10.1" class="ltx_p"&gt;Fix an integer radius $q\geq 0\text{.}$ The &lt;em id="S1a.p10.1.1" class="ltx_emph ltx_font_italic"&gt;residual-depth greedy&lt;/em&gt; computes a minimum ancestor $q$-net in one postorder pass, maintaining one number per vertex. Process the vertices in postorder, with a fixed child order, and at each vertex $v$ compute, from the values $r_{c}$ already assigned at its children,&lt;/p&gt;
&lt;table id="S1.E2a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{v}:=\max\bigl(\{0\}\cup\{r_{c}+1:\ c\in\operatorname{ch}(v),\ r_{c}\neq-\infty\}\bigr);$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.1.2)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p10.2" class="ltx_p"&gt;if $d_{v}=q\text{,}$ select $v$ as a center and set $r_{v}:=-\infty\text{;}$ otherwise set $r_{v}:=d_{v}\text{.}$ After the root has been processed, select it as well if $r_{o}\neq-\infty\text{.}$ The number $r_{v}$ tracks the depth below $v$ of the deepest vertex of $T_{v}$ that no selected center covers, with $-\infty$ standing for none; the proof below verifies this reading.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.Thmlemma1" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S1.Thmlemma1.2" class="ltx_text ltx_font_bold"&gt;Lemma S.1.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S1.Thmlemma1.3" class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S1.Thmlemma1.p1" class="ltx_para"&gt;
&lt;p id="S1.Thmlemma1.p1.1" class="ltx_p"&gt;&lt;span id="S1.Thmlemma1.p1.1.1" class="ltx_text ltx_font_italic"&gt;For every integer $q\geq 0\text{,}$ the residual-depth greedy outputs a minimum ancestor $q$-net of $T$ in $O(n)$ operations, and the output is a deterministic function of $(T,q)\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S1a.p11" class="ltx_para"&gt;
&lt;p id="S1a.p11.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p12" class="ltx_para"&gt;
&lt;p id="S1a.p12.1" class="ltx_p"&gt;We first verify feasibility, then exhibit the selected centers, in a suitable order, as a run of a conceptually simpler procedure, the &lt;em id="S1a.p12.1.1" class="ltx_emph ltx_font_italic"&gt;deepest-uncovered greedy&lt;/em&gt;, and finally prove by an exchange argument that every run of that procedure is minimum.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p13" class="ltx_para"&gt;
&lt;p id="S1a.p13.1" class="ltx_p"&gt;&lt;em id="S1a.p13.1.1" class="ltx_emph ltx_font_italic"&gt;Feasibility.&lt;/em&gt; Call a vertex &lt;em id="S1a.p13.1.2" class="ltx_emph ltx_font_italic"&gt;uncovered&lt;/em&gt; at a given moment when no center selected so far is an ancestor of it within distance $q\text{.}$ We claim that after $v$ is processed, $r_{v}$ is exactly the maximal depth below $v$ of an uncovered vertex of $T_{v}\text{,}$ with $r_{v}=-\infty$ when none exists, and that $r_{v}&amp;lt;q\text{.}$ When $v$ is examined, every selected center is an already processed vertex, and no ancestor of $v$ has been processed, so $v$ is uncovered. Moreover, an ancestor of a vertex of $T_{c}\text{,}$ for a child $c$ of $v\text{,}$ lies in $T_{c}$ or strictly above $c\text{,}$ and no center selected after $c$ was processed is of either kind: the subtree $T_{c}$ is finished, and the vertices above $c$ are not yet processed. The uncovered part of $T_{c}$ is therefore still the one described by $r_{c}\text{,}$ and the uncovered vertices of $T_{v}$ are $v$ itself together with those of the children’s subtrees, one level deeper. Hence $d_{v}$ in &lt;a href="#S1.E2a" title="In S.1 The Profile Toolkit ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.1.2&lt;/span&gt;&lt;/a&gt; is exactly the maximal depth below $v$ of an uncovered vertex of $T_{v}\text{,}$ and $d_{v}\leq q$ by the inductive bound $r_{c}&amp;lt;q\text{.}$ If $d_{v}=q\text{,}$ selecting $v$ covers every uncovered vertex of $T_{v}\text{,}$ all being descendants of $v$ within distance $q\text{,}$ and $r_{v}=-\infty$ is correct; otherwise no center is added and $r_{v}=d_{v}&amp;lt;q$ is correct. When the root has been processed, either $r_{o}=-\infty$ and nothing remains uncovered, or the final selection covers the remaining uncovered vertices, which lie within $r_{o}&amp;lt;q$ of the root. Each vertex is examined once at cost proportional to its number of children, so the pass costs $O(n)\text{;}$ and the child order being fixed, the algorithm makes no arbitrary choices, so the output is a deterministic function of $(T,q)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p14" class="ltx_para"&gt;
&lt;p id="S1a.p14.1" class="ltx_p"&gt;&lt;em id="S1a.p14.1.1" class="ltx_emph ltx_font_italic"&gt;Reduction to the deepest-uncovered greedy.&lt;/em&gt; The comparison procedure repeats the following step until every vertex is covered: pick an uncovered vertex $u$ of maximum depth and select its ancestor at distance exactly $\min\{q,\operatorname{depth}(u)\}\text{.}$ To exhibit the algorithm’s output as a run of this procedure, attach to every center $g$ selected through the test $d_{g}=q$ a &lt;em id="S1a.p14.1.2" class="ltx_emph ltx_font_italic"&gt;witness&lt;/em&gt; $u_{g}\in T_{g}$ realizing $d_{g}\text{,}$ so that $d_{T}(g,u_{g})=q\text{;}$ if the root is selected at the end, its witness is a deepest vertex left uncovered, at distance $r_{o}&amp;lt;q\text{.}$ Order the selected centers by nonincreasing depth, ties broken by processing order, with the final root selection last, and let $P$ denote the set of centers preceding a given center in this order.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p15" class="ltx_para"&gt;
&lt;p id="S1a.p15.1" class="ltx_p"&gt;Fix a center $g$ with $d_{T}(g,u_{g})=q\text{.}$ First, $u_{g}$ is uncovered when only $P$ is in place: a center covering $u_{g}$ is an ancestor of $u_{g}$ of depth at least $\operatorname{depth}(u_{g})-q=\operatorname{depth}(g)\text{,}$ so it lies on the vertical segment between $g$ and $u_{g}\text{,}$ inside $T_{g}\text{,}$ and was processed, and selected, before $g\text{;}$ had it covered $u_{g}\text{,}$ then $u_{g}$ would already be covered when $g$ was examined and could not realize $d_{g}\text{.}$ Second, every vertex $w$ strictly deeper than $u_{g}$ is covered by $P\text{:}$ the complete output is feasible, so some selected center $c$ satisfies $c\preceq w$ and $d_{T}(c,w)\leq q\text{,}$ whence&lt;/p&gt;
&lt;table id="S1.Ex7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\operatorname{depth}(c)\ \geq\ \operatorname{depth}(w)-q\ &amp;gt;\ \operatorname{depth}(u_{g})-q\ =\ \operatorname{depth}(g),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p15.2" class="ltx_p"&gt;and every selected center strictly deeper than $g$ precedes it. Thus at $g$’s turn the vertex $u_{g}$ is a deepest uncovered vertex, and $g$ is its ancestor at distance exactly $q=\min\{q,\operatorname{depth}(u_{g})\}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p16" class="ltx_para"&gt;
&lt;p id="S1a.p16.1" class="ltx_p"&gt;For the final root selection with witness $u\text{:}$ no nonroot center covers the witness, which is still uncovered after the whole tree has been processed; every $w$ strictly deeper than $u$ is covered by a nonroot center, since otherwise $w$ would be an uncovered vertex deeper than $u$ at that moment, contradicting the maximality defining $r_{o}\text{;}$ and the root is the ancestor of $u$ at distance $\operatorname{depth}(u)=\min\{q,\operatorname{depth}(u)\}\text{,}$ since $\operatorname{depth}(u)=r_{o}&amp;lt;q\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p17" class="ltx_para"&gt;
&lt;p id="S1a.p17.1" class="ltx_p"&gt;&lt;em id="S1a.p17.1.1" class="ltx_emph ltx_font_italic"&gt;Optimality by exchange.&lt;/em&gt; Suppose, inductively, that some minimum ancestor $q$-net $O$ contains the first $t-1$ centers of a run of the deepest-uncovered greedy; let $u$ be the uncovered vertex of maximum depth picked at step $t$ and $g$ its selected ancestor. Feasibility of $O$ provides $c\in O$ with $c\preceq u$ and $d_{T}(c,u)\leq q\text{;}$ being an ancestor of $u$ of depth at least $\operatorname{depth}(u)-q\text{,}$ the center $c$ lies on the segment between $g$ and $u\text{,}$ and $c$ is not among the first $t-1$ centers, which do not cover $u\text{.}$ Set $O^{\prime}:=(O\setminus\{c\})\cup\{g\}\text{.}$ A vertex $x$ covered by $c$ but not by $g$ is a descendant of $g\text{,}$ as $g\preceq c\preceq x\text{,}$ with $d_{T}(g,x)&amp;gt;q\text{,}$ so that&lt;/p&gt;
&lt;table id="S1.Ex8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\operatorname{depth}(x)\ &amp;gt;\ \operatorname{depth}(g)+q\ \geq\ \operatorname{depth}(u),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p17.2" class="ltx_p"&gt;and $x$ is covered by the first $t-1$ centers, which lie in $O^{\prime}\text{.}$ Thus $O^{\prime}$ is feasible, contains the first $t$ centers, and $|O^{\prime}|\leq|O|\text{,}$ so $O^{\prime}$ is again a minimum net. By induction the complete run is contained in a minimum net, and being itself feasible, it is minimum.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p18" class="ltx_para"&gt;
&lt;p id="S1a.p18.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof of Lemma 2.3.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p19" class="ltx_para"&gt;
&lt;p id="S1a.p19.1" class="ltx_p"&gt;Throughout, write $c_{q}:=\min\{k,[\log(N^{\uparrow}_{T}(q)/k)]_{+}\}$ for the truncated factor of the profile at integer radius $q\text{,}$ the dependence on the fixed index $k$ suppressed from the notation.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p20" class="ltx_para"&gt;
&lt;p id="S1a.p20.1" class="ltx_p"&gt;&lt;em id="S1a.p20.1.1" class="ltx_emph ltx_font_italic"&gt;Part (1).&lt;/em&gt; Dividing the truncated factor in (1.4) by $k$ and using $\min\{k,x\}/k=\min\{1,x/k\}$ gives&lt;/p&gt;
&lt;table id="S1.E3a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\delta_{k}(T)=\sup_{r&amp;gt;0}\ r\,\min\Bigl\{1,\ \frac{1}{k}\Bigl[\log\frac{N^{\uparrow}_{T}(r)}{k}\Bigr]_{+}\Bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.1.3)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p20.2" class="ltx_p"&gt;Fix $r\text{.}$ As $k$ increases, $[\log(N^{\uparrow}_{T}(r)/k)]_{+}$ is nonnegative and nonincreasing, and so is $1/k\text{;}$ a product of two nonnegative nonincreasing functions is nonincreasing, and the cap by $1$ preserves this. Every term of the supremum in &lt;a href="#S1.E3a" title="In S.1 The Profile Toolkit ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.1.3&lt;/span&gt;&lt;/a&gt; is therefore nonincreasing in $k\text{,}$ and so is $\delta_{k}\text{.}$ For the upper bound, the root is an ancestor of every vertex within distance $h_{T}\text{,}$ so $N^{\uparrow}_{T}(r)=1$ and the term vanishes for $r\geq h_{T}\text{,}$ while for $r&amp;lt;h_{T}$ the term is at most $r&amp;lt;h_{T}\text{;}$ hence $\delta_{k}\leq h_{T}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p21" class="ltx_para"&gt;
&lt;p id="S1a.p21.1" class="ltx_p"&gt;&lt;em id="S1a.p21.1.1" class="ltx_emph ltx_font_italic"&gt;Part (2).&lt;/em&gt; Tree distances take integer values, so the covering constraint $d_{T}(a,u)\leq r$ is equivalent to $d_{T}(a,u)\leq\lfloor r\rfloor\text{,}$ and $N^{\uparrow}_{T}(r)=N^{\uparrow}_{T}(\lfloor r\rfloor)$ for every $r\geq 0\text{.}$ The supremum in (1.4) therefore splits along integer radii:&lt;/p&gt;
&lt;table id="S1.Ex9" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\alpha_{k}(T)=\sup_{q\geq 0}\ \sup_{r\in[q,q+1)\cap(0,\infty)}\ r\,c_{q}=\sup_{q\geq 0}\ (q+1)\,c_{q},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p21.2" class="ltx_p"&gt;the inner supremum being approached as $r\uparrow q+1\text{.}$ Radii $q\geq h_{T}$ have $N^{\uparrow}_{T}(q)=1$ and $c_{q}=0\text{,}$ so the outer supremum is a maximum over the integers $0\leq q&amp;lt;h_{T}\text{,}$ an empty maximum being zero; this also covers $n=1\text{,}$ where $h_{T}=0\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p22" class="ltx_para"&gt;
&lt;p id="S1a.p22.1" class="ltx_p"&gt;&lt;em id="S1a.p22.1.1" class="ltx_emph ltx_font_italic"&gt;Part (3): the two-sided comparison.&lt;/em&gt; Write $G:=\{2^{\ell}-1:\ \ell\in\{0,1,2,\dots\},\ 2^{\ell}\leq h_{T}\}$ for the grid, so that (2.1) reads $\overline{\delta}_{k}=\tfrac{2}{k}\max_{q\in G}(q+1)c_{q}\text{.}$ The grid consists of integer radii below $h_{T}\text{,}$ so part (2) gives $\max_{q\in G}(q+1)c_{q}\leq\alpha_{k}\text{,}$ that is, $\overline{\delta}_{k}\leq 2\delta_{k}\text{.}$ Conversely, fix an integer $0\leq q&amp;lt;h_{T}$ and set $s:=q+1\in[1,h_{T}]\text{;}$ the largest power of two $p\leq s$ satisfies $p&amp;gt;s/2\text{,}$ and $q^{\prime}:=p-1$ belongs to $G$ with $q^{\prime}\leq q\text{.}$ Every ancestor $q^{\prime}$-net is an ancestor $q$-net, so $N^{\uparrow}_{T}(q^{\prime})\geq N^{\uparrow}_{T}(q)$ and $c_{q^{\prime}}\geq c_{q}\text{,}$ whence&lt;/p&gt;
&lt;table id="S1.Ex10" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(q^{\prime}+1)\,c_{q^{\prime}}\ =\ p\,c_{q^{\prime}}\ \geq\ \frac{s}{2}\,c_{q}\ =\ \frac{q+1}{2}\,c_{q}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p22.2" class="ltx_p"&gt;Maximizing over $q$ gives $\max_{q\in G}(q+1)c_{q}\geq\alpha_{k}/2\text{,}$ that is, $\overline{\delta}_{k}\geq\delta_{k}\text{.}$ When $h_{T}=0$ both sides vanish by convention. Monotonicity of $k\mapsto\overline{\delta}_{k}$ follows as in part (1), applied to the finite maximum over $G\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p23" class="ltx_para"&gt;
&lt;p id="S1a.p23.1" class="ltx_p"&gt;&lt;em id="S1a.p23.1.1" class="ltx_emph ltx_font_italic"&gt;Part (3): the sandwich.&lt;/em&gt; Put $K:=\lfloor n/C_{\star}\rfloor\text{.}$ The dimension clause $k&amp;gt;n/C_{\star}$ first holds at $k=K+1\text{,}$ so the minima in (1.5) and (2.2) are over nonempty sets and $k_{0},k_{\mathrm{alg}}\leq K+1\text{.}$ For the lower half: if $k_{0}\leq K\text{,}$ the dimension clause fails at $k_{0}\text{,}$ so the profile clause holds there, $V^{2}\overline{\delta}_{k_{0}}\leq 2V^{2}\delta_{k_{0}}\leq 2A_{0}\sigma^{2}k_{0}\text{,}$ and $k_{\mathrm{alg}}\leq k_{0}\text{;}$ if $k_{0}=K+1\text{,}$ then $k_{\mathrm{alg}}\leq K+1=k_{0}$ directly. For the upper half: if $k_{\mathrm{alg}}=K+1\text{,}$ the lower half forces $k_{0}=K+1=k_{\mathrm{alg}}\text{.}$ Otherwise $k_{\mathrm{alg}}\leq K\text{,}$ so the dimension clause of (2.2) fails at $k_{\mathrm{alg}}\text{,}$ its profile clause holds, and $V^{2}\delta_{k_{\mathrm{alg}}}\leq V^{2}\overline{\delta}_{k_{\mathrm{alg}}}\leq 2A_{0}\sigma^{2}k_{\mathrm{alg}}\text{.}$ If $k_{0}=k_{\mathrm{alg}}$ there is nothing to prove. If $k_{0}&amp;gt;k_{\mathrm{alg}}\text{,}$ every integer $k$ with $k_{\mathrm{alg}}\leq k\leq k_{0}-1$ fails both clauses of (1.5) by the minimality of $k_{0}\text{;}$ in particular $V^{2}\delta_{k}&amp;gt;A_{0}\sigma^{2}k\text{,}$ and combining this with the monotonicity of part (1),&lt;/p&gt;
&lt;table id="S1.Ex11" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$A_{0}\sigma^{2}k\ &amp;lt;\ V^{2}\delta_{k}\ \leq\ V^{2}\delta_{k_{\mathrm{alg}}}\ \leq\ 2A_{0}\sigma^{2}k_{\mathrm{alg}},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p23.2" class="ltx_p"&gt;so $k&amp;lt;2k_{\mathrm{alg}}\text{.}$ At $k=k_{0}-1$ this reads $k_{0}-1&amp;lt;2k_{\mathrm{alg}}\text{,}$ that is, $k_{0}\leq 2k_{\mathrm{alg}}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p24" class="ltx_para"&gt;
&lt;p id="S1a.p24.1" class="ltx_p"&gt;&lt;em id="S1a.p24.1.1" class="ltx_emph ltx_font_italic"&gt;Part (3): complexity.&lt;/em&gt; &lt;a href="#S1.Thmlemma1" title="Lemma S.1.1. ‣ S.1 The Profile Toolkit ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.1.1&lt;/span&gt;&lt;/a&gt; computes $N^{\uparrow}_{T}(q)$ exactly in $O(n)$ operations for each integer radius. The grid $G$ has $O(\log(h_{T}+1))$ elements, so storing $\{N^{\uparrow}_{T}(q)\}_{q\in G}$ costs $O(n\log(h_{T}+1))\text{,}$ after which each evaluation of $\overline{\delta}_{k}$ costs $O(\log(h_{T}+1))\text{.}$ The predicate in (2.2) is monotone in $k\text{:}$ in its profile clause the left side is nonincreasing by the monotonicity proved above and the right side is increasing, and its dimension clause is monotone; $k_{\mathrm{alg}}$ is therefore located by binary search over $\{1,\dots,K+1\}$ with $O(\log n)$ predicate evaluations. Since $h_{T}&amp;lt;n\text{,}$ the total is $O(n\log(n+1))\text{.}$ For $k_{0}\text{,}$ running &lt;a href="#S1.Thmlemma1" title="Lemma S.1.1. ‣ S.1 The Profile Toolkit ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.1.1&lt;/span&gt;&lt;/a&gt; at every integer radius $0\leq q&amp;lt;h_{T}$ costs $O(n\,h_{T})$ and stores all counts; each $\alpha_{k}$ then costs $O(h_{T})$ by (2.3), and scanning $k=1,2,\dots$ until the first index satisfying (1.5), at most $K+1\leq n$ values, costs $O(n\,h_{T})$ in total.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p25" class="ltx_para"&gt;
&lt;p id="S1a.p25.1" class="ltx_p"&gt;Finally, we verify the center-convention comparison stated with (1.6). Write $H^{c,\mathrm{int}}_{T}(t)$ for the covering entropy of $\mathcal{F}_{V}(T)$ at squared radius $t$ with centers restricted to the body, and&lt;/p&gt;
&lt;table id="S1.Ex12" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\rho^{\mathrm{int}}_{T}(V,\sigma)\ :=\ \inf_{t&amp;gt;0}\ \bigl[t+\sigma^{2}H^{c,\mathrm{int}}_{T}(t)\bigr].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p25.2" class="ltx_p"&gt;Since every cover with centers in the body is in particular a cover with free centers, $H^{c}_{T}(t)\leq H^{c,\mathrm{int}}_{T}(t)$ for every $t&amp;gt;0\text{.}$ Conversely, fix $t&amp;gt;0$ and a cover of the body by $\exp H^{c}_{T}(t)$ balls of radius $\sqrt{t}$ with arbitrary centers, and replace the center $y$ of each ball by its Euclidean projection $\pi_{y}:=\Pi_{\mathcal{F}_{V}(T)}(y)$ onto the body. The variational inequality of the projection, $\langle y-\pi_{y},\mu-\pi_{y}\rangle\leq 0$ for every $\mu\in\mathcal{F}_{V}(T)\text{,}$ gives&lt;/p&gt;
&lt;table id="S1.Ex13" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\|\mu-\pi_{y}\|_{2}^{2}\ \leq\ \|\mu-y\|_{2}^{2}-\|y-\pi_{y}\|_{2}^{2}\ \leq\ \|\mu-y\|_{2}^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p25.3" class="ltx_p"&gt;so every $\mu$ within $\sqrt{t}$ of $y$ is within $\sqrt{t}$ of $\pi_{y}\text{.}$ The projected balls, of the same radius and number, cover the body with internal centers, so $H^{c,\mathrm{int}}_{T}(t)\leq H^{c}_{T}(t)\text{.}$ The two entropies coincide at every radius, and $\rho^{\mathrm{int}}_{T}=\rho_{T}\text{:}$ the center convention is immaterial.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p26" class="ltx_para"&gt;
&lt;p id="S1a.p26.1" class="ltx_p"&gt;We also verify the comparison with the capped constraint of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib1" title="" class="ltx_ref"&gt;Chatterjee and Lafferty (2018)&lt;/a&gt;&lt;/cite&gt;, stated in Section 1.1. Let&lt;/p&gt;
&lt;table id="S1.Ex14" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{K}_{V}(T)\ :=\ \bigl\{\mu\in\mathcal{F}(T):\ \mu(o)\leq V\bigr\},\qquad R^{\mathrm{cap}}_{T}(V,\sigma)\ :=\ \inf_{\widehat{\mu}}\ \sup_{\mu\in\mathcal{K}_{V}(T)}\mathbb{E}_{\mu}\bigl\|\widehat{\mu}(Y)-\mu\bigr\|_{2}^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p26.2" class="ltx_p"&gt;the infimum over the same maps as in (1.3), and assume $n\geq 2\text{.}$ Since $\mathcal{F}_{V}(T)\subseteq\mathcal{K}_{V}(T)\text{,}$ every estimator has at least as large a supremum risk on the larger set, so $R^{\mathrm{cap}}_{T}\geq R^{*}_{T}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p27" class="ltx_para"&gt;
&lt;p id="S1a.p27.1" class="ltx_p"&gt;For the reverse, split $\mu$ into its root value $\mu(o)$ and its remaining coordinates $\mu_{-}\text{,}$ and write $C_{a}$ for the set of $\mu_{-}$ arising from $\mu\in\mathcal{F}_{a}(T)\text{.}$ Adding $(V-a)p_{o}$ to such a $\mu$ raises its root value to $V$ and changes no other coordinate, so $C_{a}\subseteq C_{V}$ whenever $0&amp;lt;a\leq V\text{,}$ and $C_{0}:=\{0\}\subseteq C_{V}$ as well. On the slice the root value is known, so it is estimated at no loss, while $Y_{o}$ is independent of $Y_{-}$ with a law free of $\mu_{-}$ and therefore acts as pure randomization, which cannot lower a maximum risk under squared loss; hence $R^{*}_{T}(V,\sigma)$ is exactly the minimax risk of estimating $\mu_{-}\in C_{V}$ from $Y_{-}\text{.}$ Fix $\varepsilon&amp;gt;0\text{,}$ let $\widehat{\theta}$ attain that risk to within $\varepsilon\text{,}$ and on the capped body take $\widehat{\mu}_{-}:=\widehat{\theta}(Y_{-})$ together with&lt;/p&gt;
&lt;table id="S1.Ex15" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widehat{\mu}_{o}\ :=\ \begin{cases}0,&amp;amp;V\leq\sigma,\\[2.0pt] \Pi_{[0,V]}(Y_{o}),&amp;amp;V&amp;gt;\sigma.\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p27.2" class="ltx_p"&gt;Every $\mu\in\mathcal{K}_{V}(T)$ has $\mu_{-}\in C_{\mu(o)}\subseteq C_{V}\text{,}$ so its nonroot risk is at most $R^{*}_{T}(V,\sigma)+\varepsilon\text{.}$ Its root risk is at most $\mu(o)^{2}\leq V^{2}$ in the first case, and at most $\mathbb{E}(Y_{o}-\mu(o))^{2}=\sigma^{2}$ in the second, projection onto an interval containing $\mu(o)$ being nonexpansive. Letting $\varepsilon\downarrow 0\text{,}$&lt;/p&gt;
&lt;table id="S1.Ex16" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{\mathrm{cap}}_{T}(V,\sigma)\ \leq\ R^{*}_{T}(V,\sigma)+\min\{V^{2},\sigma^{2}\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p27.3" class="ltx_p"&gt;Finally $n\geq 2$ forces $H_{T}\geq 1\text{,}$ so the two-point bound (3.8) gives&lt;/p&gt;
&lt;table id="S1.Ex17" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\min\{V^{2},\sigma^{2}\}\ \leq\ \min\{V^{2}H_{T},\ \sigma^{2}\}\ \leq\ c^{-1}R^{*}_{T}(V,\sigma):$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S1a.p27.4" class="ltx_p"&gt;fixing the root value and capping it pose the same problem up to universal constants.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1a.p28" class="ltx_para"&gt;
&lt;p id="S1a.p28.1" class="ltx_p"&gt;The comparison is constructive: the estimator of Theorem 2 transfers to the capped body. At budget $V$ its root coordinate is identically $V\text{,}$ and its nonroot coordinates depend on $Y$ only through $Y_{-}\text{:}$ every integer state has root coordinate $k\text{,}$ so the root factor cancels from the ratio (4.2), and the branch selection in (4.3) depends on $(T,V,\sigma)$ alone. Write $\widehat{\mu}^{V}_{-}(Y_{-})$ for this nonroot part. For $\mu\in\mathcal{K}_{V}(T)$ the raised signal $(V,\mu_{-})$ lies in $\mathcal{F}_{V}(T)\text{,}$ and $Y_{-}$ has the law of the nonroot data of the slice model there, so Theorem 2 bounds the risk of $\widehat{\mu}^{V}_{-}$ against $\mu_{-}$ by $C\,R^{*}_{T}(V,\sigma)\text{,}$ uniformly over $\mathcal{K}_{V}(T)\text{.}$ Paired with the root rule above, it yields a deterministic estimator, computed in $O(n^{2}\log(n+1))$ arithmetic operations, whose risk on the capped body is at most $C\bigl(R^{*}_{T}(V,\sigma)+\min\{V^{2},\sigma^{2}\}\bigr)\leq C^{\prime}\,R^{\mathrm{cap}}_{T}(V,\sigma)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S2a" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="the-coded-cover-1"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;S.2 &lt;/span&gt;The Coded Cover&lt;/h2&gt;
&lt;div id="S2a.p1" class="ltx_para"&gt;
&lt;p id="S2a.p1.1" class="ltx_p"&gt;This section completes the proof of Proposition 3.1. The main text gives the mechanism behind each stage. To make this section self-contained, we restate the objects below and supply the estimates and accounting: the floor on the working scale and the sizes of the nets, the structure of the cells, the disjointness and charge accounting of the heavy hierarchy, the collapse and exit estimates, the edge count of the skeleton together with the explicit constants of the error assembly, and the counting bound for the coded cover.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p2" class="ltx_para"&gt;
&lt;p id="S2a.p2.1" class="ltx_p"&gt;Throughout, $k$ is an integer with $2\leq k\leq n/C_{\star}$ and, as in Section 3.1, $\bar{\alpha}:=k\overline{\delta}_{k}(T)\text{;}$ the level weights are $m_{j}=2^{j}$ for $0\leq j\leq J\text{,}$ with $m_{J}$ the largest power of two strictly below $k\text{;}$ $S_{j}$ is the minimum ancestor $\lfloor\bar{\alpha}/m_{j}\rfloor$-net computed by the greedy of &lt;a href="#S1.Thmlemma1" title="Lemma S.1.1. ‣ S.1 The Profile Toolkit ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.1.1&lt;/span&gt;&lt;/a&gt;; and $R_{j}:=S_{0}\cup\dots\cup S_{j}\text{.}$ The net hierarchy, the active support and the activation charges below therefore depend on $(T,k)$ alone, the signal entering only through the stopped refinement of the construction. The active support, the first-appearance weight, and the activation charge are&lt;/p&gt;
&lt;table id="S2.Ex1a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$A_{k}:=R_{J},\qquad\omega(v):=\min\{m_{j}:\ v\in R_{j}\},\qquad\widetilde{\omega}(v):=\omega(v)\,\mathbf{1}\{v\notin R_{0}\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2a.p2.2" class="ltx_p"&gt;and the code length of an integer vector $z$ supported on $A_{k}$ is&lt;/p&gt;
&lt;table id="S2.Ex2a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Gamma(z)\ :=\ \sum_{v\in A_{k}}\Bigl(|z_{v}|+\widetilde{\omega}(v)\,\mathbf{1}\{z_{v}\neq 0\}\Bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2a.p2.3" class="ltx_p"&gt;the display (3.1). Throughout, $e_{v}$ denotes the coordinate vector at $v\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p3" class="ltx_para"&gt;
&lt;p id="S2a.p3.1" class="ltx_p"&gt;The first lemma contains the size facts quoted when the nets are introduced: the working scale is never degenerate, and the profile itself caps the size of every net.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmlemma1a" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmlemma1a.2" class="ltx_text ltx_font_bold"&gt;Lemma S.2.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmlemma1a.3" class="ltx_text ltx_font_bold"&gt; (Scale floor and net sizes).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmlemma1a.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmlemma1a.p1.1" class="ltx_p"&gt;&lt;span id="S2.Thmlemma1a.p1.1.1" class="ltx_text ltx_font_italic"&gt;For every integer $2\leq k\leq n/C_{\star}\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;ol id="S2.I1a" class="ltx_enumerate"&gt;
&lt;li id="S2.I1.i1a" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;1.&lt;/span&gt;
&lt;div id="S2.I1.i1a.p1" class="ltx_para"&gt;
&lt;p id="S2.I1.i1a.p1.1" class="ltx_p"&gt;$\bar{\alpha}\geq\alpha_{k}(T)\geq 2$&lt;span id="S2.I1.i1a.p1.1.1" class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S2.I1.i2a" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;2.&lt;/span&gt;
&lt;div id="S2.I1.i2a.p1" class="ltx_para"&gt;
&lt;p id="S2.I1.i2a.p1.1" class="ltx_p"&gt;$N^{\uparrow}_{T}(\lfloor\bar{\alpha}/m_{j}\rfloor)\leq ke^{m_{j}}$&lt;span id="S2.I1.i2a.p1.1.1" class="ltx_text ltx_font_italic"&gt; for every
&lt;/span&gt;$0\leq j\leq J$&lt;span id="S2.I1.i2a.p1.1.2" class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S2.I1.i3a" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;3.&lt;/span&gt;
&lt;div id="S2.I1.i3a.p1" class="ltx_para"&gt;
&lt;p id="S2.I1.i3a.p1.1" class="ltx_p"&gt;$|R_{j}|\leq 2ke^{m_{j}}$&lt;span id="S2.I1.i3a.p1.1.1" class="ltx_text ltx_font_italic"&gt; for every &lt;/span&gt;$0\leq j\leq J$&lt;span id="S2.I1.i3a.p1.1.2" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2a.p4" class="ltx_para"&gt;
&lt;p id="S2a.p4.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p5" class="ltx_para"&gt;
&lt;p id="S2a.p5.1" class="ltx_p"&gt;&lt;em id="S2a.p5.1.1" class="ltx_emph ltx_font_italic"&gt;Part (1).&lt;/em&gt; The surrogate dominates the profile, $\overline{\delta}_{k}\geq\delta_{k}$ by Lemma 2.3, so $\bar{\alpha}=k\overline{\delta}_{k}\geq k\delta_{k}=\alpha_{k}(T)\text{.}$ For the floor, tree distances are integers, so at radii $0&amp;lt;r&amp;lt;1$ every vertex is its own only ancestor within distance $r\text{;}$ every ancestor $r$-net then contains all of $\mathsf{V}\text{,}$ and $N^{\uparrow}_{T}(r)=n\text{.}$ Hence&lt;/p&gt;
&lt;table id="S2.Ex3a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\alpha_{k}(T)\ \geq\ \sup_{0&amp;lt;r&amp;lt;1}\ r\,\min\Bigl\{k,\ \Bigl[\log\frac{n}{k}\Bigr]_{+}\Bigr\}\ =\ \min\Bigl\{k,\ \Bigl[\log\frac{n}{k}\Bigr]_{+}\Bigr\}\ \geq\ \min\{2,\ \log C_{\star}\}\ =\ 2,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2a.p5.2" class="ltx_p"&gt;using $k\geq 2$ and $n/k\geq C_{\star}=e^{2}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p6" class="ltx_para"&gt;
&lt;p id="S2a.p6.1" class="ltx_p"&gt;&lt;em id="S2a.p6.1.1" class="ltx_emph ltx_font_italic"&gt;Part (2).&lt;/em&gt; Fix $0\leq j\leq J$ and suppose $N^{\uparrow}_{T}(\lfloor\bar{\alpha}/m_{j}\rfloor)&amp;gt;ke^{m_{j}}\text{.}$ The radius $r:=\bar{\alpha}/m_{j}$ is positive by part (&lt;a href="#S2.I1.i1a" title="Item 1 ‣ Lemma S.2.1 (Scale floor and net sizes). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;), and the covering constraint depends on $r$ only through $\lfloor r\rfloor\text{,}$ so $N^{\uparrow}_{T}(r)=N^{\uparrow}_{T}(\lfloor r\rfloor)&amp;gt;ke^{m_{j}}\text{,}$ that is, $[\log(N^{\uparrow}_{T}(r)/k)]_{+}&amp;gt;m_{j}\text{.}$ Since also $m_{j}\leq m_{J}&amp;lt;k\text{,}$ the minimum of $k$ and this positive part exceeds $m_{j}\text{,}$ and the term of (1.4) at $r$ satisfies&lt;/p&gt;
&lt;table id="S2.Ex4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$r\,\min\Bigl\{k,\ \Bigl[\log\frac{N^{\uparrow}_{T}(r)}{k}\Bigr]_{+}\Bigr\}\ &amp;gt;\ \frac{\bar{\alpha}}{m_{j}}\cdot m_{j}\ =\ \bar{\alpha}\ \geq\ \alpha_{k}(T),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2a.p6.2" class="ltx_p"&gt;contradicting that $\alpha_{k}(T)$ is the supremum of these terms.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p7" class="ltx_para"&gt;
&lt;p id="S2a.p7.1" class="ltx_p"&gt;&lt;em id="S2a.p7.1.1" class="ltx_emph ltx_font_italic"&gt;Part (3).&lt;/em&gt; The sets $S_{i}$ are minimum nets, so $|S_{i}|=N^{\uparrow}_{T}(\lfloor\bar{\alpha}/m_{i}\rfloor)\leq ke^{m_{i}}$ by part (&lt;a href="#S2.I1.i2a" title="Item 2 ‣ Lemma S.2.1 (Scale floor and net sizes). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;), and $|R_{j}|\leq k\sum_{i\leq j}e^{m_{i}}\text{.}$ For $j\geq 1$ the sum has $j$ terms before the last, each at most $e^{m_{j-1}}\text{,}$ and $j\leq e^{2^{j-1}}$ gives $je^{m_{j-1}}\leq e^{m_{j-1}+2^{j-1}}=e^{m_{j}}\text{,}$ so $\sum_{i\leq j}e^{m_{i}}\leq 2e^{m_{j}}\text{;}$ for $j=0$ this is immediate.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p8" class="ltx_para"&gt;
&lt;p id="S2a.p8.1" class="ltx_p"&gt;The cells inherit their structure from the nesting of the nets alone. Parts (2)–(4) below are the rooted-connectedness, refinement, and radius properties quoted in the main body; part (3) also identifies the parent of each cell, the hierarchy used from here on.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmlemma2a" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmlemma2a.2" class="ltx_text ltx_font_bold"&gt;Lemma S.2.2&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmlemma2a.3" class="ltx_text ltx_font_bold"&gt; (Cell structure).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmlemma2a.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmlemma2a.p1.1" class="ltx_p"&gt;&lt;span id="S2.Thmlemma2a.p1.1.1" class="ltx_text ltx_font_italic"&gt;Fix $0\leq j\leq J$ and let $a_{j}(v)$ be the deepest ancestor of $v$ in $R_{j}\text{.}$ Then:&lt;/span&gt;&lt;/p&gt;
&lt;ol id="S2.I3a" class="ltx_enumerate"&gt;
&lt;li id="S2.I3.i1a" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;1.&lt;/span&gt;
&lt;div id="S2.I3.i1a.p1" class="ltx_para"&gt;
&lt;p id="S2.I3.i1a.p1.1" class="ltx_p"&gt;&lt;span id="S2.I3.i1a.p1.1.1" class="ltx_text ltx_font_italic"&gt;the cells &lt;/span&gt;$B_{a,j}=\{v:a_{j}(v)=a\}$&lt;span id="S2.I3.i1a.p1.1.2" class="ltx_text ltx_font_italic"&gt;,
&lt;/span&gt;$a\in R_{j}$&lt;span id="S2.I3.i1a.p1.1.3" class="ltx_text ltx_font_italic"&gt;, partition &lt;/span&gt;$\mathsf{V}$&lt;span id="S2.I3.i1a.p1.1.4" class="ltx_text ltx_font_italic"&gt;, and each contains its root &lt;/span&gt;$a$&lt;span id="S2.I3.i1a.p1.1.5" class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S2.I3.i2a" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;2.&lt;/span&gt;
&lt;div id="S2.I3.i2a.p1" class="ltx_para"&gt;
&lt;p id="S2.I3.i2a.p1.1" class="ltx_p"&gt;&lt;span id="S2.I3.i2a.p1.1.1" class="ltx_text ltx_font_italic"&gt;if &lt;/span&gt;$v\in B_{a,j}$&lt;span id="S2.I3.i2a.p1.1.2" class="ltx_text ltx_font_italic"&gt; and &lt;/span&gt;$a\preceq z\preceq v$&lt;span id="S2.I3.i2a.p1.1.3" class="ltx_text ltx_font_italic"&gt;,
then &lt;/span&gt;$z\in B_{a,j}$&lt;span id="S2.I3.i2a.p1.1.4" class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S2.I3.i3a" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;3.&lt;/span&gt;
&lt;div id="S2.I3.i3a.p1" class="ltx_para"&gt;
&lt;p id="S2.I3.i3a.p1.1" class="ltx_p"&gt;&lt;span id="S2.I3.i3a.p1.1.1" class="ltx_text ltx_font_italic"&gt;if &lt;/span&gt;$j&amp;lt;J$&lt;span id="S2.I3.i3a.p1.1.2" class="ltx_text ltx_font_italic"&gt; and &lt;/span&gt;$a_{j+1}(u)=b$&lt;span id="S2.I3.i3a.p1.1.3" class="ltx_text ltx_font_italic"&gt;, then
&lt;/span&gt;$a_{j}(u)=a_{j}(b)$&lt;span id="S2.I3.i3a.p1.1.4" class="ltx_text ltx_font_italic"&gt;; consequently every level-&lt;/span&gt;$(j{+}1)$&lt;span id="S2.I3.i3a.p1.1.5" class="ltx_text ltx_font_italic"&gt; cell is contained
in a single level-&lt;/span&gt;$j$&lt;span id="S2.I3.i3a.p1.1.6" class="ltx_text ltx_font_italic"&gt; cell, whose root is an ancestor of its root;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S2.I3.i4" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;4.&lt;/span&gt;
&lt;div id="S2.I3.i4.p1" class="ltx_para"&gt;
&lt;p id="S2.I3.i4.p1.1" class="ltx_p"&gt;$d_{T}(a,v)\leq\lfloor\bar{\alpha}/m_{j}\rfloor$&lt;span id="S2.I3.i4.p1.1.1" class="ltx_text ltx_font_italic"&gt; for
every &lt;/span&gt;$v\in B_{a,j}$&lt;span id="S2.I3.i4.p1.1.2" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2a.p9" class="ltx_para"&gt;
&lt;p id="S2a.p9.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p10" class="ltx_para"&gt;
&lt;p id="S2a.p10.1" class="ltx_p"&gt;All four parts are read off the chain structure of ancestors and the nesting $R_{j}\subseteq R_{j+1}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p11" class="ltx_para"&gt;
&lt;p id="S2a.p11.1" class="ltx_p"&gt;&lt;em id="S2a.p11.1.1" class="ltx_emph ltx_font_italic"&gt;Part (1).&lt;/em&gt; The root lies in every ancestor net, being its own only ancestor, so every vertex has an ancestor in $R_{j}\text{;}$ the ancestors of $v$ form a chain, so among them the elements of $R_{j}$ have a unique deepest member, and $a_{j}(v)$ is well defined. The fibers of $v\mapsto a_{j}(v)$ partition $\mathsf{V}\text{,}$ and $a_{j}(a)=a$ for $a\in R_{j}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p12" class="ltx_para"&gt;
&lt;p id="S2a.p12.1" class="ltx_p"&gt;&lt;em id="S2a.p12.1.1" class="ltx_emph ltx_font_italic"&gt;Part (2).&lt;/em&gt; Every ancestor of $z$ is an ancestor of $v\text{,}$ so every $R_{j}$-ancestor of $z$ has depth at most $\operatorname{depth}(a_{j}(v))=\operatorname{depth}(a)\text{;}$ and $a$ itself is an $R_{j}$-ancestor of $z\text{,}$ since $a\preceq z\text{.}$ Hence $a_{j}(z)=a\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p13" class="ltx_para"&gt;
&lt;p id="S2a.p13.1" class="ltx_p"&gt;&lt;em id="S2a.p13.1.1" class="ltx_emph ltx_font_italic"&gt;Part (3).&lt;/em&gt; Let $s$ be an $R_{j}$-ancestor of $u\text{.}$ Then $s\in R_{j+1}\text{,}$ so $\operatorname{depth}(s)\leq\operatorname{depth}(b)\text{;}$ and $s$ and $b$ are comparable, both being ancestors of $u\text{,}$ so $s\preceq b$ and $s$ is an $R_{j}$-ancestor of $b\text{.}$ Conversely, every $R_{j}$-ancestor of $b$ is an ancestor of $u\text{,}$ since $b\preceq u\text{.}$ The $R_{j}$-ancestors of $u$ and of $b$ therefore coincide, and $a_{j}(u)=a_{j}(b)\text{.}$ In particular $B_{b,j+1}\subseteq B_{a_{j}(b),j}\text{,}$ and $a_{j}(b)\preceq b\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p14" class="ltx_para"&gt;
&lt;p id="S2a.p14.1" class="ltx_p"&gt;&lt;em id="S2a.p14.1.1" class="ltx_emph ltx_font_italic"&gt;Part (4).&lt;/em&gt; The net property supplies $s\in R_{j}$ with $s\preceq v$ and $d_{T}(s,v)\leq\lfloor\bar{\alpha}/m_{j}\rfloor\text{.}$ The deepest $R_{j}$-ancestor $a=a_{j}(v)$ has $\operatorname{depth}(a)\geq\operatorname{depth}(s)\text{,}$ so $a$ lies on the segment from $s$ to $v$ and $d_{T}(a,v)\leq d_{T}(s,v)\leq\lfloor\bar{\alpha}/m_{j}\rfloor\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p15" class="ltx_para"&gt;
&lt;p id="S2a.p15.1" class="ltx_p"&gt;The remaining facts concern the stopped refinement that the proof of Proposition 3.1 runs for a fixed signal. Fix $f=\sum_{u}\lambda_{u}p_{u}$ with $\lambda_{u}\geq 0$ and $\sum_{u}\lambda_{u}=1\text{,}$ write $\lambda(B):=\sum_{u\in B}\lambda_{u}\text{,}$ write $m(B):=m_{j}$ for the &lt;em id="S2a.p15.1.1" class="ltx_emph ltx_font_italic"&gt;level weight&lt;/em&gt; of a level-$j$ cell $B\text{,}$ and call $B$ heavy when $\lambda(B)&amp;gt;m(B)/k$ and light otherwise. The refinement begins at level $0\text{,}$ refines every heavy cell into its level-$(j{+}1)$ subcells, stops at every light cell, and stops everything at level $J\text{.}$ The cells at which it stops are the &lt;em id="S2a.p15.1.2" class="ltx_emph ltx_font_italic"&gt;terminal&lt;/em&gt; cells. They partition $\mathsf{V}$ because the cells of one level do and each refinement step replaces a cell by a partition of it (&lt;a href="#S2.Thmlemma2a" title="Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I3.i1a" title="Item 1 ‣ Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;),(&lt;a href="#S2.I3.i3a" title="Item 3 ‣ Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;)), and $\mathcal{L}$ denotes their collection. For $L\in\mathcal{L}$ we write $a_{L}$ for its root and $\lambda_{L}:=\lambda(L)\text{.}$ As in the main proof, $U$ consists of $R_{0}$ together with the roots of all heavy cells; a heavy cell is &lt;em id="S2a.p15.1.3" class="ltx_emph ltx_font_italic"&gt;maximal&lt;/em&gt; when no heavy cell lies strictly below it in the hierarchy of &lt;a href="#S2.Thmlemma2a" title="Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I3.i3a" title="Item 3 ‣ Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmlemma3a" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmlemma3a.2" class="ltx_text ltx_font_bold"&gt;Lemma S.2.3&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmlemma3a.3" class="ltx_text ltx_font_bold"&gt; (The heavy structure).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmlemma3a.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmlemma3a.p1.1" class="ltx_p"&gt;&lt;span id="S2.Thmlemma3a.p1.1.1" class="ltx_text ltx_font_italic"&gt;In this setting:&lt;/span&gt;&lt;/p&gt;
&lt;ol id="S2.I5" class="ltx_enumerate"&gt;
&lt;li id="S2.I5.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;1.&lt;/span&gt;
&lt;div id="S2.I5.i1.p1" class="ltx_para"&gt;
&lt;p id="S2.I5.i1.p1.1" class="ltx_p"&gt;&lt;span id="S2.I5.i1.p1.1.1" class="ltx_text ltx_font_italic"&gt;distinct maximal heavy cells have disjoint
underlying vertex sets;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S2.I5.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;2.&lt;/span&gt;
&lt;div id="S2.I5.i2.p1" class="ltx_para"&gt;
&lt;p id="S2.I5.i2.p1.1" class="ltx_p"&gt;&lt;span id="S2.I5.i2.p1.1.1" class="ltx_text ltx_font_italic"&gt;the minimal rooted subtree &lt;/span&gt;$S$&lt;span id="S2.I5.i2.p1.1.2" class="ltx_text ltx_font_italic"&gt; spanning &lt;/span&gt;$U$&lt;span id="S2.I5.i2.p1.1.3" class="ltx_text ltx_font_italic"&gt;
has at most &lt;/span&gt;$5\bar{\alpha}k$&lt;span id="S2.I5.i2.p1.1.4" class="ltx_text ltx_font_italic"&gt; edges;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S2.I5.i3" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;3.&lt;/span&gt;
&lt;div id="S2.I5.i3.p1" class="ltx_para"&gt;
&lt;p id="S2.I5.i3.p1.1" class="ltx_p"&gt;$\sum_{v\in U\setminus R_{0}}\widetilde{\omega}(v)&amp;lt;2k$&lt;span id="S2.I5.i3.p1.1.1" class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S2.I5.i4" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;4.&lt;/span&gt;
&lt;div id="S2.I5.i4.p1" class="ltx_para"&gt;
&lt;p id="S2.I5.i4.p1.1" class="ltx_p"&gt;$\sum_{C\ \text{maximal heavy}}m(C)&amp;lt;k$&lt;span id="S2.I5.i4.p1.1.1" class="ltx_text ltx_font_italic"&gt;, which is the display (3.3) of
the main paper.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2a.p16" class="ltx_para"&gt;
&lt;p id="S2a.p16.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p17" class="ltx_para"&gt;
&lt;p id="S2a.p17.1" class="ltx_p"&gt;Part (&lt;a href="#S2.I5.i1" title="Item 1 ‣ Lemma S.2.3 (The heavy structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;) is a chain argument in the hierarchy, and part (&lt;a href="#S2.I5.i4" title="Item 4 ‣ Lemma S.2.3 (The heavy structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;) follows from it; part (&lt;a href="#S2.I5.i2" title="Item 2 ‣ Lemma S.2.3 (The heavy structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;) charges the skeleton to vertical segments along the nets; part (&lt;a href="#S2.I5.i3" title="Item 3 ‣ Lemma S.2.3 (The heavy structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;) charges activation weights to maximal heavy cells.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p18" class="ltx_para"&gt;
&lt;p id="S2a.p18.1" class="ltx_p"&gt;&lt;em id="S2a.p18.1.1" class="ltx_emph ltx_font_italic"&gt;Parts (1) and (4).&lt;/em&gt; Suppose two distinct heavy cells $(B,i)$ and $(B^{\prime},j)$ with $i\leq j$ have intersecting underlying sets. Cells at one level partition $\mathsf{V}\text{,}$ so $i&amp;lt;j\text{.}$ Iterating &lt;a href="#S2.Thmlemma2a" title="Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I3.i3a" title="Item 3 ‣ Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;), $B^{\prime}$ is contained in a unique cell of each level below $j\text{;}$ its level-$i$ cell meets $B\text{,}$ hence equals $B\text{,}$ and the chain of cells containing $B^{\prime}$ at levels $i,\dots,j$ ascends from $(B^{\prime},j)$ to $(B,i)$ in the hierarchy. Each cell of this chain, at level $\ell$ say, has mass at least $\lambda(B^{\prime})&amp;gt;m_{j}/k\geq m_{\ell}/k$ and is therefore heavy. In particular the chain member at level $i{+}1$ is a heavy cell strictly below $(B,i)\text{,}$ so $(B,i)$ is not maximal. Distinct maximal heavy cells therefore cannot intersect. Each carries mass exceeding $m(C)/k\text{,}$ and their supports being disjoint, their masses total at most $\lambda(\mathsf{V})=1\text{,}$ so&lt;/p&gt;
&lt;table id="S2.Ex5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{C\ \text{maximal heavy}}m(C)\ &amp;lt;\ k,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2a.p18.2" class="ltx_p"&gt;which is part (&lt;a href="#S2.I5.i4" title="Item 4 ‣ Lemma S.2.3 (The heavy structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;); the empty family satisfies it trivially.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p19" class="ltx_para"&gt;
&lt;p id="S2a.p19.1" class="ltx_p"&gt;&lt;em id="S2a.p19.1.1" class="ltx_emph ltx_font_italic"&gt;Part (2).&lt;/em&gt; The subtree $S$ lies in the union of two families of vertical segments, whose total length we bound.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p20" class="ltx_para"&gt;
&lt;p id="S2a.p20.1" class="ltx_p"&gt;First, connect $R_{0}$ to the root. For $a\in R_{0}\setminus\{o\}\text{,}$ the net property of $R_{0}$ at the parent of $a$ supplies $s\in R_{0}$ with $s\preceq\operatorname{pa}(a)$ and $d_{T}(s,\operatorname{pa}(a))\leq\lfloor\bar{\alpha}\rfloor\text{;}$ the deepest strict $R_{0}$-ancestor $\bar{a}$ of $a$ then lies on the segment from $s$ to $a\text{,}$ so&lt;/p&gt;
&lt;table id="S2.Ex6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{T}(\bar{a},a)\ \leq\ d_{T}(s,a)\ \leq\ \bar{\alpha}+1\ \leq\ \tfrac{3}{2}\,\bar{\alpha},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2a.p20.2" class="ltx_p"&gt;by &lt;a href="#S2.Thmlemma1a" title="Lemma S.2.1 (Scale floor and net sizes). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.1&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I1.i1a" title="Item 1 ‣ Lemma S.2.1 (Scale floor and net sizes). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;). Iterating $a\mapsto\bar{a}$ from any element of $R_{0}$ reaches the root, which belongs to every ancestor net, so the segments $[\bar{a},a]\text{,}$ $a\in R_{0}\setminus\{o\}\text{,}$ connect $R_{0}$ to $o\text{;}$ by &lt;a href="#S2.Thmlemma1a" title="Lemma S.2.1 (Scale floor and net sizes). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.1&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I1.i2a" title="Item 2 ‣ Lemma S.2.1 (Scale floor and net sizes). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;) their total length is at most $\tfrac{3}{2}\bar{\alpha}\,|R_{0}|\leq\tfrac{3}{2}e\,\bar{\alpha}k\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p21" class="ltx_para"&gt;
&lt;p id="S2a.p21.1" class="ltx_p"&gt;Second, connect the heavy roots to $R_{0}\text{.}$ The root $b$ of a heavy cell $B$ at level $j\geq 1$ lies in its parent cell, whose root $a_{j-1}(b)$ is an ancestor of $b$ within distance $\lfloor\bar{\alpha}/m_{j-1}\rfloor\leq 2\bar{\alpha}/m_{j}$ (&lt;a href="#S2.Thmlemma2a" title="Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I3.i3a" title="Item 3 ‣ Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;)–(&lt;a href="#S2.I3.i4" title="Item 4 ‣ Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;)); and the parent cell is heavy as well, its mass being at least $\lambda(B)&amp;gt;m_{j}/k&amp;gt;m_{j-1}/k\text{.}$ Iterating these segments joins every heavy root to the root of a level-$0$ cell, which lies in $R_{0}\text{.}$ At level $j$ the heavy cells are disjoint and each has mass exceeding $m_{j}/k\text{,}$ so there are fewer than $k/m_{j}$ of them, and the segments they contribute have total length less than&lt;/p&gt;
&lt;table id="S2.Ex7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{j\geq 1}\frac{k}{m_{j}}\cdot\frac{2\bar{\alpha}}{m_{j}}\ =\ 2\bar{\alpha}k\sum_{j\geq 1}4^{-j}\ =\ \tfrac{2}{3}\,\bar{\alpha}k.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2a.p21.2" class="ltx_p"&gt;Every member of $U$ is thus connected to the root inside the union of the two families, so $S$ is contained in that union and $|E(S)|\leq\tfrac{3}{2}e\,\bar{\alpha}k+\tfrac{2}{3}\,\bar{\alpha}k\leq 5\bar{\alpha}k\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p22" class="ltx_para"&gt;
&lt;p id="S2a.p22.1" class="ltx_p"&gt;&lt;em id="S2a.p22.1.1" class="ltx_emph ltx_font_italic"&gt;Part (3).&lt;/em&gt; The set $U\setminus R_{0}$ consists of roots of heavy cells at levels $j\geq 1\text{.}$ Charge each $v\in U\setminus R_{0}$ to a heavy cell rooted at $v$ of minimal level $j(v)\geq 1\text{;}$ roots of level-$j$ cells lie in $R_{j}\text{,}$ so $\widetilde{\omega}(v)=\omega(v)\leq m_{j(v)}\text{,}$ and the charging is injective into the set $\mathcal{H}$ of heavy cells. Hence&lt;/p&gt;
&lt;table id="S2.Ex8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{v\in U\setminus R_{0}}\widetilde{\omega}(v)\ \leq\ \sum_{(B,j)\in\mathcal{H}}m_{j}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2a.p22.2" class="ltx_p"&gt;Assign every heavy cell to one maximal heavy cell weakly below it in the hierarchy, obtained by descending to heavy children while one exists. The cells assigned to a fixed maximal cell $(C,\ell)$ all lie on its ancestor chain, so their level weights total at most $m_{0}+m_{1}+\dots+m_{\ell}&amp;lt;2m_{\ell}\text{,}$ and&lt;/p&gt;
&lt;table id="S2.Ex9" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{(B,j)\in\mathcal{H}}m_{j}\ \leq\ 2\sum_{C\ \text{maximal heavy}}m(C)\ &amp;lt;\ 2k,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2a.p22.3" class="ltx_p"&gt;the last step by part (&lt;a href="#S2.I5.i4" title="Item 4 ‣ Lemma S.2.3 (The heavy structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;), which also covers the case of an empty family.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p23" class="ltx_para"&gt;
&lt;p id="S2a.p23.1" class="ltx_p"&gt;The construction of the main proof samples the light exits at random. The next lemma supplies the collapse bound quoted there, the exit estimates behind the fixed realization, and the budgets that realization carries. Its objects are the following.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p24" class="ltx_para"&gt;
&lt;p id="S2a.p24.1" class="ltx_p"&gt;Collapsing every terminal cell to its root gives $g:=\sum_{L\in\mathcal{L}}\lambda_{L}p_{a_{L}}\text{.}$ A heavy terminal cell is one the refinement did not split, so it sits at level $J$ and no heavy cell lies below it; being maximal it contributes $m_{J}\geq k/2$ to the sum in &lt;a href="#S2.Thmlemma3a" title="Lemma S.2.3 (The heavy structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.3&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I5.i4" title="Item 4 ‣ Lemma S.2.3 (The heavy structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;), and there is therefore at most one. Each terminal cell $L$ is attached to $U$ at $h(L):=a_{L}$ when $L$ is a level-$0$ cell or the heavy terminal one, and otherwise at the root of the parent cell of $L\text{,}$ which is heavy because $L$ was reached by the refinement; either way $h(L)\in U\text{,}$ and $h(L)\preceq a_{L}$ by &lt;a href="#S2.Thmlemma2a" title="Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I3.i3a" title="Item 3 ‣ Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;). Put $q_{L}:=p_{a_{L}}-p_{h(L)}\text{.}$ In the first two cases $q_{L}=0\text{;}$ otherwise, $L$ sits at a level $j\geq 1\text{,}$ and its parent cell has level weight $m_{j}/2=m(L)/2$ and contains $a_{L}\text{,}$ so &lt;a href="#S2.Thmlemma2a" title="Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I3.i4" title="Item 4 ‣ Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;) and Lemma 2.2(1) give&lt;/p&gt;
&lt;table id="S2.E1a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\|q_{L}\|_{2}^{2}\ =\ d_{T}\bigl(h(L),a_{L}\bigr)\ \leq\ \Bigl\lfloor\frac{2\bar{\alpha}}{m(L)}\Bigr\rfloor\ \leq\ \frac{2\bar{\alpha}}{m(L)}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.2.1)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2a.p24.2" class="ltx_p"&gt;With $b_{h}:=\sum_{L:\,h(L)=h}\lambda_{L}$ this splits the collapsed signal as $g=g_{0}+\sum_{L}\lambda_{L}q_{L}\text{,}$ where $g_{0}:=\sum_{h\in U}b_{h}p_{h}$ is the &lt;em id="S2a.p24.2.1" class="ltx_emph ltx_font_italic"&gt;skeleton&lt;/em&gt; and the nonzero $q_{L}$ are the &lt;em id="S2a.p24.2.2" class="ltx_emph ltx_font_italic"&gt;light exits&lt;/em&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p25" class="ltx_para"&gt;
&lt;p id="S2a.p25.1" class="ltx_p"&gt;The skeleton is rounded through one scalar. List $U$ as $h_{1},\dots,h_{s}$ in a fixed depth-first preorder of $T\text{,}$ write $b_{i}:=b_{h_{i}}$ for the masses in that order, set $B_{i}:=\sum_{\ell\leq i}b_{\ell}$ with $B_{0}:=0\text{,}$ and put $Q_{i}:=\lfloor kB_{i}\rfloor-\lfloor kB_{i-1}\rfloor\in\mathbb{Z}_{\geq 0}\text{.}$ Let $Q$ be the integer vector with $Q_{h_{i}}:=Q_{i}$ and $Q_{v}:=0$ for $v\notin U\text{,}$ and set $\bar{g}_{0}:=\frac{1}{k}\sum_{h\in U}Q_{h}p_{h}\text{.}$ Over an interval of the list the $Q_{i}$ telescope, so their sum differs from $k$ times the corresponding mass by a difference of two floor errors, hence by less than $1\text{.}$ The terminal cells partition $\mathsf{V}\text{,}$ so $B_{s}=\sum_{L}\lambda_{L}=1$ and the whole list gives $\sum_{i}Q_{i}=\lfloor kB_{s}\rfloor=k\text{;}$ as the $B_{i}$ increase, $Q$ is a nonnegative integer leak vector of total mass $k$ supported on $U\text{.}$ Every subtree $T_{v}$ is a contiguous block of a depth-first preorder, so $U\cap T_{v}$ is such an interval, and coordinates are subtree sums by Lemma 2.1; therefore $g_{0}$ and $\bar{g}_{0}$ differ by less than $1/k$ at every vertex simultaneously.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p26" class="ltx_para"&gt;
&lt;p id="S2a.p26.1" class="ltx_p"&gt;Finally, write $\mathcal{L}_{\mathrm{ex}}:=\{L\in\mathcal{L}:q_{L}\neq 0\}$ for the light exits, every member of which is a light cell and therefore has $\lambda_{L}\leq m(L)/k\text{.}$ They are quantized by the independent variables $Z_{L}=\frac{m(L)}{k}\xi_{L}\text{,}$ $L\in\mathcal{L}_{\mathrm{ex}}\text{,}$ with $\xi_{L}\sim\mathrm{Bernoulli}(k\lambda_{L}/m(L))\text{,}$ which is a legitimate parameter by that bound. With the selection weight $W:=\sum_{L\in\mathcal{L}_{\mathrm{ex}}}m(L)\mathbf{1}\{Z_{L}\neq 0\}\text{,}$ the integer vector is&lt;/p&gt;
&lt;table id="S2.Ex10" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$z\ =\ Q+\sum_{L\in\mathcal{L}_{\mathrm{ex}}:\,Z_{L}\neq 0}m(L)\bigl(e_{a_{L}}-e_{h(L)}\bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2a.p26.2" class="ltx_p"&gt;and the &lt;em id="S2a.p26.2.1" class="ltx_emph ltx_font_italic"&gt;flow states&lt;/em&gt; of an integer vector $z$ are the subtree sums $x_{v}:=\sum_{u\succeq v}z_{u}\text{,}$ that is, the coordinates of $\sum_{u}z_{u}p_{u}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmlemma4" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmlemma4.2" class="ltx_text ltx_font_bold"&gt;Lemma S.2.4&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmlemma4.3" class="ltx_text ltx_font_bold"&gt; (Collapse and exit estimates).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmlemma4.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmlemma4.p1.1" class="ltx_p"&gt;&lt;span id="S2.Thmlemma4.p1.1.1" class="ltx_text ltx_font_italic"&gt;In this setting:&lt;/span&gt;&lt;/p&gt;
&lt;ol id="S2.I7" class="ltx_enumerate"&gt;
&lt;li id="S2.I7.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;1.&lt;/span&gt;
&lt;div id="S2.I7.i1.p1" class="ltx_para"&gt;
&lt;p id="S2.I7.i1.p1.1" class="ltx_p"&gt;$\|f-g\|_{2}^{2}\leq 3\bar{\alpha}/k$&lt;span id="S2.I7.i1.p1.1.1" class="ltx_text ltx_font_italic"&gt;, the display
(3.4);&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S2.I7.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;2.&lt;/span&gt;
&lt;div id="S2.I7.i2.p1" class="ltx_para"&gt;
&lt;p id="S2.I7.i2.p1.1" class="ltx_p"&gt;&lt;span id="S2.I7.i2.p1.1.1" class="ltx_text ltx_font_italic"&gt;writing &lt;/span&gt;$\Sigma$&lt;span id="S2.I7.i2.p1.1.2" class="ltx_text ltx_font_italic"&gt; for the sum
&lt;/span&gt;$\sum_{L\in\mathcal{L}_{\mathrm{ex}}}(Z_{L}-\lambda_{L})q_{L}$&lt;span id="S2.I7.i2.p1.1.3" class="ltx_text ltx_font_italic"&gt;, one has
&lt;/span&gt;$\mathbb{E}\|\Sigma\|_{2}^{2}\leq 2\bar{\alpha}/k$&lt;span id="S2.I7.i2.p1.1.4" class="ltx_text ltx_font_italic"&gt; and
&lt;/span&gt;$\mathbb{E}W\leq k$&lt;span id="S2.I7.i2.p1.1.5" class="ltx_text ltx_font_italic"&gt;, so with probability at least &lt;/span&gt;$\tfrac{1}{4}$&lt;span id="S2.I7.i2.p1.1.6" class="ltx_text ltx_font_italic"&gt; both &lt;/span&gt;$W\leq 2k$&lt;span id="S2.I7.i2.p1.1.7" class="ltx_text ltx_font_italic"&gt;
and &lt;/span&gt;$\|\Sigma\|_{2}^{2}\leq 8\bar{\alpha}/k$&lt;span id="S2.I7.i2.p1.1.8" class="ltx_text ltx_font_italic"&gt; hold;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S2.I7.i3" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;3.&lt;/span&gt;
&lt;div id="S2.I7.i3.p1" class="ltx_para"&gt;
&lt;p id="S2.I7.i3.p1.1" class="ltx_p"&gt;&lt;span id="S2.I7.i3.p1.1.1" class="ltx_text ltx_font_italic"&gt;on such a realization &lt;/span&gt;$z$&lt;span id="S2.I7.i3.p1.1.2" class="ltx_text ltx_font_italic"&gt; is supported on
&lt;/span&gt;$A_{k}$&lt;span id="S2.I7.i3.p1.1.3" class="ltx_text ltx_font_italic"&gt; and satisfies &lt;/span&gt;$\|z\|_{1}\leq 5k$&lt;span id="S2.I7.i3.p1.1.4" class="ltx_text ltx_font_italic"&gt;, and its selected exit roots carry
total activation charge at most &lt;/span&gt;$W$&lt;span id="S2.I7.i3.p1.1.5" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2a.p27" class="ltx_para"&gt;
&lt;p id="S2a.p27.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p28" class="ltx_para"&gt;
&lt;p id="S2a.p28.1" class="ltx_p"&gt;&lt;em id="S2a.p28.1.1" class="ltx_emph ltx_font_italic"&gt;Part (1).&lt;/em&gt; The blocks $e_{L}=\sum_{u\in L}\lambda_{u}(p_{u}-p_{a_{L}})$ have pairwise disjoint supports, as recorded in the main proof, so $\|f-g\|_{2}^{2}=\sum_{L\in\mathcal{L}}\|e_{L}\|_{2}^{2}\text{.}$ Every $u\in L$ has $d_{T}(a_{L},u)\leq\bar{\alpha}/m(L)$ by &lt;a href="#S2.Thmlemma2a" title="Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I3.i4" title="Item 4 ‣ Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;), so the triangle inequality and Lemma 2.2(1) give $\|e_{L}\|_{2}\leq\sum_{u\in L}\lambda_{u}\sqrt{d_{T}(a_{L},u)}\leq\lambda_{L}\sqrt{\bar{\alpha}/m(L)}\text{.}$ A light terminal cell has $\lambda_{L}\leq m(L)/k\text{,}$ whence $\|e_{L}\|_{2}^{2}\leq\lambda_{L}^{2}\bar{\alpha}/m(L)\leq\lambda_{L}\bar{\alpha}/k\text{,}$ and summing over the light cells with $\sum_{L}\lambda_{L}\leq 1$ bounds their total contribution by $\bar{\alpha}/k\text{.}$ At most one terminal cell is heavy; it sits at level $J\text{,}$ where $m_{J}\geq k/2\text{,}$ and contributes $\|e_{L}\|_{2}^{2}\leq\lambda_{L}^{2}\bar{\alpha}/m_{J}\leq 2\bar{\alpha}/k\text{.}$ Adding the two bounds proves (1).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p29" class="ltx_para"&gt;
&lt;p id="S2a.p29.1" class="ltx_p"&gt;&lt;em id="S2a.p29.1.1" class="ltx_emph ltx_font_italic"&gt;Part (2).&lt;/em&gt; Each $Z_{L}$ has mean $\lambda_{L}$ and&lt;/p&gt;
&lt;table id="S2.Ex11" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\operatorname{Var}(Z_{L})\ \leq\ \Bigl(\frac{m(L)}{k}\Bigr)^{2}\frac{k\lambda_{L}}{m(L)}\ =\ \frac{\lambda_{L}m(L)}{k},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2a.p29.2" class="ltx_p"&gt;while $\|q_{L}\|_{2}^{2}\leq 2\bar{\alpha}/m(L)$ by &lt;a href="#S2.E1a" title="In S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.1&lt;/span&gt;&lt;/a&gt;. The $Z_{L}$ are independent, so the cross terms vanish in expectation. With every sum below running over $L\in\mathcal{L}_{\mathrm{ex}}\text{,}$&lt;/p&gt;
&lt;table id="S2.Ex12" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\Bigl\|\sum_{L}(Z_{L}-\lambda_{L})q_{L}\Bigr\|_{2}^{2}\ =\ \sum_{L}\operatorname{Var}(Z_{L})\,\|q_{L}\|_{2}^{2}\ \leq\ \frac{2\bar{\alpha}}{k}\sum_{L}\lambda_{L}\ \leq\ \frac{2\bar{\alpha}}{k}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2a.p29.3" class="ltx_p"&gt;Also $\mathbb{E}W=\sum_{L}m(L)\,k\lambda_{L}/m(L)=k\sum_{L}\lambda_{L}\leq k\text{.}$ By Markov’s inequality $\mathbb{P}(W&amp;gt;2k)\leq\tfrac{1}{2}\text{,}$ and the squared norm exceeds $8\bar{\alpha}/k$ with probability at most $\tfrac{1}{4}\text{,}$ so both bounds hold with probability at least $\tfrac{1}{4}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p30" class="ltx_para"&gt;
&lt;p id="S2a.p30.1" class="ltx_p"&gt;&lt;em id="S2a.p30.1.1" class="ltx_emph ltx_font_italic"&gt;Part (3).&lt;/em&gt; The skeleton $Q$ is supported on $U\subseteq A_{k}$ and each selected transfer on $\{a_{L},h(L)\}\text{;}$ the root of a level-$j$ cell lies in $R_{j}\subseteq A_{k}\text{,}$ so $\operatorname{supp}(z)\subseteq A_{k}\text{.}$ Since $Q$ is nonnegative with total mass $k$ and each selected transfer adds $2m(L)$ to the $\ell_{1}$ norm, $\|z\|_{1}\leq k+2W\leq 5k\text{.}$ The selected exit roots are distinct, being roots of distinct terminal cells, and $\widetilde{\omega}(a_{L})\leq\omega(a_{L})\leq m(L)$ because $a_{L}\in R_{j}$ with $m_{j}=m(L)\text{;}$ their charges therefore total at most $\sum_{L:\,Z_{L}\neq 0}m(L)=W\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p31" class="ltx_para"&gt;
&lt;p id="S2a.p31.1" class="ltx_p"&gt;Two explicit constants follow. The subtree $S$ has at most $5\bar{\alpha}k+1\leq 6\bar{\alpha}k$ vertices, by &lt;a href="#S2.Thmlemma3a" title="Lemma S.2.3 (The heavy structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.3&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I5.i2" title="Item 2 ‣ Lemma S.2.3 (The heavy structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;) and $\bar{\alpha}\geq 2\text{;}$ since $g_{0}$ and $\bar{g}_{0}$ differ by less than $1/k$ at every vertex and vanish outside $S\text{,}$ $\|g_{0}-\bar{g}_{0}\|_{2}^{2}&amp;lt;6\bar{\alpha}k/k^{2}=6\bar{\alpha}/k\text{:}$ the display (3.5) holds with $C=6\text{.}$ Together with the collapse and exit bounds of &lt;a href="#S2.Thmlemma4" title="Lemma S.2.4 (Collapse and exit estimates). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.4&lt;/span&gt;&lt;/a&gt;, the error assembly of the main proof reads&lt;/p&gt;
&lt;table id="S2.Ex13" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Bigl\|f-\frac{1}{k}\sum_{v}z_{v}p_{v}\Bigr\|_{2}^{2}\ \leq\ 3\Bigl(\frac{3\bar{\alpha}}{k}+\frac{6\bar{\alpha}}{k}+\frac{8\bar{\alpha}}{k}\Bigr)\ =\ \frac{51\,\bar{\alpha}}{k}\ =\ 51\,\overline{\delta}_{k}(T)\ \leq\ 102\,\delta_{k}(T),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S2a.p31.2" class="ltx_p"&gt;the last step by Lemma 2.3, so part (1) of Proposition 3.1 holds with $C_{0}=102\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p32" class="ltx_para"&gt;
&lt;p id="S2a.p32.1" class="ltx_p"&gt;It remains to prove the counting bound.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmlemma5" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S2.Thmlemma5.2" class="ltx_text ltx_font_bold"&gt;Lemma S.2.5&lt;/span&gt;&lt;/span&gt;&lt;span id="S2.Thmlemma5.3" class="ltx_text ltx_font_bold"&gt; (Counting bound).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S2.Thmlemma5.p1" class="ltx_para"&gt;
&lt;p id="S2.Thmlemma5.p1.1" class="ltx_p"&gt;&lt;span id="S2.Thmlemma5.p1.1.1" class="ltx_text ltx_font_italic"&gt;The integer vectors $z$ supported on $A_{k}$ with $\sum_{v}z_{v}=k\text{,}$ $\Gamma(z)\leq 9k\text{,}$ and all flow states in $[0,3k]$ number at most $e^{45k}\text{.}$ In particular part (2) of Proposition 3.1 holds with $C_{1}=45\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2a.p33" class="ltx_para"&gt;
&lt;p id="S2a.p33.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p34" class="ltx_para"&gt;
&lt;p id="S2a.p34.1" class="ltx_p"&gt;We bound the larger class defined by the support and code-length constraints alone. Each member $z$ determines its support, split into the free part $\operatorname{supp}(z)\cap R_{0}$ and the charged part $\operatorname{supp}(z)\setminus R_{0}\text{,}$ and its coefficient vector; we count the three in turn and multiply.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p35" class="ltx_para"&gt;
&lt;p id="S2a.p35.1" class="ltx_p"&gt;&lt;em id="S2a.p35.1.1" class="ltx_emph ltx_font_italic"&gt;Free parts.&lt;/em&gt; Any subset of $R_{0}$ can occur, and $|R_{0}|\leq ke^{m_{0}}=ek$ by &lt;a href="#S2.Thmlemma1a" title="Lemma S.2.1 (Scale floor and net sizes). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.1&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I1.i2a" title="Item 2 ‣ Lemma S.2.1 (Scale floor and net sizes). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;), so the free parts number at most $2^{ek}\leq e^{ek}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p36" class="ltx_para"&gt;
&lt;p id="S2a.p36.1" class="ltx_p"&gt;&lt;em id="S2a.p36.1.1" class="ltx_emph ltx_font_italic"&gt;Charged parts.&lt;/em&gt; Group the charged vertices by first appearance: $G_{j}:=\{v\in A_{k}\setminus R_{0}:\ \omega(v)=m_{j}\}$ satisfies $G_{j}\subseteq R_{j}\text{,}$ hence $|G_{j}|\leq 2ke^{m_{j}}$ by &lt;a href="#S2.Thmlemma1a" title="Lemma S.2.1 (Scale floor and net sizes). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.1&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I1.i3a" title="Item 3 ‣ Lemma S.2.1 (Scale floor and net sizes). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;), for $1\leq j\leq J\text{.}$ The groups partition $A_{k}\setminus R_{0}\text{,}$ so a charged part is the disjoint union of its intersections with them, and one with $q_{j}$ elements of $G_{j}$ carries activation charge $\sum_{j}m_{j}q_{j}\leq\Gamma(z)\leq 9k\text{.}$ Inserting the factor $e^{2(9k-\sum_{j}m_{j}q_{j})}\geq 1$ and then dropping the charge constraint,&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="S2.EGx2"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S2.Ex14"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S2.Ex15"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle\#\{\text{charged parts}\}\ \leq\ e^{18k}\prod_{j=1}^{J}\ \sum_{q\geq 0}\binom{|G_{j}|}{q}\,e^{-2m_{j}q}\space &amp;amp; \displaystyle=\ e^{18k}\prod_{j=1}^{J}\bigl(1+e^{-2m_{j}}\bigr)^{|G_{j}|} \\
&amp;amp; \displaystyle\leq\ e^{18k}\exp\Bigl(2k\sum_{j\geq 1}e^{-m_{j}}\Bigr)\ \leq\ e^{19k},
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p id="S2a.p36.2" class="ltx_p"&gt;using $\log(1+x)\leq x\text{,}$ $|G_{j}|e^{-2m_{j}}\leq 2ke^{-m_{j}}\text{,}$ and $\sum_{j\geq 1}e^{-2^{j}}&amp;lt;\tfrac{1}{6}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p37" class="ltx_para"&gt;
&lt;p id="S2a.p37.1" class="ltx_p"&gt;&lt;em id="S2a.p37.1.1" class="ltx_emph ltx_font_italic"&gt;Coefficients.&lt;/em&gt; Every charged support vertex carries charge at least $1\text{,}$ so a support has at most $ek+9k\leq 12k$ vertices. On a fixed support of size $d\text{,}$ the map $z\mapsto(z^{+},z^{-})$ is injective into the nonnegative integer vectors on $2d$ coordinates with total at most $9k\text{,}$ since $\|z\|_{1}\leq\Gamma(z)\leq 9k\text{;}$ these number $\binom{9k+2d}{2d}\leq 2^{9k+2d}\leq 2^{33k}\leq e^{23k}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p38" class="ltx_para"&gt;
&lt;p id="S2a.p38.1" class="ltx_p"&gt;Multiplying the three counts bounds the class by $e^{(e+19+23)k}\leq e^{45k}\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2a.p39" class="ltx_para"&gt;
&lt;p id="S2a.p39.1" class="ltx_p"&gt;The facts quoted in the main proof are now all in place, and Proposition 3.1 is proved.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S3a" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="the-packing-lower-bound-1"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;S.3 &lt;/span&gt;The Packing Lower Bound&lt;/h2&gt;
&lt;div id="S3a.p1" class="ltx_para"&gt;
&lt;p id="S3a.p1.1" class="ltx_p"&gt;This section completes the lower-bound half of Section 3.2. Lemmas 3.2 and 3.3, whose proofs were sketched there, are proved in full first, with the constants of the latter fixed. Two self-contained lemmas follow: the additivity of Bayes risks across coordinate-disjoint blocks, and the edge-disjoint grouping of a separated vertex set. The section then completes the proofs of Propositions 3.4 and 3.5, and finally the deferred cases of Theorem 1 and Proposition 1.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p2" class="ltx_para"&gt;
&lt;p id="S3a.p2.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof of Lemma 3.2.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p3" class="ltx_para"&gt;
&lt;p id="S3a.p3.1" class="ltx_p"&gt;Write $\mathcal{P}:=\{p_{u}:u\in\mathsf{V}\}$ and $\varepsilon:=\sqrt{r}/3\text{,}$ and fix a maximal $\varepsilon$-separated subset of $\mathcal{P}\text{;}$ by maximality, every point of $\mathcal{P}$ lies within Euclidean distance $\varepsilon$ of the subset. By Lemma 2.2(1), the vertices indexing the subset have pairwise tree distances at least $\varepsilon^{2}=r/9\text{,}$ so it suffices to bound their number below by $N^{\uparrow}_{T}(r)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p4" class="ltx_para"&gt;
&lt;p id="S3a.p4.1" class="ltx_p"&gt;Consider the ball of radius $\varepsilon$ around one point of the subset, let $C$ be the set of vertices whose indicators it contains, and let $a$ be the deepest common ancestor of $C\text{.}$ Fix $u\in C$ with $u\neq a$ and let $c$ be the child of $a$ on the path toward $u\text{.}$ Not all of $C$ lies in the subtree $T_{c}\text{,}$ since $c$ would then be a common ancestor of $C$ deeper than $a\text{;}$ fix $v\in C\setminus T_{c}\text{.}$ The meet $u\wedge v$ is at least as deep as $a\text{,}$ the latter being a common ancestor of $u$ and $v\text{;}$ and it is not deeper, since an ancestor of $u$ strictly below $a$ lies in $T_{c}\text{,}$ and $u\wedge v\in T_{c}$ would force $v\in T_{c}\text{.}$ Hence $u\wedge v=a\text{,}$ so the path from $u$ to $v$ passes through $a\text{,}$ and by Lemma 2.2(1),&lt;/p&gt;
&lt;table id="S3.Ex1a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{T}(a,u)\ \leq\ d_{T}(u,v)\ =\ \|p_{u}-p_{v}\|_{2}^{2}\ \leq\ (2\varepsilon)^{2}\ =\ \tfrac{4}{9}\,r\ &amp;lt;\ r,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p4.2" class="ltx_p"&gt;the indicators $p_{u}$ and $p_{v}$ lying in one ball of radius $\varepsilon\text{.}$ The bound holds trivially at $u=a\text{,}$ so $a$ ancestor-covers every vertex of $C$ within distance $r\text{.}$ Every vertex of $T$ lies in the captured set of some ball, so collecting one such ancestor per ball yields an ancestor $r$-net, of size at most the number of balls; the number of balls is the size of the separated subset, and every ancestor $r$-net has at least $N^{\uparrow}_{T}(r)$ elements, which proves the bound.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p5" class="ltx_para"&gt;
&lt;p id="S3a.p5.1" class="ltx_p"&gt;Two facts about Gaussian shifts are used without further comment &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib36" title="" class="ltx_ref"&gt;Tsybakov, 2009&lt;/a&gt;)&lt;/cite&gt;. The Kullback–Leibler divergence between $N(\theta,\sigma^{2}I_{N})$ and $N(\theta^{\prime},\sigma^{2}I_{N})$ is $\|\theta-\theta^{\prime}\|_{2}^{2}/(2\sigma^{2})\text{.}$ Fano’s inequality in its pairwise form states that if a label is uniform on $M\geq 2$ hypotheses whose data laws satisfy $\max_{i,j}\operatorname{KL}(P_{i},P_{j})\leq\kappa\text{,}$ then every decoder based on the data errs with probability at least $1-(\kappa+\log 2)/\log M\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p6" class="ltx_para"&gt;
&lt;p id="S3a.p6.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof of Lemma 3.3.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p7" class="ltx_para"&gt;
&lt;p id="S3a.p7.1" class="ltx_p"&gt;Fix $\eta:=\tfrac{1}{10}\text{,}$ the constant of the main-text sketch, and shrink each block into its information budget:&lt;/p&gt;
&lt;table id="S3.Ex2a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tau_{j}^{2}\ :=\ \min\Bigl\{1,\ \frac{\eta\,\sigma^{2}h_{j}}{D_{j}^{2}}\Bigr\},\qquad\widetilde{\mu}_{\mathbf{a}}\ :=\ \mu_{0}+\sum_{j}\tau_{j}g_{j}(a_{j}),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p7.2" class="ltx_p"&gt;so that $\tau_{j}\in[0,1]$ and, by hypothesis (1), the shrunken family lies in $K\text{.}$ Place the uniform product prior on $\mathbf{a}\text{.}$ Since the family lies in $K\text{,}$ the minimax risk over $K$ dominates the Bayes risk of this prior, and it suffices to bound the latter for an arbitrary estimator $\widehat{\mu}=\widehat{\mu}(Y)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p8" class="ltx_para"&gt;
&lt;p id="S3a.p8.1" class="ltx_p"&gt;&lt;em id="S3a.p8.1.1" class="ltx_emph ltx_font_italic"&gt;Separation.&lt;/em&gt; Let $\widehat{\mathbf{a}}$ index a member of the shrunken family nearest to $\widehat{\mu}\text{,}$ ties broken by a fixed order, so that $\|\widehat{\mu}-\widetilde{\mu}_{\mathbf{a}}\|_{2}\geq\tfrac{1}{2}\|\widetilde{\mu}_{\widehat{\mathbf{a}}}-\widetilde{\mu}_{\mathbf{a}}\|_{2}$ by the triangle inequality, and write $\Delta_{j}:=g_{j}(\widehat{a}_{j})-g_{j}(a_{j})\text{,}$ blocks with $\Delta_{j}=0$ dropped. With $\rho_{ij}:=|\langle\Delta_{i},\Delta_{j}\rangle|/(\|\Delta_{i}\|_{2}\|\Delta_{j}\|_{2})\text{,}$ hypothesis (3) gives $\sum_{j\neq i}\rho_{ij}\leq\gamma$ for every $i\text{,}$ and&lt;/p&gt;
&lt;table id="S3.Ex3a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Bigl\|\sum_{j}\tau_{j}\Delta_{j}\Bigr\|_{2}^{2}\ \geq\ \sum_{j}\tau_{j}^{2}\|\Delta_{j}\|_{2}^{2}-\sum_{i\neq j}\rho_{ij}\,\tau_{i}\|\Delta_{i}\|_{2}\,\tau_{j}\|\Delta_{j}\|_{2}\ \geq\ (1-\gamma)\sum_{j}\tau_{j}^{2}\|\Delta_{j}\|_{2}^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p8.2" class="ltx_p"&gt;the last step by $xy\leq\tfrac{1}{2}(x^{2}+y^{2})$ and the row sums. Since $\|\Delta_{j}\|_{2}\geq d_{j}$ whenever $\widehat{a}_{j}\neq a_{j}\text{,}$ pathwise&lt;/p&gt;
&lt;table id="S3.Ex4a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\|\widehat{\mu}-\widetilde{\mu}_{\mathbf{a}}\|_{2}^{2}\ \geq\ \frac{1-\gamma}{4}\sum_{j}\tau_{j}^{2}d_{j}^{2}\,\mathbf{1}\{\widehat{a}_{j}\neq a_{j}\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S3a.p9" class="ltx_para"&gt;
&lt;p id="S3a.p9.1" class="ltx_p"&gt;&lt;em id="S3a.p9.1.1" class="ltx_emph ltx_font_italic"&gt;Per-block error.&lt;/em&gt; Fix $j$ and condition on the other labels $\mathbf{a}_{-j}\text{.}$ Under the product prior, $a_{j}$ remains uniform on $\mathcal{A}_{j}\text{,}$ and subtracting the known vector $\mu_{0}+\sum_{i\neq j}\tau_{i}g_{i}(a_{i})$ from $Y$ reduces the conditional problem to testing the finite Gaussian family $\{\tau_{j}g_{j}(a):a\in\mathcal{A}_{j}\}\text{,}$ whose pairwise Kullback–Leibler divergences are at most $\tau_{j}^{2}D_{j}^{2}/(2\sigma^{2})\leq\eta h_{j}/2\text{.}$ If $|\mathcal{A}_{j}|\geq 3\text{,}$ Fano’s inequality gives every decoder error probability at least $1-\eta/2-\log 2/\log|\mathcal{A}_{j}|\geq 1-\tfrac{1}{20}-\log 2/\log 3&amp;gt;\tfrac{1}{4}\text{.}$ If $|\mathcal{A}_{j}|=2\text{,}$ then $D_{j}=d_{j}$ and the two means are at distance $\tau_{j}D_{j}\leq\sigma\sqrt{\eta\log 2}\text{;}$ the likelihood-ratio test is optimal and projects the data onto the difference of the means; its two conditional errors are equal, and the Bayes error is&lt;/p&gt;
&lt;table id="S3.Ex5a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Phi_{\mathcal{N}}\Bigl(-\frac{\tau_{j}D_{j}}{2\sigma}\Bigr)\ \geq\ \frac{1}{2}-\frac{\sqrt{\eta\log 2}}{2\sqrt{2\pi}}\ &amp;gt;\ \frac{1}{4},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p9.2" class="ltx_p"&gt;where $\Phi_{\mathcal{N}}$ is the standard normal distribution function, whose density is at most $1/\sqrt{2\pi}\text{.}$ In either case, every decoder of $a_{j}$ that is measurable in $Y$ is, conditionally on $\mathbf{a}_{-j}\text{,}$ a decoder of the reduced problem, so $\mathbb{P}(\widehat{a}_{j}\neq a_{j})\geq\tfrac{1}{4}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p10" class="ltx_para"&gt;
&lt;p id="S3a.p10.1" class="ltx_p"&gt;&lt;em id="S3a.p10.1.1" class="ltx_emph ltx_font_italic"&gt;Assembly.&lt;/em&gt; Taking expectations in the separation bound,&lt;/p&gt;
&lt;table id="S3.Ex6a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\|\widehat{\mu}-\widetilde{\mu}_{\mathbf{a}}\|_{2}^{2}\ \geq\ \frac{1-\gamma}{4}\sum_{j}\tau_{j}^{2}d_{j}^{2}\,\mathbb{P}(\widehat{a}_{j}\neq a_{j})\ \geq\ \frac{1-\gamma}{16}\sum_{j}\tau_{j}^{2}d_{j}^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p10.2" class="ltx_p"&gt;and by the definition of $\tau_{j}$ and hypothesis (2),&lt;/p&gt;
&lt;table id="S3.Ex7a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tau_{j}^{2}d_{j}^{2}\ =\ \min\Bigl\{d_{j}^{2},\ \eta\,\sigma^{2}h_{j}\,\frac{d_{j}^{2}}{D_{j}^{2}}\Bigr\}\ \geq\ \min\Bigl\{d_{j}^{2},\ \frac{\eta}{A}\,\sigma^{2}h_{j}\Bigr\}\ \geq\ \frac{\eta}{A}\,\min\bigl\{d_{j}^{2},\ \sigma^{2}h_{j}\bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p10.3" class="ltx_p"&gt;so the Bayes risk of the prior is at least $c_{A}(1-\gamma)\sum_{j}\min\{d_{j}^{2},\sigma^{2}h_{j}\}$ with $c_{A}:=\eta/(16A)=1/(160A)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p11" class="ltx_para"&gt;
&lt;p id="S3a.p11.1" class="ltx_p"&gt;&lt;em id="S3a.p11.1.1" class="ltx_emph ltx_font_italic"&gt;The restricted loss.&lt;/em&gt; When every contrast is supported in the coordinate set $S\text{,}$ choose $\widehat{\mathbf{a}}$ nearest to $\widehat{\mu}$ in the norm restricted to $S\text{.}$ The differences $(\widetilde{\mu}_{\widehat{\mathbf{a}}}-\widetilde{\mu}_{\mathbf{a}})|_{S}=\sum_{j}\tau_{j}\Delta_{j}$ are unchanged, since the contrasts live in $S\text{,}$ so the separation bound holds for $\|(\widehat{\mu}-\widetilde{\mu}_{\mathbf{a}})|_{S}\|_{2}^{2}\text{;}$ and the per-block bound applies to any decoder measurable in the full data $Y\text{,}$ in particular to this one. The assembly is identical.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p12" class="ltx_para"&gt;
&lt;p id="S3a.p12.1" class="ltx_p"&gt;The assembly across groups in Proposition 3.4 rests on the fact that coordinate-disjoint blocks contribute additively to the Bayes risk.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.Thmlemma1a" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmlemma1a.2" class="ltx_text ltx_font_bold"&gt;Lemma S.3.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmlemma1a.3" class="ltx_text ltx_font_bold"&gt; (Bayes risks add across disjoint blocks).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmlemma1a.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmlemma1a.p1.1" class="ltx_p"&gt;&lt;span id="S3.Thmlemma1a.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex8a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mu_{\boldsymbol{\theta}}\ =\ \mu_{0}+\sum_{i=1}^{m}h_{i}(\theta_{i}),\qquad\boldsymbol{\theta}=(\theta_{1},\dots,\theta_{m}),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.Thmlemma1a.p1.2" class="ltx_p"&gt;&lt;span id="S3.Thmlemma1a.p1.2.1" class="ltx_text ltx_font_italic"&gt;where the $\theta_{i}$ are independent under a product prior and, for each $i\text{,}$ every contrast $h_{i}(\theta_{i})-h_{i}(\theta_{i}^{\prime})$ is supported in a coordinate set $S_{i}\text{,}$ the sets $S_{1},\dots,S_{m}$ pairwise disjoint. In the model $Y=\mu_{\boldsymbol{\theta}}+\sigma Z\text{,}$ $Z\sim N(0,I_{N})\text{,}$ the Bayes risk of estimating $\mu_{\boldsymbol{\theta}}$ in squared loss is at least the sum over $i$ of the Bayes risks of the isolated problems: observe $Y_{S_{i}}\text{,}$ which up to a fixed additive vector is $h_{i}(\theta_{i})|_{S_{i}}+\sigma Z_{S_{i}}\text{,}$ and estimate $\mu_{\boldsymbol{\theta}}|_{S_{i}}$ under the $i$-th marginal prior.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3a.p13" class="ltx_para"&gt;
&lt;p id="S3a.p13.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p14" class="ltx_para"&gt;
&lt;p id="S3a.p14.1" class="ltx_p"&gt;The squared loss dominates the sum of its restrictions to the disjoint sets: $\|\widehat{\mu}-\mu_{\boldsymbol{\theta}}\|_{2}^{2}\geq\sum_{i}\|(\widehat{\mu}-\mu_{\boldsymbol{\theta}})|_{S_{i}}\|_{2}^{2}\text{.}$ Fix $i\text{.}$ For $\ell\neq i$ the restriction $h_{\ell}(\theta_{\ell})|_{S_{i}}$ does not depend on $\theta_{\ell}\text{:}$ two values of $\theta_{\ell}$ differ on $S_{i}$ by a contrast of block $\ell$ restricted to $S_{i}\text{,}$ which vanishes because those contrasts are supported in $S_{\ell}\text{,}$ disjoint from $S_{i}\text{.}$ Hence $\mu_{\boldsymbol{\theta}}|_{S_{i}}=c_{i}+h_{i}(\theta_{i})|_{S_{i}}$ for a fixed vector $c_{i}\text{,}$ and $Y_{S_{i}}$ is distributed as in the isolated problem. Moreover $Y_{S_{i}^{c}}$ is a function of $(\boldsymbol{\theta}_{-i},Z_{S_{i}^{c}})\text{,}$ which is independent of $(\theta_{i},Z_{S_{i}})$ under the product prior, so $Y_{S_{i}^{c}}$ is independent of the pair $(\theta_{i},Y_{S_{i}})$ and the conditional law of $\mu_{\boldsymbol{\theta}}|_{S_{i}}$ given $Y$ equals its conditional law given $Y_{S_{i}}\text{.}$ The Bayes-optimal estimate of $\mu_{\boldsymbol{\theta}}|_{S_{i}}\text{,}$ its posterior mean, is therefore a function of $Y_{S_{i}}$ alone, and $\mathbb{E}\|(\widehat{\mu}-\mu_{\boldsymbol{\theta}})|_{S_{i}}\|_{2}^{2}$ is at least the isolated Bayes risk for every estimator $\widehat{\mu}\text{.}$ Summing over $i$ completes the proof.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p15" class="ltx_para"&gt;
&lt;p id="S3a.p15.1" class="ltx_p"&gt;The next lemma produces the edge-disjoint groups of the main-text sketch, with explicit comparison constants.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.Thmlemma2a" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmlemma2a.2" class="ltx_text ltx_font_bold"&gt;Lemma S.3.2&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmlemma2a.3" class="ltx_text ltx_font_bold"&gt; (Edge-disjoint grouping).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmlemma2a.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmlemma2a.p1.1" class="ltx_p"&gt;&lt;span id="S3.Thmlemma2a.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $U\subseteq\mathsf{V}$ consist of $M\geq 2$ vertices and let $q$ be an integer with $1\leq q\leq M/2\text{.}$ There are connected subtrees $\mathcal{C}_{1},\dots,\mathcal{C}_{q^{\prime}}$ of $T$ with pairwise disjoint edge sets, and pairwise disjoint sets $U_{i}\subseteq U\cap\mathcal{C}_{i}\text{,}$ such that&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex9a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{q}{4}\ \leq\ q^{\prime}\ \leq\ 6q,\qquad\frac{M}{6q}\ \leq\ |U_{i}|\ \leq\ \frac{M}{q}\quad\text{and}\quad|U_{i}|\ \geq\ 2\qquad\text{for every }i.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3a.p16" class="ltx_para"&gt;
&lt;p id="S3a.p16.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p17" class="ltx_para"&gt;
&lt;p id="S3a.p17.1" class="ltx_p"&gt;Call the members of $U$ &lt;em id="S3a.p17.1.1" class="ltx_emph ltx_font_italic"&gt;marks&lt;/em&gt;. Work in the minimal subtree of $T$ spanning $U\text{,}$ rooted by the orientation inherited from $T\text{,}$ and set $L:=\max\{2,\lfloor M/(4q)\rfloor\}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p18" class="ltx_para"&gt;
&lt;p id="S3a.p18.1" class="ltx_p"&gt;&lt;em id="S3a.p18.1.1" class="ltx_emph ltx_font_italic"&gt;The procedure.&lt;/em&gt; Process the vertices in postorder, distinguishing each mark’s &lt;em id="S3a.p18.1.2" class="ltx_emph ltx_font_italic"&gt;token&lt;/em&gt;, which will be assigned to at most one group, from the vertices and edges that only provide connectivity. Each vertex $v$ receives a collection of &lt;em id="S3a.p18.1.3" class="ltx_emph ltx_font_italic"&gt;items&lt;/em&gt;, each a connected subgraph containing $v$ together with the unassigned tokens it carries: for every child $c$ of $v\text{,}$ the residual passed up from $c\text{,}$ extended by the edge $(v,c)\text{;}$ and, if $v$ is a mark, the one-point item $\{v\}$ carrying the token of $v\text{.}$ Insert the items into an open bin one at a time; whenever the bin first carries at least $L$ tokens, seal it: its subgraphs unite into a component, connected through $v\text{,}$ and its tokens, now permanently assigned, form the component’s mark set. After the last item, pass the union of the open bin and the bare vertex $\{v\}\text{,}$ carrying the bin’s tokens, upward as the residual of $v\text{.}$ At the root, discard the final residual.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p19" class="ltx_para"&gt;
&lt;p id="S3a.p19.1" class="ltx_p"&gt;&lt;em id="S3a.p19.1.1" class="ltx_emph ltx_font_italic"&gt;The invariant.&lt;/em&gt; Sealed components and residuals are connected, being unions of items that share the vertex at which they formed. A residual carries fewer than $L$ tokens, its bin having never reached $L\text{;}$ consequently every item carries fewer than $L$ tokens, the one-point items because $L\geq 2\text{,}$ and a component seals with at least $L$ but fewer than $2L$ tokens. Each token is assigned at most once, so the mark sets $U_{i}$ are pairwise disjoint; and a token’s vertex belongs to every subgraph that carries it, so $U_{i}\subseteq U\cap\mathcal{C}_{i}\text{.}$ Finally, each edge of the spanning subtree enters the process in exactly one item and thereafter stays inside whichever bin, component, or residual that item joined; the components are therefore pairwise edge-disjoint.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p20" class="ltx_para"&gt;
&lt;p id="S3a.p20.1" class="ltx_p"&gt;&lt;em id="S3a.p20.1.1" class="ltx_emph ltx_font_italic"&gt;Counting.&lt;/em&gt; Let $q^{\prime}$ be the number of sealed components; by the invariant, $|U_{i}|\in[L,2L)$ for each. Every token is either assigned at some sealing or sits in the final, discarded residual, which carries fewer than $L\text{;}$ hence&lt;/p&gt;
&lt;table id="S3.Ex10a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$q^{\prime}L\ \leq\ M\ &amp;lt;\ 2Lq^{\prime}+L.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p20.2" class="ltx_p"&gt;If $M\geq 12q\text{,}$ then $L=\lfloor M/(4q)\rfloor\geq 3$ and $M/(6q)\leq L\leq M/(4q)\text{,}$ since $\lfloor x\rfloor\geq x-1\geq\tfrac{2}{3}x$ for $x\geq 3\text{;}$ hence $q^{\prime}\leq M/L\leq 6q$ and $q^{\prime}&amp;gt;M/(2L)-\tfrac{1}{2}\geq 2q-\tfrac{1}{2}\text{,}$ so $q^{\prime}\geq 2q\geq q\text{,}$ while $|U_{i}|\in[L,2L)\subseteq[M/(6q),\,M/(2q)]\text{.}$ If $M&amp;lt;12q\text{,}$ then $L=2\text{:}$ every item then carries at most one token, so components seal with exactly two, and $|U_{i}|=2$ lies in $[M/(6q),M/q]$ because $2q\leq M&amp;lt;12q\text{.}$ For $M\geq 4$ the count gives $q^{\prime}\leq M/2\leq 6q$ and $q^{\prime}&amp;gt;(M-2)/4\geq M/8\geq q/4\text{;}$ for $M\in\{2,3\}\text{,}$ necessarily $q=1\text{,}$ and the procedure seals exactly one component: fewer than $4$ tokens admit at most one, and at least one seals because all unassigned tokens funnel into the bins at the root.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p21" class="ltx_para"&gt;
&lt;p id="S3a.p21.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Completion of the proof of Proposition 3.4.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p22" class="ltx_para"&gt;
&lt;p id="S3a.p22.1" class="ltx_p"&gt;&lt;a href="#S3.Thmlemma2a" title="Lemma S.3.2 (Edge-disjoint grouping). ‣ S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.3.2&lt;/span&gt;&lt;/a&gt;, applied with the parameter $q$ of the proposition, supplies the groups of the main-text sketch, with $q/4\leq q^{\prime}\leq 6q$ and $M/(6q)\leq M_{i}\leq M/q\text{;}$ every group receives the budget $a=V/q^{\prime}\text{.}$ Fix a group, with marked set $U_{i}$ of size $M_{i}\geq 2\text{,}$ and adopt the objects of the sketch: the radii $r_{\ell}=16^{\ell}r\text{,}$ the nested maximal separated subsets $N_{\ell}\text{,}$ the descent chain with its node weights and child counts $m_{\ell}\text{,}$ the retained levels $I\text{,}$ the alphabets $\mathcal{A}_{\ell}\text{,}$ and the masses $a_{\ell}$ with their normalizer $S\text{.}$ We verify the claims quoted there and assemble.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p23" class="ltx_para"&gt;
&lt;p id="S3a.p23.1" class="ltx_p"&gt;&lt;em id="S3a.p23.1.1" class="ltx_emph ltx_font_italic"&gt;The hierarchy and its entropy.&lt;/em&gt; Maximality of $N_{\ell}$ inside $N_{\ell-1}$ means that every point of $N_{\ell-1}$ lies within $r_{\ell}$ of a point of $N_{\ell}\text{,}$ so parents can be assigned, each point of $N_{\ell}$ to itself; and once $r_{\ell}$ exceeds the diameter of $U_{i}$ an $r_{\ell}$-separated subset is a single point: the hierarchy has a top. The weight of a node is at most its number of children times the largest weight of a child, so descending along children of maximal weight from the top, whose weight is $M_{i}\text{,}$ to a leaf, whose weight is one, gives $M_{i}\leq\prod_{\ell}m_{\ell}\text{,}$ that is, $\sum_{\ell}\log m_{\ell}\geq\log M_{i}\text{.}$ Levels with $m_{\ell}=1$ contribute zero to this sum, and among the four residue classes modulo four of the remaining levels one carries at least a quarter of it; the retained class $I$ therefore has $H=\sum_{\ell\in I}h_{\ell}\geq\tfrac{1}{4}\log M_{i}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p24" class="ltx_para"&gt;
&lt;p id="S3a.p24.1" class="ltx_p"&gt;&lt;em id="S3a.p24.1.1" class="ltx_emph ltx_font_italic"&gt;Separations and aspect.&lt;/em&gt; Distinct children $u\neq v$ of the chain node at level $\ell$ lie in $N_{\ell-1}\text{,}$ so $d_{T}(u,v)\geq r_{\ell-1}\text{;}$ both lie within $r_{\ell}$ of their parent, so $d_{T}(u,v)\leq 2r_{\ell}=32\,r_{\ell-1}\text{.}$ By Lemma 2.2(1), the contrasts $\Delta=a_{\ell}(p_{u}-p_{v})$ then satisfy $a_{\ell}^{2}r_{\ell-1}\leq\|\Delta\|_{2}^{2}\leq 32\,a_{\ell}^{2}r_{\ell-1}\text{,}$ so $d_{\ell}^{2}\geq a_{\ell}^{2}r_{\ell-1}$ and $D_{\ell}^{2}\leq 32\,a_{\ell}^{2}r_{\ell-1}\leq 32\,d_{\ell}^{2}\text{:}$ hypothesis (2) of Lemma 3.3 holds with $A=32\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p25" class="ltx_para"&gt;
&lt;p id="S3a.p25.1" class="ltx_p"&gt;&lt;em id="S3a.p25.1.1" class="ltx_emph ltx_font_italic"&gt;Overlap.&lt;/em&gt; For $\ell&amp;lt;\ell^{\prime}$ in $I\text{,}$ a contrast $\Delta_{\ell}$ has entries in $[-a_{\ell},a_{\ell}]$ and support of size $d_{T}(u,v)\leq 32\,r_{\ell-1}\text{,}$ by Lemma 2.2(2), so $|\langle\Delta_{\ell},\Delta_{\ell^{\prime}}\rangle|\leq 32\,r_{\ell-1}a_{\ell}a_{\ell^{\prime}}\text{,}$ and with the norm lower bounds just proved the normalized entry is at most $32\sqrt{r_{\ell-1}/r_{\ell^{\prime}-1}}=32\cdot 4^{-(\ell^{\prime}-\ell)}\text{.}$ Retained levels differ by at least four, so every row of the normalized Gram matrix sums to at most&lt;/p&gt;
&lt;table id="S3.Ex11a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$2\sum_{t\geq 1}32\cdot 4^{-4t}\ =\ \frac{64}{255}\ =:\ \gamma\ &amp;lt;\ 1:$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p25.2" class="ltx_p"&gt;hypothesis (3) of Lemma 3.3 holds with this $\gamma\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p26" class="ltx_para"&gt;
&lt;p id="S3a.p26.1" class="ltx_p"&gt;&lt;em id="S3a.p26.1.1" class="ltx_emph ltx_font_italic"&gt;Legality and scalability.&lt;/em&gt; With the reference points $u_{\ell}^{0}\in\mathcal{A}_{\ell}$ and $\mu_{0}:=\sum_{\ell\in I}a_{\ell}p_{u_{\ell}^{0}}\text{,}$ a blockwise-scaled member of the group family is&lt;/p&gt;
&lt;table id="S3.Ex12a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mu_{0}+\sum_{\ell\in I}\tau_{\ell}\,a_{\ell}\bigl(p_{u_{\ell}}-p_{u_{\ell}^{0}}\bigr)\ =\ \sum_{\ell\in I}a_{\ell}\bigl[(1-\tau_{\ell})\,p_{u_{\ell}^{0}}+\tau_{\ell}\,p_{u_{\ell}}\bigr],$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p26.2" class="ltx_p"&gt;a leak combination with nonnegative coefficients of total mass $\sum_{\ell\in I}a_{\ell}=a\text{;}$ hypothesis (1) of Lemma 3.3 holds with $K$ the convex set of all such mass-$a$ combinations.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p27" class="ltx_para"&gt;
&lt;p id="S3a.p27.1" class="ltx_p"&gt;&lt;em id="S3a.p27.1.1" class="ltx_emph ltx_font_italic"&gt;The allocation.&lt;/em&gt; Since $a_{\ell}^{2}r_{\ell-1}=a^{2}h_{\ell}/S^{2}\text{,}$&lt;/p&gt;
&lt;table id="S3.Ex13a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{\ell\in I}\min\bigl\{a_{\ell}^{2}r_{\ell-1},\ \sigma^{2}h_{\ell}\bigr\}\ =\ \sum_{\ell\in I}h_{\ell}\,\min\Bigl\{\frac{a^{2}}{S^{2}},\ \sigma^{2}\Bigr\}\ =\ H\,\min\Bigl\{\frac{a^{2}}{S^{2}},\ \sigma^{2}\Bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p27.2" class="ltx_p"&gt;By the Cauchy–Schwarz inequality, $S^{2}\leq H\sum_{\ell\in I}r_{\ell-1}^{-1}\text{,}$ and the radii grow geometrically, so $\sum_{\ell\in I}r_{\ell-1}^{-1}\leq r^{-1}\sum_{i\geq 0}16^{-i}=16/(15r)\leq 2/r\text{;}$ hence $a^{2}/S^{2}\geq a^{2}r/(2H)$ and&lt;/p&gt;
&lt;table id="S3.Ex14a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$H\,\min\Bigl\{\frac{a^{2}}{S^{2}},\ \sigma^{2}\Bigr\}\ \geq\ \min\Bigl\{\frac{a^{2}r}{2},\ \sigma^{2}H\Bigr\}\ \geq\ \frac{1}{4}\,\min\bigl\{a^{2}r,\ \sigma^{2}\log M_{i}\bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p27.3" class="ltx_p"&gt;using $H\geq\tfrac{1}{4}\log M_{i}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p28" class="ltx_para"&gt;
&lt;p id="S3a.p28.1" class="ltx_p"&gt;&lt;em id="S3a.p28.1.1" class="ltx_emph ltx_font_italic"&gt;Assembly.&lt;/em&gt; The contrasts of the group join members of $U_{i}\subseteq\mathcal{C}_{i}\text{,}$ and the connecting paths run inside the connected subtree $\mathcal{C}_{i}\text{,}$ so all group contrasts are supported in the set $S_{i}$ of lower endpoints of the edges of $\mathcal{C}_{i}$ (Lemma 2.2(2)). Lemma 3.3, in its restricted-loss form with $A=32$ and $\gamma=64/255\text{,}$ therefore bounds the Bayes risk of the shrunken group family, for every estimator measurable in the full data, below by&lt;/p&gt;
&lt;table id="S3.Ex15a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$c_{A}(1-\gamma)\sum_{\ell\in I}\min\bigl\{d_{\ell}^{2},\sigma^{2}h_{\ell}\bigr\}\ \geq\ c^{\prime}\,\min\bigl\{a^{2}r,\ \sigma^{2}\log M_{i}\bigr\},\qquad c^{\prime}:=\frac{c_{A}(1-\gamma)}{4},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p28.2" class="ltx_p"&gt;by the aspect and allocation bounds above. Sums of one shrunken member per group are legal points of $\mathcal{F}_{V}(T)\text{,}$ as verified in the main body; the sets $S_{i}$ are pairwise disjoint, the $E(\mathcal{C}_{i})$ being disjoint and distinct edges having distinct lower endpoints; and the prior is a product across groups. &lt;a href="#S3.Thmlemma1a" title="Lemma S.3.1 (Bayes risks add across disjoint blocks). ‣ S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.3.1&lt;/span&gt;&lt;/a&gt; therefore bounds the joint Bayes risk below by the sum of the isolated group risks, and each isolated problem is, after subtracting its fixed vector, the group problem observed through $Y_{S_{i}}$ alone, so its Bayes risk also dominates the displayed bound. Hence&lt;/p&gt;
&lt;table id="S3.Ex16a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{*}_{T}(V,\sigma)\ \geq\ c^{\prime}\sum_{i=1}^{q^{\prime}}\min\bigl\{a^{2}r,\ \sigma^{2}\log M_{i}\bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p28.3" class="ltx_p"&gt;Finally, $a=V/q^{\prime}\geq V/(6q)\text{,}$ and $\log M_{i}\geq\tfrac{1}{7}\log(eM/q)\text{:}$ if $M/q\geq 36\text{,}$ then with $x:=\log(M/q)\text{,}$ $\log M_{i}\geq\log(M/(6q))=x-\log 6$ and $5(x-\log 6)-(1+x)=4x-5\log 6-1\geq 4\log 36-5\log 6-1=3\log 6-1&amp;gt;0\text{,}$ so the ratio to $\log(eM/q)=1+x$ is at least $\tfrac{1}{5}\text{;}$ if $M/q&amp;lt;36\text{,}$ then $\log M_{i}\geq\log 2$ and $\log(eM/q)&amp;lt;1+\log 36\text{,}$ and $7\log 2&amp;gt;4.8&amp;gt;1+\log 36\text{.}$ Therefore&lt;/p&gt;
&lt;table id="S3.Ex17a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{*}_{T}(V,\sigma)\ \geq\ \frac{q^{\prime}c^{\prime}}{36}\,\min\Bigl\{\frac{V^{2}r}{q^{2}},\ \sigma^{2}\log\frac{eM}{q}\Bigr\}\ \geq\ \frac{c^{\prime}}{144}\,\min\Bigl\{\frac{V^{2}r}{q},\ \sigma^{2}q\log\frac{eM}{q}\Bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p28.4" class="ltx_p"&gt;which is the claim.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p29" class="ltx_para"&gt;
&lt;p id="S3a.p29.1" class="ltx_p"&gt;The reduction of Proposition 3.5 rests on a scalar matching of the free parameter $q$ to the profile; the constant $8$ below is the one priced into $A_{0}=18\cdot 8=144\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.Thmlemma3a" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmlemma3a.2" class="ltx_text ltx_font_bold"&gt;Lemma S.3.3&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmlemma3a.3" class="ltx_text ltx_font_bold"&gt; (Scalar matching).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmlemma3a.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmlemma3a.p1.1" class="ltx_p"&gt;&lt;span id="S3.Thmlemma3a.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $k\geq 1$ and $M&amp;gt;k$ be integers, let $r&amp;gt;0\text{,}$ and set $L:=\log(M/k)&amp;gt;0\text{.}$ If&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex18a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$V^{2}r\,\min\Bigl\{1,\ \frac{L}{k}\Bigr\}\ \geq\ 8\,\sigma^{2}k,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3.Thmlemma3a.p1.2" class="ltx_p"&gt;&lt;span id="S3.Thmlemma3a.p1.2.1" class="ltx_text ltx_font_italic"&gt;then some integer $1\leq q\leq M/2\text{,}$ comparable to $\max\{1,\ k/(1+L)\}$ within universal factors, satisfies&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex19a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\min\Bigl\{\frac{V^{2}r}{q},\ \sigma^{2}q\log\frac{eM}{q}\Bigr\}\ \geq\ \frac{\sigma^{2}k}{7}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3a.p30" class="ltx_para"&gt;
&lt;p id="S3a.p30.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p31" class="ltx_para"&gt;
&lt;p id="S3a.p31.1" class="ltx_p"&gt;Write $B:=1+L$ and note $M\geq 2\text{.}$ There are three cases.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p32" class="ltx_para"&gt;
&lt;p id="S3a.p32.1" class="ltx_p"&gt;&lt;em id="S3a.p32.1.1" class="ltx_emph ltx_font_italic"&gt;Case $L\geq k\text{.}$&lt;/em&gt; Take $q:=1\text{,}$ which equals $\max\{1,k/B\}$ since $k/B&amp;lt;1\text{.}$ The hypothesis reads $V^{2}r\geq 8\sigma^{2}k\text{,}$ and $\sigma^{2}\log(eM)=\sigma^{2}(1+\log M)\geq\sigma^{2}(1+L)\geq\sigma^{2}k\text{,}$ so both branches are at least $\sigma^{2}k\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p33" class="ltx_para"&gt;
&lt;p id="S3a.p33.1" class="ltx_p"&gt;&lt;em id="S3a.p33.1.1" class="ltx_emph ltx_font_italic"&gt;Case $L&amp;lt;k$ and $M\geq 8k/B\text{.}$&lt;/em&gt; Take $q:=\max\{1,\lfloor k/B\rfloor\}\text{.}$ Then $k/(2B)\leq q\leq 2k/B\text{:}$ if $k\geq B$ this is $\lfloor x\rfloor\in[x/2,x]$ at $x=k/B\geq 1\text{;}$ if $k&amp;lt;B\text{,}$ then $q=1\text{,}$ and $k/(2B)&amp;lt;\tfrac{1}{2}&amp;lt;1\leq 2k/B$ because $B=1+L&amp;lt;1+k\leq 2k\text{.}$ Also $q\leq 2k/B\leq M/4&amp;lt;M/2$ by the case hypothesis. The hypothesis of the lemma reads $V^{2}rL/k\geq 8\sigma^{2}k\text{,}$ so&lt;/p&gt;
&lt;table id="S3.Ex20a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{V^{2}r}{q}\ \geq\ \frac{B}{2k}\,V^{2}r\ \geq\ \frac{L}{2k}\,V^{2}r\ \geq\ 4\,\sigma^{2}k.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p33.2" class="ltx_p"&gt;For the entropy branch, $M=ke^{L}$ and $q\leq 2k/B$ give $eM/q\geq\tfrac{e}{2}\,Be^{L}\text{,}$ so&lt;/p&gt;
&lt;table id="S3.Ex21a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log\frac{eM}{q}\ \geq\ 1+L+\log B-\log 2\ \geq\ 0.3\,B,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p33.3" class="ltx_p"&gt;since $0.7(1+L)+\log(1+L)\geq 0.7&amp;gt;\log 2\text{;}$ hence $\sigma^{2}q\log(eM/q)\geq\sigma^{2}\,\tfrac{k}{2B}\cdot 0.3B=0.15\,\sigma^{2}k\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p34" class="ltx_para"&gt;
&lt;p id="S3a.p34.1" class="ltx_p"&gt;&lt;em id="S3a.p34.1.1" class="ltx_emph ltx_font_italic"&gt;Case $L&amp;lt;k$ and $M&amp;lt;8k/B\text{.}$&lt;/em&gt; Take $q:=\lfloor M/2\rfloor\text{,}$ so $M/3\leq q\leq M/2\text{;}$ and $q$ is comparable to $\max\{1,k/B\}\text{,}$ since $k&amp;lt;M&amp;lt;8k/B$ forces $B&amp;lt;8\text{,}$ whence $q\geq(M-1)/2\geq k/2$ and $q&amp;lt;4k/B\leq 4k\text{.}$ The entropy branch has $\log(eM/q)\geq\log(2e)&amp;gt;1\text{,}$ so $\sigma^{2}q\log(eM/q)\geq\sigma^{2}M/3&amp;gt;\sigma^{2}k/3\text{;}$ and the mass branch, using $k/M&amp;gt;B/8$ and $B&amp;gt;L\text{,}$&lt;/p&gt;
&lt;table id="S3.Ex22" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{V^{2}r}{q}\ \geq\ \frac{2V^{2}r}{M}\ =\ 2\,\frac{V^{2}rL}{k}\cdot\frac{k}{LM}\ \geq\ 16\,\sigma^{2}k\cdot\frac{B}{8L}\ \geq\ 2\,\sigma^{2}k.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p34.2" class="ltx_p"&gt;In every case the minimum is at least $0.15\,\sigma^{2}k\geq\sigma^{2}k/7\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p35" class="ltx_para"&gt;
&lt;p id="S3a.p35.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Completion of the proof of Proposition 3.5.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p36" class="ltx_para"&gt;
&lt;p id="S3a.p36.1" class="ltx_p"&gt;The main text reduces the proposition to the following situation: an integer $k\geq 1\text{,}$ and $M\geq N^{\uparrow}_{T}(r)&amp;gt;k$ vertices with pairwise tree distances at least $r^{\prime}:=r/9\text{,}$ where&lt;/p&gt;
&lt;table id="S3.Ex23" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$V^{2}r^{\prime}\,\min\Bigl\{1,\ \frac{1}{k}\Bigl[\log\frac{M}{k}\Bigr]_{+}\Bigr\}\ \geq\ \frac{1}{18}\,V^{2}\delta_{k}(T)\ \geq\ \frac{A_{0}}{18}\,\sigma^{2}k\ =\ 8\,\sigma^{2}k:$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p36.2" class="ltx_p"&gt;the term at $(r^{\prime},M)$ is at least one ninth of the term at $(r,N^{\uparrow}_{T}(r))\text{,}$ since $r^{\prime}=r/9$ and enlarging the count only increases the positive part. With $L:=\log(M/k)&amp;gt;0$ this is the hypothesis of &lt;a href="#S3.Thmlemma3a" title="Lemma S.3.3 (Scalar matching). ‣ S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.3.3&lt;/span&gt;&lt;/a&gt;. Its conclusion returns an integer $1\leq q\leq M/2\text{,}$ comparable to $\max\{1,k/(1+\log(M/k))\}$ as asserted in the main body, with $\min\{V^{2}r^{\prime}/q,\ \sigma^{2}q\log(eM/q)\}\geq\sigma^{2}k/7\text{.}$ Proposition 3.4, applied to the $M$ separated vertices with this $q\text{,}$ gives $R^{*}_{T}(V,\sigma)\geq(c/7)\,\sigma^{2}k$ with $c$ the constant of that proposition, which proves Proposition 3.5.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p37" class="ltx_para"&gt;
&lt;p id="S3a.p37.1" class="ltx_p"&gt;Section 3.3 assembles the two halves. We next record its two-point bound, the deferred comparisons from three of the four cases, and the fixed-point conclusion. First, the generic bound (3.6) rests on the oracle inequality for least squares over a finite set of candidates. The inequality is classical, and belongs to the Gaussian model selection theory of &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib6" title="" class="ltx_ref"&gt;Birgé and Massart (2001)&lt;/a&gt;&lt;/cite&gt; and &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;&lt;a href="#bib.bib38" title="" class="ltx_ref"&gt;Massart (2007)&lt;/a&gt;&lt;/cite&gt;; we give the short proof so that its constants are explicit.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.Thmlemma4a" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S3.Thmlemma4a.2" class="ltx_text ltx_font_bold"&gt;Lemma S.3.4&lt;/span&gt;&lt;/span&gt;&lt;span id="S3.Thmlemma4a.3" class="ltx_text ltx_font_bold"&gt; (Finite-class least squares).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S3.Thmlemma4a.p1" class="ltx_para"&gt;
&lt;p id="S3.Thmlemma4a.p1.1" class="ltx_p"&gt;&lt;span id="S3.Thmlemma4a.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $Y=\mu+\sigma Z$ with $Z\sim N(0,I_{n})$ and $\mu\in\mathbb{R}^{n}\text{,}$ let $\mathcal{N}\subset\mathbb{R}^{n}$ be finite and nonempty, and let $\widehat{f}$ minimize $\|Y-f\|_{2}^{2}$ over $f\in\mathcal{N}\text{,}$ ties broken by a fixed rule. Then&lt;/span&gt;&lt;/p&gt;
&lt;table id="S3.Ex24" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}_{\mu}\bigl\|\widehat{f}-\mu\bigr\|_{2}^{2}\ \leq\ 4\min_{f\in\mathcal{N}}\|f-\mu\|_{2}^{2}\ +\ 12\,\sigma^{2}\bigl(1+\log|\mathcal{N}|\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3a.p38" class="ltx_para"&gt;
&lt;p id="S3a.p38.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p39" class="ltx_para"&gt;
&lt;p id="S3a.p39.1" class="ltx_p"&gt;Let $f^{\star}$ attain the minimum and $a:=\|f^{\star}-\mu\|_{2}\text{.}$ If $|\mathcal{N}|=1$ then $\widehat{f}=f^{\star}$ and the claim is immediate, so assume $N:=|\mathcal{N}|\geq 2\text{.}$ Optimality of $\widehat{f}$ and $Y-f=(\mu-f)+\sigma Z$ give&lt;/p&gt;
&lt;table id="S3.Ex25" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\|\mu-\widehat{f}\|_{2}^{2}+2\sigma\langle Z,\mu-\widehat{f}\rangle\ \leq\ a^{2}+2\sigma\langle Z,\mu-f^{\star}\rangle,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p39.2" class="ltx_p"&gt;that is, $\|\mu-\widehat{f}\|_{2}^{2}\leq a^{2}+2\sigma\langle Z,\widehat{f}-f^{\star}\rangle\text{.}$ Writing $u_{f}:=(f-f^{\star})/\|f-f^{\star}\|_{2}$ for $f\neq f^{\star}$ and $G:=\bigl[\max_{f\neq f^{\star}}\langle Z,u_{f}\rangle\bigr]_{+}\text{,}$ we get $\langle Z,\widehat{f}-f^{\star}\rangle\leq\|\widehat{f}-f^{\star}\|_{2}\,G\text{,}$ whence, with $x:=\|\widehat{f}-\mu\|_{2}$ and the triangle inequality $\|\widehat{f}-f^{\star}\|_{2}\leq x+a\text{,}$&lt;/p&gt;
&lt;table id="S3.Ex26" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$x^{2}\ \leq\ a^{2}+2\sigma Gx+2\sigma Ga\ \leq\ a^{2}+\Bigl(\tfrac{x^{2}}{2}+2\sigma^{2}G^{2}\Bigr)+\bigl(a^{2}+\sigma^{2}G^{2}\bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p39.3" class="ltx_p"&gt;so $x^{2}\leq 4a^{2}+6\sigma^{2}G^{2}\text{.}$ Each $\langle Z,u_{f}\rangle$ is standard normal, so $\mathbb{P}(G&amp;gt;s)\leq\min\{1,Ne^{-s^{2}/2}\}$ and, splitting the integral $\mathbb{E}G^{2}=\int_{0}^{\infty}2s\,\mathbb{P}(G&amp;gt;s)\,ds$ at $s_{0}:=\sqrt{2\log N}\text{,}$&lt;/p&gt;
&lt;table id="S3.Ex27" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}G^{2}\ \leq\ s_{0}^{2}+N\int_{s_{0}}^{\infty}2s\,e^{-s^{2}/2}\,ds\ =\ 2\log N+2.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p39.4" class="ltx_p"&gt;Combining the two displays proves the lemma.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p40" class="ltx_para"&gt;
&lt;p id="S3a.p40.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Completion of Theorem 1 and Proposition 1.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p41" class="ltx_para"&gt;
&lt;p id="S3a.p41.1" class="ltx_p"&gt;For the two-point bound, pick $u,w$ at tree distance $H_{T}\text{.}$ The segment from $Vp_{u}$ to $Vp_{w}$ lies in $\mathcal{F}_{V}(T)$ and has length $V\sqrt{H_{T}}$ by Lemma 2.2(1), so it contains two points at distance&lt;/p&gt;
&lt;table id="S3.Ex28" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\varrho\ :=\ \min\bigl\{V\sqrt{H_{T}},\ \sigma\bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p41.2" class="ltx_p"&gt;Testing one against the other is a one-dimensional Gaussian shift of size $\varrho/\sigma\leq 1\text{,}$ so under the uniform prior on the pair every test errs with probability at least a universal constant. For any estimator, decoding the nearer of the two points errs only when the squared loss is at least $\varrho^{2}/4\text{;}$ hence the maximum of the two risks is at least $c\varrho^{2}\text{,}$ which is the display (3.8).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p42" class="ltx_para"&gt;
&lt;p id="S3a.p42.1" class="ltx_p"&gt;&lt;em id="S3a.p42.1.1" class="ltx_emph ltx_font_italic"&gt;Case $n&amp;lt;C_{\star}\text{.}$&lt;/em&gt; By (3.8) and $\sigma^{2}\geq\sigma^{2}n/C_{\star}\text{,}$&lt;/p&gt;
&lt;table id="S3.Ex29" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{*}_{T}\ \geq\ c\min\{V^{2}H_{T},\sigma^{2}\}\ \geq\ \frac{c}{C_{\star}}\min\{V^{2}H_{T},\ \sigma^{2}n\}\ \geq\ \frac{c}{C_{\star}}\bigl(\rho_{T}\wedge V^{2}H_{T}\wedge\sigma^{2}n\bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p42.2" class="ltx_p"&gt;which is (I) and the lower half of (II); the upper half follows from (3.6), since $\rho_{T}\wedge V^{2}H_{T}\wedge\sigma^{2}n\leq C_{\star}\min\{V^{2}H_{T},\sigma^{2}\}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p43" class="ltx_para"&gt;
&lt;p id="S3a.p43.1" class="ltx_p"&gt;&lt;em id="S3a.p43.1.1" class="ltx_emph ltx_font_italic"&gt;Case $k_{0}=1$ with $n\geq C_{\star}\text{.}$&lt;/em&gt; The main text bounds $\rho_{T}\leq(A_{0}/\log 2)\,\sigma^{2}$ there, so&lt;/p&gt;
&lt;table id="S3.Ex30" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\rho_{T}\wedge V^{2}H_{T}\wedge\sigma^{2}n\ \leq\ \rho_{T}\ \leq\ C\min\{\sigma^{2},\ V^{2}H_{T}\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S3a.p43.2" class="ltx_p"&gt;using $\rho_{T}\leq V^{2}h_{T}\leq V^{2}H_{T}$ for the second branch; with (3.8) this gives (I). For (II), $\min\{V^{2}H_{T},\sigma^{2}k_{0}\}=\min\{V^{2}H_{T},\sigma^{2}\}\text{,}$ whose lower half is (3.8) and whose upper half is $R^{*}_{T}\leq C\rho_{T}\wedge CV^{2}H_{T}\leq C^{\prime}\min\{\sigma^{2},V^{2}H_{T}\}$ by (3.6).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p44" class="ltx_para"&gt;
&lt;p id="S3a.p44.1" class="ltx_p"&gt;&lt;em id="S3a.p44.1.1" class="ltx_emph ltx_font_italic"&gt;Case $k_{0}=K+1$ with $n\geq C_{\star}\text{.}$&lt;/em&gt; Here $K=\lfloor n/C_{\star}\rfloor\geq n/(2C_{\star})\text{,}$ so $\sigma^{2}k_{0}=\sigma^{2}(K+1)$ lies between $\sigma^{2}n/(2C_{\star})$ and $2\sigma^{2}n/C_{\star}\text{,}$ while $V^{2}H_{T}\geq V^{2}\delta_{K}&amp;gt;A_{0}\sigma^{2}K\geq\sigma^{2}k_{0}/2\text{.}$ Hence $\min\{V^{2}H_{T},\sigma^{2}k_{0}\}\asymp\sigma^{2}n\text{,}$ bounded below by the profile-to-risk lower bound proved in the main body and above by (3.6) through the branch $\sigma^{2}n\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3a.p45" class="ltx_para"&gt;
&lt;p id="S3a.p45.1" class="ltx_p"&gt;&lt;em id="S3a.p45.1.1" class="ltx_emph ltx_font_italic"&gt;The fixed point.&lt;/em&gt; In the interior case $2\leq k_{0}\leq K\text{,}$ the bound (3.6) gives $\rho_{T}\geq\rho_{T}\wedge V^{2}H_{T}\wedge\sigma^{2}n\geq R^{*}_{T}/C\text{,}$ so (3.9) and (3.10) pin the fixed point itself: $c\,\sigma^{2}k_{0}\leq\rho_{T}\leq C\,\sigma^{2}k_{0}\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S4a" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="benchmark-and-broom-profiles"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;S.4 &lt;/span&gt;Benchmark and Broom Profiles&lt;/h2&gt;
&lt;div id="S4a.p1" class="ltx_para"&gt;
&lt;p id="S4a.p1.1" class="ltx_p"&gt;This section proves Corollaries 1, 2, and 3, together with the broom profile bounds (5.8) and the remaining computations deferred from the broom lower bound of Section 5: the objective cap, the probability of the forcing event, the broom’s covering counts, and the crossing that pins its minimax rate. By Theorem 1 the minimax risk is $\min\{V^{2}H_{T},\sigma^{2}k_{0}\}$ up to universal constants, so each corollary reduces to pinning the covering counts and the profile with explicit constants, localizing $k_{0}\text{,}$ and identifying the active branch in every parameter regime. Throughout, $K:=\lfloor n/C_{\star}\rfloor$ with $C_{\star}=e^{2}\text{;}$ the dimension clause of (1.5) holds at $K+1\text{,}$ so $1\leq k_{0}\leq K+1$ on every tree. In the corollary proofs, $W:=V/\sigma\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p2" class="ltx_para"&gt;
&lt;p id="S4a.p2.1" class="ltx_p"&gt;On the path, ancestor covering is interval covering, and the exact counts it yields reduce the profile to one scalar optimization.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmlemma1a" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmlemma1a.2" class="ltx_text ltx_font_bold"&gt;Lemma S.4.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmlemma1a.3" class="ltx_text ltx_font_bold"&gt; (Path profile).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmlemma1a.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmlemma1a.p1.1" class="ltx_p"&gt;&lt;span id="S4.Thmlemma1a.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $P_{L}$ be the path with $L\geq 1$ edges, rooted at one endpoint, so that $n=L+1$ and $h_{P_{L}}=H_{P_{L}}=L\text{.}$ For integers $0\leq q&amp;lt;L\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex1a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$N^{\uparrow}_{T}(q)\ =\ \Bigl\lceil\frac{L+1}{q+1}\Bigr\rceil.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.Thmlemma1a.p1.2" class="ltx_p"&gt;&lt;span id="S4.Thmlemma1a.p1.2.1" class="ltx_text ltx_font_italic"&gt;Moreover&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex2a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\alpha_{k}(P_{L})\ \leq\ \frac{2(L+1)}{ek}\quad\text{for every }k\geq 1,\qquad\alpha_{k}(P_{L})\ \geq\ \frac{L+1}{2ek}\quad\text{for }1\leq k\leq\frac{L+1}{e^{2}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4a.p3" class="ltx_para"&gt;
&lt;p id="S4a.p3.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p4" class="ltx_para"&gt;
&lt;p id="S4a.p4.1" class="ltx_p"&gt;Index the vertices by depth $0,\dots,L\text{.}$ The ancestors of $u$ are $0,\dots,u\text{,}$ so a center $a$ covers exactly the vertices $a,\dots,\min\{a+q,L\}\text{:}$ ancestor $q$-nets are coverings of $L+1$ points by blocks of $q+1$ consecutive integers anchored at their left endpoints. The centers $j(q+1)\text{,}$ $0\leq j\leq\lfloor L/(q+1)\rfloor\text{,}$ form such a covering, and there are $\lfloor L/(q+1)\rfloor+1=\lceil(L+1)/(q+1)\rceil$ of them; no net is smaller, because each center covers at most $q+1$ of the $L+1$ vertices and net sizes are integers.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p5" class="ltx_para"&gt;
&lt;p id="S4a.p5.1" class="ltx_p"&gt;&lt;em id="S4a.p5.1.1" class="ltx_emph ltx_font_italic"&gt;Upper bound.&lt;/em&gt; Consider a radius $q$ whose term in the discrete formula (2.3) is nonzero, so that $N^{\uparrow}_{T}(q)&amp;gt;k\geq 1\text{;}$ then $\lceil(L+1)/(q+1)\rceil\geq 2$ forces $(L+1)/(q+1)&amp;gt;1\text{,}$ whence $N^{\uparrow}_{T}(q)&amp;lt;(L+1)/(q+1)+1&amp;lt;2(L+1)/(q+1)\text{.}$ With $y:=q+1$ and $A:=2(L+1)/k\text{,}$ the term is therefore at most&lt;/p&gt;
&lt;table id="S4.Ex3a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$y\,\log\frac{A}{y}\ \leq\ \sup_{y&amp;gt;0}\ y\log\frac{A}{y}\ =\ \frac{A}{e}\ =\ \frac{2(L+1)}{ek},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p5.2" class="ltx_p"&gt;the supremum being attained at $y=A/e\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p6" class="ltx_para"&gt;
&lt;p id="S4a.p6.1" class="ltx_p"&gt;&lt;em id="S4a.p6.1.1" class="ltx_emph ltx_font_italic"&gt;Lower bound.&lt;/em&gt; Set $x:=(L+1)/(ek)$ and $y:=\lfloor x\rfloor\text{.}$ The hypothesis $k\leq(L+1)/e^{2}$ gives $x\geq e&amp;gt;2\text{,}$ so $y\geq x-1\geq x/2\text{;}$ and $y\leq x\leq(L+1)/e\leq L\text{,}$ so $q:=y-1$ is an admissible radius. Then $N^{\uparrow}_{T}(q)=\lceil(L+1)/y\rceil\geq(L+1)/y\geq ek\text{,}$ so $[\log(N^{\uparrow}_{T}(q)/k)]_{+}\geq 1$ and the term at $q$ is at least $y\min\{k,1\}=y\geq(L+1)/(2ek)\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p7" class="ltx_para"&gt;
&lt;p id="S4a.p7.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof of Corollary 1.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p8" class="ltx_para"&gt;
&lt;p id="S4a.p8.1" class="ltx_p"&gt;By Theorem 1 and $H_{P_{L}}=L\text{,}$ $R^{*}_{P_{L}}(V,\sigma)\asymp\min\{V^{2}L,\sigma^{2}k_{0}\}\text{;}$ write&lt;/p&gt;
&lt;table id="S4.Ex4a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F\ :=\ \min\bigl\{V^{2}L,\ \ V^{2/3}\sigma^{4/3}L^{1/3},\ \ \sigma^{2}(L+1)\bigr\}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p8.2" class="ltx_p"&gt;for the right side of Corollary 1. Since its middle branch is the geometric interpolation $(V^{2}L)^{1/3}(\sigma^{2})^{2/3}\text{,}$ every branch of $F\text{,}$ and hence $F$ itself, dominates $\min\{V^{2}L,\sigma^{2}\}\text{.}$ Here $K=\lfloor(L+1)/e^{2}\rfloor\text{,}$ and there are three cases.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p9" class="ltx_para"&gt;
&lt;p id="S4a.p9.1" class="ltx_p"&gt;&lt;em id="S4a.p9.1.1" class="ltx_emph ltx_font_italic"&gt;Case $k_{0}=1\text{.}$&lt;/em&gt; Here $\min\{V^{2}L,\sigma^{2}k_{0}\}=\min\{V^{2}L,\sigma^{2}\}\text{,}$ which $F$ dominates; and since $F\leq V^{2}L\text{,}$ the matching upper bound needs an argument only when $\sigma^{2}&amp;lt;V^{2}L\text{.}$ By (1.5), $k_{0}=1$ means $L+1&amp;lt;e^{2}$ or $V^{2}\delta_{1}\leq A_{0}\sigma^{2}\text{.}$ In the first case $F\leq\sigma^{2}(L+1)&amp;lt;e^{2}\sigma^{2}\text{.}$ Otherwise $L+1\geq e^{2}\text{,}$ so &lt;a href="#S4.Thmlemma1a" title="Lemma S.4.1 (Path profile). ‣ S.4 Benchmark and Broom Profiles ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.4.1&lt;/span&gt;&lt;/a&gt; applies at $k=1$ and gives $\delta_{1}=\alpha_{1}\geq(L+1)/(2e)\text{,}$ whence $F\leq V^{2}L\leq 2e\,V^{2}\delta_{1}\leq 2eA_{0}\sigma^{2}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p10" class="ltx_para"&gt;
&lt;p id="S4a.p10.1" class="ltx_p"&gt;&lt;em id="S4a.p10.1.1" class="ltx_emph ltx_font_italic"&gt;Case $2\leq k_{0}\leq K\text{.}$&lt;/em&gt; By minimality no clause of (1.5) holds below $k_{0}\text{,}$ while at $k_{0}$ the crossing clause holds, the dimension clause being silent there. &lt;a href="#S4.Thmlemma1a" title="Lemma S.4.1 (Path profile). ‣ S.4 Benchmark and Broom Profiles ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.4.1&lt;/span&gt;&lt;/a&gt; is available on all of $[1,K]\text{,}$ since $K\leq(L+1)/e^{2}\text{,}$ and with&lt;/p&gt;
&lt;table id="S4.Ex5a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\kappa\ :=\ \Bigl(\frac{V^{2}(L+1)}{eA_{0}\sigma^{2}}\Bigr)^{1/3}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p10.2" class="ltx_p"&gt;the crossing inequalities at $k_{0}$ and $k_{0}-1$ read&lt;/p&gt;
&lt;table id="S4.Ex6a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{V^{2}(L+1)}{2e\,k_{0}^{2}}\ \leq\ V^{2}\delta_{k_{0}}\ \leq\ A_{0}\sigma^{2}k_{0},\qquad A_{0}\sigma^{2}(k_{0}-1)\ &amp;lt;\ V^{2}\delta_{k_{0}-1}\ \leq\ \frac{2V^{2}(L+1)}{e\,(k_{0}-1)^{2}},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p10.3" class="ltx_p"&gt;that is, $k_{0}^{3}\geq\kappa^{3}/2$ and $(k_{0}-1)^{3}&amp;lt;2\kappa^{3}\text{;}$ since $k_{0}\geq 2$ gives $k_{0}\leq 2(k_{0}-1)\text{,}$&lt;/p&gt;
&lt;table id="S4.Ex7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$2^{-1/3}\,\kappa\ \leq\ k_{0}\ \leq\ 2^{4/3}\,\kappa.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p10.4" class="ltx_p"&gt;Hence $\sigma^{2}k_{0}\asymp\sigma^{2}\kappa\asymp V^{2/3}\sigma^{4/3}L^{1/3}\text{,}$ the middle branch of $F\text{,}$ using $L\leq L+1\leq 2L\text{.}$ That branch is the least of the three up to constants: failure of the crossing clause at $k=1$ gives $A_{0}\sigma^{2}&amp;lt;V^{2}\delta_{1}\leq 4V^{2}L/e\text{,}$ so $\sigma^{2}\leq CV^{2}L$ and the middle branch is at most $(V^{2}L)^{1/3}(CV^{2}L)^{2/3}=C^{2/3}V^{2}L\text{;}$ and it is $\asymp\sigma^{2}k_{0}\leq\sigma^{2}K\leq\sigma^{2}(L+1)\text{.}$ Therefore $F\asymp\sigma^{2}k_{0}\text{,}$ and the same middle-branch bound gives $\sigma^{2}k_{0}\leq CV^{2}L\text{,}$ so $\min\{V^{2}L,\sigma^{2}k_{0}\}\asymp\sigma^{2}k_{0}$ as well.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p11" class="ltx_para"&gt;
&lt;p id="S4a.p11.1" class="ltx_p"&gt;&lt;em id="S4a.p11.1.1" class="ltx_emph ltx_font_italic"&gt;Case $k_{0}=K+1\geq 2\text{.}$&lt;/em&gt; Then $K\geq 1\text{,}$ so $L+1\geq e^{2}\text{,}$ and no clause fired on $[1,K]\text{;}$ at $k=K\text{,}$&lt;/p&gt;
&lt;table id="S4.Ex8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$A_{0}\sigma^{2}K\ &amp;lt;\ V^{2}\delta_{K}\ \leq\ \frac{2V^{2}(L+1)}{eK^{2}},\quad\text{so}\quad V^{2}(L+1)\ &amp;gt;\ \frac{eA_{0}}{2}\,\sigma^{2}K^{3}\ \geq\ \frac{A_{0}}{16e^{5}}\,\sigma^{2}(L+1)^{3},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p11.2" class="ltx_p"&gt;using $K\geq(L+1)/(2e^{2})\text{,}$ which holds because $\lfloor x\rfloor\geq x/2$ for $x\geq 1\text{.}$ Hence $V^{2}\geq c\,\sigma^{2}(L+1)^{2}$ with $c:=A_{0}/(16e^{5})\text{,}$ and both remaining branches of $F$ dominate the third: $V^{2}L\geq\tfrac{1}{2}V^{2}(L+1)\geq\tfrac{c}{2}\,\sigma^{2}(L+1)^{3}\geq\tfrac{c}{2}\,\sigma^{2}(L+1)\text{,}$ and $(V^{2}L)^{1/3}\sigma^{4/3}\geq(\tfrac{c}{2})^{1/3}\sigma^{2}(L+1)\text{.}$ Therefore $F\asymp\sigma^{2}(L+1)\text{.}$ On the other side, $(L+1)/e^{2}&amp;lt;K+1\leq 2(L+1)/e^{2}$ gives $\sigma^{2}k_{0}\asymp\sigma^{2}(L+1)\text{,}$ and $\min\{V^{2}L,\sigma^{2}k_{0}\}\asymp\sigma^{2}(L+1)$ as well, by $V^{2}L\geq\tfrac{c}{2}\,\sigma^{2}(L+1)\text{.}$ The three cases are exhaustive.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p12" class="ltx_para"&gt;
&lt;p id="S4a.p12.1" class="ltx_p"&gt;On the star, $h_{S_{m}}=1\text{,}$ so only the count $N^{\uparrow}_{T}(0)=m+1$ remains; the profile is exact by Remark 2.1, splitting into a capped and a logarithmic phase, and the case analysis tracks which phase meets the crossing.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p13" class="ltx_para"&gt;
&lt;p id="S4a.p13.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof of Corollary 2.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p14" class="ltx_para"&gt;
&lt;p id="S4a.p14.1" class="ltx_p"&gt;By Theorem 1 and $H_{S_{m}}=2\text{,}$ $R^{*}_{S_{m}}(V,\sigma)\asymp\min\{V^{2},\sigma^{2}k_{0}\}$ after absorbing the factor two; here $n=m+1\text{.}$ By Remark 2.1,&lt;/p&gt;
&lt;table id="S4.Ex9" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\alpha_{k}\ =\ \min\{k,\ \ell(k)\},\qquad\ell(x)\ :=\ \Bigl[\log\frac{m+1}{x}\Bigr]_{+}\quad(x&amp;gt;0),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p14.2" class="ltx_p"&gt;and since $k$ grows while $\ell(k)$ does not, the set $\{k\geq 1:k\leq\ell(k)\}$ is an initial segment of the integers; it contains $1\text{,}$ because $\ell(1)=\log(m+1)&amp;gt;1\text{,}$ and is finite, because $\ell$ vanishes beyond $m+1\text{.}$ With $\bar{k}$ its largest element, the profile has two phases:&lt;/p&gt;
&lt;table id="S4.Ex10" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$V^{2}\delta_{k}\ =\ \sigma^{2}W^{2}\ \ (k\leq\bar{k}),\qquad V^{2}\delta_{k}\ =\ \sigma^{2}W^{2}\,\frac{\ell(k)}{k}\ \ (k&amp;gt;\bar{k}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p14.3" class="ltx_p"&gt;Write&lt;/p&gt;
&lt;table id="S4.Ex11" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Lambda\ :=\ 1+\bigl[\log(m/W)\bigr]_{+},\qquad F\ :=\ \min\bigl\{V^{2},\ \sigma^{2}W\sqrt{\Lambda},\ \sigma^{2}m\bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p14.4" class="ltx_p"&gt;so that $F$ is the right side of Corollary 2.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p15" class="ltx_para"&gt;
&lt;p id="S4a.p15.1" class="ltx_p"&gt;&lt;em id="S4a.p15.1.1" class="ltx_emph ltx_font_italic"&gt;Bounded stars.&lt;/em&gt; For any universal $m_{0}$ the corollary holds for $m\leq m_{0}$ with constants depending only on $m_{0}\text{:}$ from $1\leq k_{0}\leq K+1\leq m_{0}\text{,}$ $\min\{V^{2},\sigma^{2}k_{0}\}\asymp\min\{V^{2},\sigma^{2}\}\text{,}$ while $F\leq\min\{V^{2},\sigma^{2}m\}\leq m_{0}\min\{V^{2},\sigma^{2}\}$ and every branch of $F$ dominates $\min\{V^{2},\sigma^{2}\}\text{,}$ the middle one because $\sigma^{2}W\sqrt{\Lambda}\geq\sigma V\geq\min\{V^{2},\sigma^{2}\}\text{.}$ Now fix a universal $m_{0}$ with the following four properties for every $m\geq m_{0}$ (one may take $m_{0}=\lceil e^{10}\rceil$): (a) $\bar{k}\geq\tfrac{1}{2}\log(m+1)\text{;}$ (b) $\bar{k}+1\leq K\text{;}$ (c) $\log(m/w)\geq\tfrac{1}{2}(1+\log m)$ whenever $1\leq w\leq\sqrt{A_{0}\log(m+1)}\text{;}$ (d) $m\geq 4e^{4}(1+\log m)\text{.}$ Property (a) holds because $k^{\prime}:=\lceil\tfrac{1}{2}\log(m+1)\rceil$ satisfies $k^{\prime}+\log k^{\prime}\leq\log(m+1)$ once $m$ is large, so that $k^{\prime}\leq\ell(k^{\prime})\text{;}$ (b) and (d) compare linear with logarithmic growth; (c) is worst at $w=\sqrt{A_{0}\log(m+1)}\text{,}$ where it reads $\tfrac{1}{2}\log m\geq\tfrac{1}{2}+\tfrac{1}{2}\log(A_{0}\log(m+1))\text{.}$ We also use, unconditionally, $\bar{k}\leq\ell(\bar{k})\leq\log(m+1)\text{.}$ Assume $m\geq m_{0}\text{;}$ there are four cases in $W\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p16" class="ltx_para"&gt;
&lt;p id="S4a.p16.1" class="ltx_p"&gt;&lt;em id="S4a.p16.1.1" class="ltx_emph ltx_font_italic"&gt;Case $W^{2}\leq A_{0}\text{.}$&lt;/em&gt; Since $\bar{k}\geq 1\text{,}$ the capped phase gives $V^{2}\delta_{1}=\sigma^{2}W^{2}\leq A_{0}\sigma^{2}\text{:}$ the crossing clause fires at once and $k_{0}=1\text{.}$ Then $\min\{V^{2},\sigma^{2}k_{0}\}\in[V^{2}/A_{0},\,V^{2}]\text{.}$ And $F\asymp V^{2}\text{:}$ it is at most $V^{2}\text{,}$ while $\sigma^{2}W\sqrt{\Lambda}\geq\sigma^{2}W\geq V^{2}/\sqrt{A_{0}}$ and $\sigma^{2}m\geq 2\sigma^{2}\geq 2V^{2}/A_{0}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p17" class="ltx_para"&gt;
&lt;p id="S4a.p17.1" class="ltx_p"&gt;&lt;em id="S4a.p17.1.1" class="ltx_emph ltx_font_italic"&gt;Case $A_{0}&amp;lt;W^{2}\leq A_{0}\bar{k}\text{.}$&lt;/em&gt; Every integer $k&amp;lt;W^{2}/A_{0}$ has $k&amp;lt;\bar{k}\text{,}$ so the capped phase gives $V^{2}\delta_{k}=\sigma^{2}W^{2}&amp;gt;A_{0}\sigma^{2}k\text{,}$ and $k&amp;lt;\bar{k}\leq K$ keeps the dimension clause silent: no clause fires below $W^{2}/A_{0}\text{.}$ At $k_{1}:=\lceil W^{2}/A_{0}\rceil\text{,}$ which is at most $\bar{k}\leq K$ because $W^{2}/A_{0}\leq\bar{k}$ and $\bar{k}$ is an integer, the bound $\delta_{k_{1}}\leq 1$ gives $V^{2}\delta_{k_{1}}\leq\sigma^{2}W^{2}\leq A_{0}\sigma^{2}k_{1}\text{.}$ Hence&lt;/p&gt;
&lt;table id="S4.Ex12" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$k_{0}\ =\ \Bigl\lceil\frac{W^{2}}{A_{0}}\Bigr\rceil\ \in\ \Bigl[\frac{W^{2}}{A_{0}},\ \frac{2W^{2}}{A_{0}}\Bigr],\qquad\sigma^{2}k_{0}\ \asymp\ V^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p17.2" class="ltx_p"&gt;so $\min\{V^{2},\sigma^{2}k_{0}\}\asymp V^{2}\text{.}$ For $F\asymp V^{2}\text{:}$ the case hypothesis and $\bar{k}\leq\log(m+1)$ give $W\leq\sqrt{A_{0}\log(m+1)}\text{,}$ so property (c) yields $\Lambda\geq\tfrac{1}{2}(1+\log m)$ and&lt;/p&gt;
&lt;table id="S4.Ex13" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sigma^{2}W\sqrt{\Lambda}\ \geq\ V^{2}\,\frac{\sqrt{\Lambda}}{W}\ \geq\ V^{2}\,\frac{\sqrt{(1+\log m)/2}}{\sqrt{A_{0}(1+\log m)}}\ =\ \frac{V^{2}}{\sqrt{2A_{0}}},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p17.3" class="ltx_p"&gt;the denominator by $\log(m+1)\leq 1+\log m\text{.}$ Also $\sigma^{2}m\geq\sigma^{2}W^{2}=V^{2}\text{,}$ since property (d) gives $m\geq A_{0}\log(m+1)\geq W^{2}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p18" class="ltx_para"&gt;
&lt;p id="S4a.p18.1" class="ltx_p"&gt;&lt;em id="S4a.p18.1.1" class="ltx_emph ltx_font_italic"&gt;Case $W^{2}&amp;gt;A_{0}\bar{k}$ and $W&amp;lt;m\text{.}$&lt;/em&gt; Now $W&amp;gt;\sqrt{A_{0}}$ and $\log(m/W)&amp;gt;0\text{,}$ so $\Lambda=1+\log(m/W)\text{.}$ Set&lt;/p&gt;
&lt;table id="S4.Ex14" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\kappa\ :=\ W\sqrt{\Lambda},\qquad c_{1}\ :=\ \frac{1}{2\sqrt{A_{0}}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p18.2" class="ltx_p"&gt;&lt;em id="S4a.p18.2.1" class="ltx_emph ltx_font_italic"&gt;No crossing below $c_{1}\kappa\text{:}$&lt;/em&gt; fix an integer $k\leq\min\{c_{1}\kappa,K\}\text{,}$ so that the dimension clause is silent at $k\text{.}$ If $k\leq\bar{k}\text{,}$ the capped phase and the case hypothesis give $V^{2}\delta_{k}=\sigma^{2}W^{2}&amp;gt;A_{0}\sigma^{2}\bar{k}\geq A_{0}\sigma^{2}k\text{.}$ If $\bar{k}&amp;lt;k\leq c_{1}\kappa\text{,}$ monotonicity of $\ell$ gives&lt;/p&gt;
&lt;table id="S4.Ex15" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\ell(k)\ \geq\ \ell(c_{1}\kappa)\ \geq\ \log\frac{m}{c_{1}W\sqrt{\Lambda}}\ =\ (\Lambda-1)+\log(2\sqrt{A_{0}})-\tfrac{1}{2}\log\Lambda\ \geq\ \frac{\Lambda}{4}+1,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p18.3" class="ltx_p"&gt;the last step because $\log(2\sqrt{A_{0}})=\log 24&amp;gt;3$ and $\tfrac{3}{4}\Lambda+1\geq\tfrac{1}{2}\log\Lambda$ for every $\Lambda\geq 1\text{;}$ hence, using $A_{0}c_{1}^{2}=\tfrac{1}{4}\text{,}$&lt;/p&gt;
&lt;table id="S4.Ex16" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$V^{2}\delta_{k}\ =\ \sigma^{2}\,\frac{W^{2}\ell(k)}{k}\ &amp;gt;\ \sigma^{2}\,\frac{W^{2}\Lambda}{4k}\ =\ A_{0}\sigma^{2}\,\frac{(c_{1}\kappa)^{2}}{k}\ \geq\ A_{0}\sigma^{2}k.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p18.4" class="ltx_p"&gt;So no clause fires at $k\text{,}$ and $k_{0}&amp;gt;\min\{c_{1}\kappa,K\}\text{.}$ &lt;em id="S4a.p18.4.1" class="ltx_emph ltx_font_italic"&gt;Crossing by $\lceil\kappa\rceil\text{:}$&lt;/em&gt; if $\lceil\kappa\rceil\leq K\text{,}$ then $k_{1}:=\lceil\kappa\rceil$ has&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="S4.EGx3"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S4.Ex17"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S4.Ex18"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{gathered}
\displaystyle\ell(k_{1})\ \leq\ \Bigl[\log\frac{2m}{\kappa}\Bigr]_{+}\ \leq\ \log 2+(\Lambda-1)-\tfrac{1}{2}\log\Lambda\ &amp;lt;\ \Lambda, \\
\displaystyle V^{2}\delta_{k_{1}}\ \leq\ \sigma^{2}\,\frac{W^{2}\Lambda}{k_{1}}\ \leq\ \sigma^{2}\kappa\ \leq\ A_{0}\sigma^{2}k_{1},
\end{gathered}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p id="S4a.p18.5" class="ltx_p"&gt;so the crossing clause fires by $k_{1}$ and $k_{0}\leq\lceil\kappa\rceil\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p19" class="ltx_para"&gt;
&lt;p id="S4a.p19.1" class="ltx_p"&gt;If $\kappa\leq K\text{:}$ then $c_{1}\kappa&amp;lt;k_{0}\leq\lceil\kappa\rceil\leq 2\kappa\text{,}$ using $\kappa\geq W&amp;gt;1\text{,}$ so $\sigma^{2}k_{0}\asymp\sigma^{2}\kappa=\sigma^{2}W\sqrt{\Lambda}\text{,}$ the middle branch of $F\text{.}$ Moreover, by property (a) and the case hypothesis,&lt;/p&gt;
&lt;table id="S4.Ex19" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Lambda\ \leq\ 1+\log m\ \leq\ 1+2\bar{k}\ &amp;lt;\ 1+\frac{2W^{2}}{A_{0}}\ \leq\ \frac{3W^{2}}{A_{0}},\qquad\text{so}\qquad\sigma^{2}\kappa\ \leq\ \sqrt{\tfrac{3}{A_{0}}}\,V^{2}\ \leq\ \tfrac{1}{6}\,V^{2}:$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p19.2" class="ltx_p"&gt;hence $\min\{V^{2},\sigma^{2}k_{0}\}\asymp\sigma^{2}\kappa\text{,}$ and $F\asymp\sigma^{2}\kappa$ as well: the first branch is at least $6\sigma^{2}\kappa\text{,}$ and the third is at least the second because $\kappa\leq K\leq m\text{.}$ If $\kappa&amp;gt;K\text{:}$ then $k_{0}&amp;gt;\min\{c_{1}\kappa,K\}\geq c_{1}K$ and $k_{0}\leq K+1\leq 2K\text{,}$ so $\sigma^{2}k_{0}\asymp\sigma^{2}K\asymp\sigma^{2}m\text{,}$ using $K\geq(m+1)/(2e^{2})\text{.}$ Also $V^{2}&amp;gt;\sigma^{2}m\text{:}$ squaring $W\sqrt{\Lambda}=\kappa&amp;gt;K\geq m/(2e^{2})$ gives&lt;/p&gt;
&lt;table id="S4.Ex20" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$V^{2}\ =\ \sigma^{2}W^{2}\ &amp;gt;\ \frac{\sigma^{2}m^{2}}{4e^{4}\Lambda}\ \geq\ \sigma^{2}m,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p19.3" class="ltx_p"&gt;by property (d) and $\Lambda\leq 1+\log m\text{.}$ Hence $\min\{V^{2},\sigma^{2}k_{0}\}\asymp\sigma^{2}m\text{,}$ and $F\asymp\sigma^{2}m\text{:}$ its first branch exceeds $\sigma^{2}m\text{,}$ and its second is $\sigma^{2}\kappa&amp;gt;\sigma^{2}K\geq\sigma^{2}m/(2e^{2})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p20" class="ltx_para"&gt;
&lt;p id="S4a.p20.1" class="ltx_p"&gt;&lt;em id="S4a.p20.1.1" class="ltx_emph ltx_font_italic"&gt;Case $W\geq m\text{.}$&lt;/em&gt; Then $\Lambda=1$ and $F=\sigma^{2}\min\{W^{2},W,m\}=\sigma^{2}m\text{.}$ For every integer $k\leq K\text{,}$&lt;/p&gt;
&lt;table id="S4.Ex21" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\ell(k)\ \geq\ \ell(K)\ =\ \log\frac{m+1}{K}\ \geq\ \log C_{\star}\ =\ 2,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p20.2" class="ltx_p"&gt;so $\min\{k,\ell(k)\}\geq 1$ and $V^{2}\delta_{k}\geq\sigma^{2}W^{2}/k&amp;gt;A_{0}\sigma^{2}k$ whenever $k&amp;lt;W/\sqrt{A_{0}}\text{:}$ no clause fires below $\min\{W/\sqrt{A_{0}},\,K+1\}\geq m/12\text{,}$ the first entry because $W\geq m$ and $\sqrt{A_{0}}=12\text{,}$ the second because $K+1&amp;gt;(m+1)/e^{2}$ and $e^{2}&amp;lt;12\text{.}$ Hence $m/12\leq k_{0}\leq K+1\leq m$ and $\sigma^{2}k_{0}\asymp\sigma^{2}m\text{.}$ Since $V^{2}=\sigma^{2}W^{2}\geq\sigma^{2}m^{2}\geq\sigma^{2}m\text{,}$ also $\min\{V^{2},\sigma^{2}k_{0}\}\asymp\sigma^{2}m\asymp F\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p21" class="ltx_para"&gt;
&lt;p id="S4a.p21.1" class="ltx_p"&gt;The four cases cover $m\geq m_{0}\text{:}$ if $W\geq m$ the fourth applies, and otherwise $W^{2}\leq A_{0}\text{,}$ $A_{0}&amp;lt;W^{2}\leq A_{0}\bar{k}\text{,}$ and $W^{2}&amp;gt;A_{0}\bar{k}$ partition the range.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p22" class="ltx_para"&gt;
&lt;p id="S4a.p22.1" class="ltx_p"&gt;On the complete binary tree the covering counts decay exponentially in the radius. Radius therefore trades against entropy linearly, and the profile is governed by $\log(n/k)\text{:}$ quadratic in that logarithm when the budget exceeds it, and truncated at the budget otherwise.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmlemma2" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmlemma2.2" class="ltx_text ltx_font_bold"&gt;Lemma S.4.2&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmlemma2.3" class="ltx_text ltx_font_bold"&gt; (Binary profile).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmlemma2.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmlemma2.p1.1" class="ltx_p"&gt;&lt;span id="S4.Thmlemma2.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $B_{h}$ be the complete binary tree of height $h\geq 1\text{,}$ with $n=2^{h+1}-1$ vertices, $h_{B_{h}}=h\text{,}$ and $H_{B_{h}}=2h\text{.}$ For integers $0\leq q&amp;lt;h\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex22" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$2^{h-q}\ \leq\ N^{\uparrow}_{T}(q)\ \leq\ 3\cdot 2^{h-q},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.Thmlemma2.p1.2" class="ltx_p"&gt;&lt;span id="S4.Thmlemma2.p1.2.1" class="ltx_text ltx_font_italic"&gt;and for every integer $1\leq k\leq n/C_{\star}\text{,}$ with $\beta:=\log(n/k)\text{,}$ which is at least $2$ in this range,&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex23" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$c_{B}\,\beta\min\{k,\beta\}\ \leq\ \alpha_{k}(B_{h})\ \leq\ C_{B}\,\beta\min\{k,\beta\},\qquad c_{B}:=\frac{1}{8\log 2},\quad C_{B}:=3.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4a.p23" class="ltx_para"&gt;
&lt;p id="S4a.p23.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p24" class="ltx_para"&gt;
&lt;p id="S4a.p24.1" class="ltx_p"&gt;&lt;em id="S4a.p24.1.1" class="ltx_emph ltx_font_italic"&gt;Covering counts.&lt;/em&gt; An ancestor of a depth-$h$ leaf within distance $q$ has depth at least $h-q\text{,}$ and a vertex at depth $d\geq h-q$ has $2^{h-d}\leq 2^{q}$ leaf descendants; covering all $2^{h}$ leaves therefore needs at least $2^{h-q}$ centers. Conversely, let $R$ consist of the root together with every vertex whose depth is of the form $D_{j}:=h-q-j(q+1)\geq 0\text{,}$ $j\geq 0\text{.}$ A selected vertex covers exactly the depths $D_{j},\dots,D_{j}+q$ of its subtree; consecutive selected depths differ by $q+1\text{,}$ so the covered bands tile $\{D_{j^{*}},\dots,h\}\text{,}$ where $D_{j^{*}}$ is the smallest selected depth, and $D_{j^{*}}\leq q\text{,}$ since otherwise $D_{j^{*}}-(q+1)\geq 0$ would be selected as well; the root covers the depths below $D_{j^{*}}\text{.}$ Hence $R$ is an ancestor $q$-net, of size&lt;/p&gt;
&lt;table id="S4.Ex24" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$1+\sum_{j:\,D_{j}\geq 0}2^{D_{j}}\ \leq\ 1+2^{h-q}\sum_{j\geq 0}2^{-j(q+1)}\ \leq\ 1+2\cdot 2^{h-q}\ \leq\ 3\cdot 2^{h-q}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S4a.p25" class="ltx_para"&gt;
&lt;p id="S4a.p25.1" class="ltx_p"&gt;&lt;em id="S4a.p25.1.1" class="ltx_emph ltx_font_italic"&gt;Profile, upper bound.&lt;/em&gt; Since $2^{h+1}=n+1$ and $\log(n+1)\leq\log n+\tfrac{1}{3}$ for $n\geq 3\text{,}$ every integer $0\leq q&amp;lt;h$ has, with $y:=q+1\text{,}$&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="S4.EGx4"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S4.Ex25"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S4.Ex26"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle\log\frac{N^{\uparrow}_{T}(q)}{k}\space &amp;amp; \displaystyle\leq\ (h-q)\log 2+\log 3-\log k \\
&amp;amp; \displaystyle=\ \log(n+1)+\log 3-\log k-y\log 2\ \leq\ \beta+\tfrac{3}{2}-y\log 2,
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p id="S4a.p25.2" class="ltx_p"&gt;and $\beta+\tfrac{3}{2}\leq\tfrac{7}{4}\beta$ because $\beta\geq 2\text{.}$ Substituting $u:=y\log 2$ in the discrete formula (2.3) and writing $B:=\tfrac{7}{4}\beta\text{,}$&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="S4.EGx5"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S4.Ex27"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S4.Ex28"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle\alpha_{k}(B_{h})\ \leq\ \frac{1}{\log 2}\,\sup_{u&amp;gt;0}\ u\,\min\bigl\{k,\ (B-u)_{+}\bigr\}\space &amp;amp; \displaystyle\leq\ \frac{1}{\log 2}\,B\,\min\Bigl\{\frac{B}{4},\ k\Bigr\} \\
&amp;amp; \displaystyle\leq\ \frac{7}{4\log 2}\,\beta\min\{k,\beta\}\ \leq\ C_{B}\,\beta\min\{k,\beta\}:
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p id="S4a.p25.3" class="ltx_p"&gt;if $k\geq B/4$ the supremum is at most $\sup_{u}u(B-u)_{+}=B^{2}/4\text{,}$ while if $k&amp;lt;B/4$ the product is at most $uk\leq(B-k)k$ for $u\leq B-k\text{,}$ and at most $u(B-u)_{+}\leq(B-k)k$ beyond, since $u(B-u)_{+}$ is nonincreasing past $B/2&amp;lt;B-k\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p26" class="ltx_para"&gt;
&lt;p id="S4a.p26.1" class="ltx_p"&gt;&lt;em id="S4a.p26.1.1" class="ltx_emph ltx_font_italic"&gt;Profile, lower bound.&lt;/em&gt; Set $y:=\lfloor\beta/(2\log 2)\rfloor\text{.}$ From $\beta\geq 2\text{:}$ $\beta/(2\log 2)\geq 1/\log 2&amp;gt;1\text{,}$ so $y\geq 1$ and, halving, $y\geq\beta/(4\log 2)\text{;}$ and $y\leq\beta/(2\log 2)\leq\log n/(2\log 2)\leq(h+1)/2\leq h\text{,}$ so $q:=y-1$ is an admissible radius. At this radius,&lt;/p&gt;
&lt;table id="S4.Ex29" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log\frac{N^{\uparrow}_{T}(q)}{k}\ \geq\ (h-q)\log 2-\log k\ =\ \log(n+1)-\log k-y\log 2\ \geq\ \beta-\frac{\beta}{2}\ =\ \frac{\beta}{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p26.2" class="ltx_p"&gt;so, using $\min\{k,\beta/2\}\geq\tfrac{1}{2}\min\{k,\beta\}\text{,}$ the term at $q$ is at least&lt;/p&gt;
&lt;table id="S4.Ex30" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$y\,\min\Bigl\{k,\ \frac{\beta}{2}\Bigr\}\ \geq\ \frac{\beta}{4\log 2}\cdot\frac{\min\{k,\beta\}}{2}\ =\ c_{B}\,\beta\min\{k,\beta\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S4a.p27" class="ltx_para"&gt;
&lt;p id="S4a.p27.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof of Corollary 3.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p28" class="ltx_para"&gt;
&lt;p id="S4a.p28.1" class="ltx_p"&gt;By Theorem 1 and $H_{B_{h}}=2h\text{,}$ $R^{*}_{B_{h}}(V,\sigma)\asymp\min\{V^{2}h,\sigma^{2}k_{0}\}$ after absorbing the factor two. Write $\beta(k):=\log(n/k)\text{,}$ as in &lt;a href="#S4.Thmlemma2" title="Lemma S.4.2 (Binary profile). ‣ S.4 Benchmark and Broom Profiles ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.4.2&lt;/span&gt;&lt;/a&gt;, and&lt;/p&gt;
&lt;table id="S4.Ex31" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Lambda\ :=\ 1+\bigl[\log(n/W)\bigr]_{+},\qquad F\ :=\ \sigma^{2}\min\bigl\{W^{2}h,\ W\Lambda,\ n\bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p28.2" class="ltx_p"&gt;the right side of Corollary 3.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p29" class="ltx_para"&gt;
&lt;p id="S4a.p29.1" class="ltx_p"&gt;&lt;em id="S4a.p29.1.1" class="ltx_emph ltx_font_italic"&gt;Bounded trees.&lt;/em&gt; For any universal $n_{0}$ the corollary holds for $n\leq n_{0}$ with constants depending only on $n_{0}\text{:}$ from $1\leq k_{0}\leq K+1\leq n_{0}\text{,}$ $\min\{V^{2}h,\sigma^{2}k_{0}\}\asymp\min\{V^{2}h,\sigma^{2}\}\text{,}$ while $F\leq\min\{V^{2}h,\sigma^{2}n\}\leq n_{0}\min\{V^{2}h,\sigma^{2}\}$ and every branch of $F$ dominates $\min\{V^{2}h,\sigma^{2}\}\text{;}$ for the middle branch, when $W\leq 1$ this is $\sigma^{2}W\Lambda\geq\log 2\cdot\sigma^{2}W^{2}h\text{,}$ using $W\geq W^{2}$ and $\Lambda\geq 1+\log n\geq h\log 2\text{,}$ and when $W&amp;gt;1$ it is $\sigma^{2}W\Lambda\geq\sigma^{2}\text{.}$ Now fix a universal $n_{0}$ (one may take $n_{0}=2^{7}$) such that for every $n\geq n_{0}\text{:}$ $h\leq K\text{,}$ $n\leq 2e^{2}K\text{,}$ and $\log h\leq\tfrac{\log 2}{2}\,h\text{.}$ Assume $n\geq n_{0}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p30" class="ltx_para"&gt;
&lt;p id="S4a.p30.1" class="ltx_p"&gt;&lt;em id="S4a.p30.1.1" class="ltx_emph ltx_font_italic"&gt;The diameter regime $W\leq 1\text{.}$&lt;/em&gt; We claim $k_{0}\geq c\,W^{2}h$ with $c:=c_{B}\log 2/(4A_{0})\text{.}$ This is trivial when $cW^{2}h&amp;lt;1\text{;}$ otherwise fix an integer $k\leq cW^{2}h\leq ch\text{.}$ Then&lt;/p&gt;
&lt;table id="S4.Ex32" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\beta(k)\ \geq\ \log\frac{2^{h}}{h}\ =\ h\log 2-\log h\ \geq\ \frac{\log 2}{2}\,h\ \geq\ k,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p30.2" class="ltx_p"&gt;the last step because $c\leq\log 2/2\text{;}$ so &lt;a href="#S4.Thmlemma2" title="Lemma S.4.2 (Binary profile). ‣ S.4 Benchmark and Broom Profiles ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.4.2&lt;/span&gt;&lt;/a&gt; gives&lt;/p&gt;
&lt;table id="S4.Ex33" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$V^{2}\delta_{k}\ \geq\ c_{B}\,\sigma^{2}W^{2}\beta(k)\ \geq\ \frac{c_{B}\log 2}{2}\,\sigma^{2}W^{2}h\ &amp;gt;\ A_{0}\sigma^{2}\,cW^{2}h\ \geq\ A_{0}\sigma^{2}k,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p30.3" class="ltx_p"&gt;and the dimension clause is silent at $k\leq h\leq K\text{:}$ no clause fires at any $k\leq cW^{2}h\text{,}$ proving the claim. In either case $\sigma^{2}k_{0}\geq c\,V^{2}h\text{,}$ so&lt;/p&gt;
&lt;table id="S4.Ex34" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\min\{V^{2}h,\ \sigma^{2}k_{0}\}\ \asymp\ V^{2}h.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p30.4" class="ltx_p"&gt;And $F\asymp V^{2}h\text{:}$ its first branch is $V^{2}h\text{;}$ its middle branch dominates $\log 2\cdot V^{2}h$ as above; and $\sigma^{2}n\geq\sigma^{2}h\geq V^{2}h\text{.}$ This proves the corollary for $W\leq 1\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p31" class="ltx_para"&gt;
&lt;p id="S4a.p31.1" class="ltx_p"&gt;&lt;em id="S4a.p31.1.1" class="ltx_emph ltx_font_italic"&gt;The entropy and dimension regimes $W&amp;gt;1\text{.}$&lt;/em&gt; Put $\kappa:=W\Lambda\geq 1\text{.}$ First, if $\lceil\kappa\rceil\leq K\text{,}$ the crossing clause fires by $k_{1}:=\lceil\kappa\rceil\text{:}$ there $W\leq k_{1}\leq K\leq n\text{,}$ so $\beta(k_{1})\leq\log(n/W)\leq\Lambda\text{,}$ and &lt;a href="#S4.Thmlemma2" title="Lemma S.4.2 (Binary profile). ‣ S.4 Benchmark and Broom Profiles ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.4.2&lt;/span&gt;&lt;/a&gt; gives&lt;/p&gt;
&lt;table id="S4.Ex35" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$V^{2}\delta_{k_{1}}\ \leq\ C_{B}\,\sigma^{2}\,\frac{W^{2}\beta(k_{1})^{2}}{k_{1}}\ \leq\ C_{B}\,\sigma^{2}\,\frac{W^{2}\Lambda^{2}}{\kappa}\ =\ C_{B}\,\sigma^{2}\kappa\ \leq\ A_{0}\sigma^{2}k_{1};$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p31.2" class="ltx_p"&gt;hence $k_{0}\leq\lceil\kappa\rceil$ whenever $\lceil\kappa\rceil\leq K\text{.}$ Second, with $c:=c_{B}/(8A_{0})\text{,}$ no clause fires at any integer $k\leq\min\{c\kappa,K\}\text{.}$ The dimension clause is silent since $k\leq K\text{.}$ For the crossing clause, note first that $\beta(k)\geq\Lambda/4\text{:}$ if $W\geq n$ this reads $\beta(k)\geq 2&amp;gt;\tfrac{1}{4}=\Lambda/4\text{,}$ and if $W&amp;lt;n\text{,}$ then $k\leq cW\Lambda$ with $c\leq 1$ gives&lt;/p&gt;
&lt;table id="S4.Ex36" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\beta(k)\ \geq\ \log\frac{n}{W\Lambda}\ =\ (\Lambda-1)-\log\Lambda\ \geq\ \frac{\Lambda}{4}\quad(\Lambda\geq 3),\qquad\beta(k)\ \geq\ 2\ \geq\ \frac{3}{4}\ &amp;gt;\ \frac{\Lambda}{4}\quad(\Lambda&amp;lt;3),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p31.3" class="ltx_p"&gt;the first branch because $\tfrac{3}{4}\Lambda\geq 1+\log\Lambda$ for $\Lambda\geq 3\text{.}$ Now split on $\min\{k,\beta(k)\}\text{.}$ If $k\leq\beta(k)\text{,}$ then, using $k\leq cW\Lambda\leq cW^{2}\Lambda$ and $A_{0}c=c_{B}/8\text{,}$&lt;/p&gt;
&lt;table id="S4.Ex37" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$V^{2}\delta_{k}\ \geq\ c_{B}\,\sigma^{2}W^{2}\beta(k)\ \geq\ \frac{c_{B}}{4}\,\sigma^{2}W^{2}\Lambda\ &amp;gt;\ A_{0}\sigma^{2}\,cW^{2}\Lambda\ \geq\ A_{0}\sigma^{2}k.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p31.4" class="ltx_p"&gt;If $k&amp;gt;\beta(k)\text{,}$ then&lt;/p&gt;
&lt;table id="S4.Ex38" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$V^{2}\delta_{k}\ \geq\ c_{B}\,\sigma^{2}\,\frac{W^{2}\beta(k)^{2}}{k}\ \geq\ \frac{c_{B}}{16}\,\sigma^{2}\,\frac{\kappa^{2}}{k}\ &amp;gt;\ A_{0}\sigma^{2}k,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p31.5" class="ltx_p"&gt;the last step because $k\leq c\kappa$ and $c=c_{B}/(8A_{0})&amp;lt;\sqrt{c_{B}}/(4\sqrt{A_{0}})\text{,}$ so that $k^{2}\leq c^{2}\kappa^{2}&amp;lt;\tfrac{c_{B}}{16A_{0}}\kappa^{2}\text{.}$ Hence $k_{0}&amp;gt;\min\{c\kappa,K\}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p32" class="ltx_para"&gt;
&lt;p id="S4a.p32.1" class="ltx_p"&gt;Combining the two tests: if $\kappa\leq K\text{,}$ then $c\kappa&amp;lt;k_{0}\leq\lceil\kappa\rceil\leq 2\kappa\text{,}$ so $\sigma^{2}k_{0}\asymp\sigma^{2}\kappa=\sigma^{2}\min\{W\Lambda,n\}\text{,}$ using $\kappa\leq K\leq n\text{;}$ if $\kappa&amp;gt;K\text{,}$ then $k_{0}&amp;gt;\min\{c\kappa,K\}\geq cK$ and $k_{0}\leq K+1\leq 2K\text{,}$ so $\sigma^{2}k_{0}\asymp\sigma^{2}K\asymp\sigma^{2}n\asymp\sigma^{2}\min\{W\Lambda,n\}\text{,}$ using $n\leq 2e^{2}K\text{.}$ In both regimes&lt;/p&gt;
&lt;table id="S4.Ex39" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sigma^{2}k_{0}\ \asymp\ \sigma^{2}\min\{W\Lambda,\ n\},\quad\text{hence}\quad\min\{V^{2}h,\ \sigma^{2}k_{0}\}\ \asymp\ \sigma^{2}\min\{W^{2}h,\ W\Lambda,\ n\}\ =\ F,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p32.2" class="ltx_p"&gt;which proves the corollary for $W&amp;gt;1\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p33" class="ltx_para"&gt;
&lt;p id="S4a.p33.1" class="ltx_p"&gt;It remains to prove the profile bounds (5.8) for the broom $T_{L}$ of Section 5, the handle $o=v_{0},\dots,v_{L}$ with $m$ leaf children at $v_{L}\text{,}$ so that $h_{T_{L}}=L+1\text{.}$ Its ancestor-covering numbers were computed in (5.7) there: $N^{\uparrow}_{T}(0)=n\text{,}$ and $N^{\uparrow}_{T}(q)=\lceil(L+2)/(q+1)\rceil$ for integers $1\leq q\leq L\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmlemma3" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S4.Thmlemma3.2" class="ltx_text ltx_font_bold"&gt;Lemma S.4.3&lt;/span&gt;&lt;/span&gt;&lt;span id="S4.Thmlemma3.3" class="ltx_text ltx_font_bold"&gt; (Broom profile).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S4.Thmlemma3.p1" class="ltx_para"&gt;
&lt;p id="S4.Thmlemma3.p1.1" class="ltx_p"&gt;&lt;span id="S4.Thmlemma3.p1.1.1" class="ltx_text ltx_font_italic"&gt;For the broom $T_{L}$ with $L\geq 1$ and every integer $k\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex40" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\delta_{k}(T_{L})\ \leq\ \max\Bigl\{1,\ \frac{2(L+2)}{ek^{2}}\Bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4.Thmlemma3.p1.2" class="ltx_p"&gt;&lt;span id="S4.Thmlemma3.p1.2.1" class="ltx_text ltx_font_italic"&gt;and whenever $k\leq(L+2)/(2e)\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex41" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\delta_{k}(T_{L})\ \geq\ \frac{L+2}{2ek^{2}}\,.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4a.p34" class="ltx_para"&gt;
&lt;p id="S4a.p34.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p35" class="ltx_para"&gt;
&lt;p id="S4a.p35.1" class="ltx_p"&gt;By the discrete formula (2.3), with $h_{T_{L}}=L+1\text{,}$&lt;/p&gt;
&lt;table id="S4.Ex42" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\alpha_{k}(T_{L})\ =\ \max_{0\leq q\leq L}\ (q+1)\,\min\Bigl\{k,\ \Bigl[\log\frac{N^{\uparrow}_{T}(q)}{k}\Bigr]_{+}\Bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S4a.p36" class="ltx_para"&gt;
&lt;p id="S4a.p36.1" class="ltx_p"&gt;&lt;em id="S4a.p36.1.1" class="ltx_emph ltx_font_italic"&gt;Upper bound.&lt;/em&gt; The term at $q=0$ is at most $k$ and contributes at most $1$ to $\delta_{k}=\alpha_{k}/k\text{.}$ Consider $1\leq q\leq L$ with a nonvanishing term and put $y:=q+1\text{.}$ Then $\lceil(L+2)/y\rceil&amp;gt;k\text{,}$ hence $(L+2)/y&amp;gt;k\text{,}$ since a real number at most the integer $k$ has ceiling at most $k\text{;}$ consequently&lt;/p&gt;
&lt;table id="S4.Ex43" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$N^{\uparrow}_{T}(q)\ &amp;lt;\ \frac{L+2}{y}+1\ &amp;lt;\ \frac{2(L+2)}{y}\,,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p36.2" class="ltx_p"&gt;and the term is at most&lt;/p&gt;
&lt;table id="S4.Ex44" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$y\,\log\frac{2(L+2)}{ky}\ \leq\ \sup_{u&amp;gt;0}\ u\log\frac{A}{u}\ =\ \frac{A}{e}\,,\qquad A:=\frac{2(L+2)}{k}\,,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p36.3" class="ltx_p"&gt;the supremum attained at $u=A/e\text{.}$ Hence $\alpha_{k}\leq\max\{k,\ 2(L+2)/(ek)\}\text{,}$ and dividing by $k$ proves the upper bound.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p37" class="ltx_para"&gt;
&lt;p id="S4a.p37.1" class="ltx_p"&gt;&lt;em id="S4a.p37.1.1" class="ltx_emph ltx_font_italic"&gt;Lower bound.&lt;/em&gt; Set $x:=(L+2)/(ek)\text{,}$ at least $2$ in the stated range, and $y:=\lfloor x\rfloor\text{,}$ so that $y\geq 2$ and $y&amp;gt;x-1\geq x/2\text{.}$ The radius $q:=y-1$ lies in $[1,L]\text{:}$ $q\geq 1$ since $y\geq 2\text{,}$ and $q\leq L$ since $y\leq x\leq(L+2)/e&amp;lt;L+1$ for every $L\geq 1\text{.}$ Then&lt;/p&gt;
&lt;table id="S4.Ex45" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$N^{\uparrow}_{T}(q)\ =\ \Bigl\lceil\frac{L+2}{y}\Bigr\rceil\ \geq\ \frac{L+2}{y}\ \geq\ \frac{L+2}{x}\ =\ ek,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p37.2" class="ltx_p"&gt;so $[\log(N^{\uparrow}_{T}(q)/k)]_{+}\geq 1\text{,}$ and the term at $q$ is at least $y\cdot\min\{k,1\}=y\geq x/2\text{.}$ Hence $\alpha_{k}\geq(L+2)/(2ek)\text{,}$ and dividing by $k$ proves the lower bound.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p38" class="ltx_para"&gt;
&lt;p id="S4a.p38.1" class="ltx_p"&gt;Four computations from the lower-bound proof of Theorem 5 remain, in the notation fixed there: $V=L^{1/4}\text{,}$ $\sigma=1\text{,}$ $m\geq e^{20L^{5/2}}\text{,}$ and the statistics $W=\sum_{j=1}^{L}Z_{v_{j}}\text{,}$ $Q=\sum_{j=1}^{L}[Z_{v_{j}}]_{+}^{2}\text{,}$ $M=\max_{1\leq i\leq m}Z_{w_{i}}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p39" class="ltx_para"&gt;
&lt;p id="S4a.p39.1" class="ltx_p"&gt;&lt;em id="S4a.p39.1.1" class="ltx_emph ltx_font_italic"&gt;The covering counts (5.7).&lt;/em&gt; For the lower bound, the root-to-leaf path $v_{0},\dots,v_{L},w_{1}$ has $L+2$ vertices; an ancestor center on it covers at most $j+1$ consecutive ones, and a center at any other leaf covers none of them, so $N^{\uparrow}_{T}(j)\geq\lceil(L+2)/(j+1)\rceil\text{.}$ For the upper bound, the single center $v_{L+1-j}$ covers $v_{L+1-j},\dots,v_{L}$ together with every leaf, each at distance exactly $j\text{,}$ and $\lceil(L-j+1)/(j+1)\rceil$ further centers along the prefix $v_{0},\dots,v_{L-j}$ complete an ancestor $j$-net; the total is $1+\lceil(L-j+1)/(j+1)\rceil=\lceil(L+2)/(j+1)\rceil\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p40" class="ltx_para"&gt;
&lt;p id="S4a.p40.1" class="ltx_p"&gt;&lt;em id="S4a.p40.1.1" class="ltx_emph ltx_font_italic"&gt;The cap (5.3).&lt;/em&gt; For $h_{j}\geq 0$ the handle term obeys $2Z_{v_{j}}h_{j}-h_{j}^{2}\leq[Z_{v_{j}}]_{+}^{2}\text{:}$ the left side is nonpositive when $Z_{v_{j}}\leq 0\text{,}$ and equals $Z_{v_{j}}^{2}-(h_{j}-Z_{v_{j}})^{2}$ otherwise. The leaf part is at most $2M\sum_{i}\ell_{i}\leq 2Mh_{L}\leq MV$ by (5.1), the last step because the case under consideration has $h_{L}\leq V/2\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p41" class="ltx_para"&gt;
&lt;p id="S4a.p41.1" class="ltx_p"&gt;&lt;em id="S4a.p41.1.1" class="ltx_emph ltx_font_italic"&gt;The forcing event $E=\{W\geq-2\sqrt{L}\}\cap\{Q\leq 2L\}\cap\{M\geq 4L^{5/4}\}$ has probability at least $\tfrac{3}{8}\text{.}$&lt;/em&gt; On $E\text{,}$&lt;/p&gt;
&lt;table id="S4.Ex46" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(L+1)V-2W+\frac{Q}{V}\ \leq\ L^{5/4}+L^{1/4}+4L^{1/2}+2L^{3/4}\ &amp;lt;\ 4L^{5/4}\ \leq\ M,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p41.2" class="ltx_p"&gt;the middle inequality being equivalent to $L^{-1}+4L^{-3/4}+2L^{-1/2}&amp;lt;3\text{,}$ whose left side is decreasing in $L$ and below $3$ at $L=4\text{;}$ so the forcing inequality (5.4) holds on $E\text{.}$ Since $W\sim N(0,L)\text{,}$ Markov’s inequality applied to $W^{2}$ gives $\mathbb{P}(W&amp;lt;-2\sqrt{L})\leq\tfrac{1}{4}\text{;}$ since $\mathbb{E}Q=L/2\text{,}$ by $\mathbb{E}[Z_{v_{j}}]_{+}^{2}=\tfrac{1}{2}\text{,}$ the same inequality gives $\mathbb{P}(Q&amp;gt;2L)\leq\tfrac{1}{4}\text{;}$ hence $\mathbb{P}\{W\geq-2\sqrt{L},\ Q\leq 2L\}\geq\tfrac{1}{2}\text{.}$ For the leaves, set $t:=4L^{5/4}$ and integrate the standard normal density, decreasing on $[t,t+t^{-1}]\text{,}$ over that interval:&lt;/p&gt;
&lt;table id="S4.Ex47" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{P}\bigl(Z_{w_{1}}\geq t\bigr)\ \geq\ \frac{1}{t\sqrt{2\pi}}\,e^{-(t+t^{-1})^{2}/2}\ \geq\ c_{G}\,L^{-5/4}\,e^{-8L^{5/2}},\qquad c_{G}:=\frac{e^{-33/32}}{4\sqrt{2\pi}}\ ,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p41.3" class="ltx_p"&gt;the exponent being $\tfrac{1}{2}t^{2}+1+\tfrac{1}{2}t^{-2}\leq 8L^{5/2}+\tfrac{33}{32}$ by $t^{2}=16L^{5/2}\geq 16\text{.}$ Multiplying by $m\geq e^{20L^{5/2}}\text{,}$&lt;/p&gt;
&lt;table id="S4.Ex48" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$m\,\mathbb{P}\bigl(Z_{w_{1}}\geq t\bigr)\ \geq\ c_{G}\,L^{-5/4}\,e^{12L^{5/2}}\ \geq\ \log 4,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S4a.p41.4" class="ltx_p"&gt;the middle expression being increasing in $L$ and, at $L=1\text{,}$ equal to $c_{G}e^{12}\geq e^{12-33/32-3}\geq e^{7}\text{,}$ using $4\sqrt{2\pi}\leq e^{3}\text{.}$ The leaves are independent of one another, so $\mathbb{P}(M&amp;lt;t)=(1-\mathbb{P}(Z_{w_{1}}\geq t))^{m}\leq e^{-m\mathbb{P}(Z_{w_{1}}\geq t)}\leq\tfrac{1}{4}\text{,}$ and independent of the handle, whence $\mathbb{P}(E)\geq\tfrac{1}{2}\cdot\tfrac{3}{4}=\tfrac{3}{8}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4a.p42" class="ltx_para"&gt;
&lt;p id="S4a.p42.1" class="ltx_p"&gt;&lt;em id="S4a.p42.1.1" class="ltx_emph ltx_font_italic"&gt;The crossing index satisfies $k_{0}\asymp\sqrt{L}\text{.}$&lt;/em&gt; Set $\kappa:=(V^{2}(L+2)/(2eA_{0}))^{1/3}\text{,}$ which is $\asymp\sqrt{L}$ since $V^{2}=\sqrt{L}\text{.}$ Every integer $k&amp;lt;\kappa$ lies in the lower-bound range of &lt;a href="#S4.Thmlemma3" title="Lemma S.4.3 (Broom profile). ‣ S.4 Benchmark and Broom Profiles ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.4.3&lt;/span&gt;&lt;/a&gt;: $(2e)^{2}\sqrt{L}\leq A_{0}(L+2)^{2}$ gives $\kappa\leq(L+2)/(2e)\text{,}$ and there $V^{2}\delta_{k}\geq V^{2}(L+2)/(2ek^{2})&amp;gt;A_{0}k\text{,}$ the strict inequality being $k^{3}&amp;lt;\kappa^{3}$ rearranged, while $n\geq e^{20L^{5/2}}$ keeps the dimension clause of (1.5) silent; hence $k_{0}\geq\kappa\text{.}$ At $k_{+}:=\lceil 4^{1/3}\kappa\rceil$ the upper bound of &lt;a href="#S4.Thmlemma3" title="Lemma S.4.3 (Broom profile). ‣ S.4 Benchmark and Broom Profiles ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.4.3&lt;/span&gt;&lt;/a&gt; gives $V^{2}\delta_{k_{+}}\leq\max\{V^{2},2V^{2}(L+2)/(ek_{+}^{2})\}\leq A_{0}k_{+}\text{,}$ the first branch since $A_{0}k_{+}\geq A_{0}^{2/3}(2/e)^{1/3}\sqrt{L}\geq V^{2}$ and the second since $k_{+}^{3}\geq 4\kappa^{3}\text{;}$ so the crossing fires by $k_{+}$ and $\kappa\leq k_{0}\leq\lceil 4^{1/3}\kappa\rceil\text{,}$ whence $k_{0}\asymp\sqrt{L}\text{.}$ Finally $\kappa\leq(L+2)/(2e)$ gives $k_{0}\leq\lceil 4^{1/3}\kappa\rceil\leq L+3\leq\sqrt{L}\,(L+1)=V^{2}H_{T_{L}}\text{,}$ so the minimum in Theorem 1 is the information branch and $R^{*}_{T_{L}}(L^{1/4},1)\asymp k_{0}\asymp\sqrt{L}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S5a" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="exact-evaluation-of-the-aggregate"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;S.5 &lt;/span&gt;Exact Evaluation of the Aggregate&lt;/h2&gt;
&lt;div id="S5a.p1" class="ltx_para"&gt;
&lt;p id="S5a.p1.1" class="ltx_p"&gt;This section proves the statements deferred from Sections 4.1 and 4.2: the bound on the normalizing sum of the prior, the completion of the proof of Lemma 4.1, the risk of the three elementary branches of (4.3), the correctness and cost of the exact evaluation of the aggregate (4.2), and the batched evaluation behind the instance sentence of Section 4.2, including the softly linear evaluation on stars.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p2" class="ltx_para"&gt;
&lt;p id="S5a.p2.1" class="ltx_p"&gt;Throughout, $K:=\lfloor n/C_{\star}\rfloor\text{;}$ except in the treatment of the elementary branches, $k$ is an integer with $2\leq k\leq K\text{.}$ The active support $A_{k}\text{,}$ the charges $\widetilde{\omega}\text{,}$ the code length $\Gamma\text{,}$ and the level weights $m_{j}=2^{j}$ for $0\leq j\leq J$ are those of Section 3.1; $\mathcal{X}_{k}$ is the class (4.1) of integer states of Section 4.1; and, as in Section 4.2 there, $\varphi_{v}(x)=e^{-(Y_{v}-bx)^{2}/(4\sigma^{2})}$ with the shorthand $b:=V/k\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.Thmlemma1" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmlemma1.2" class="ltx_text ltx_font_bold"&gt;Lemma S.5.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmlemma1.3" class="ltx_text ltx_font_bold"&gt; (Normalizing sum).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmlemma1.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmlemma1.p1.1" class="ltx_p"&gt;&lt;span id="S5.Thmlemma1.p1.1.1" class="ltx_text ltx_font_italic"&gt;For every integer $2\leq k\leq K\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex1a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{x\in\mathcal{X}_{k}}e^{-2\Gamma(x)}\ \leq\ e^{k}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5a.p3" class="ltx_para"&gt;
&lt;p id="S5a.p3.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p4" class="ltx_para"&gt;
&lt;p id="S5a.p4.1" class="ltx_p"&gt;The map $x\mapsto z$ is injective on state vectors, since the subtree sums $x_{v}=\sum_{u\succeq v}z_{u}$ recover $x\text{,}$ and $\Gamma(x)$ depends only on $z\text{.}$ Dropping the constraints $x_{o}=k$ and $0\leq x_{v}\leq 3k$ therefore bounds the sum by a product over the support:&lt;/p&gt;
&lt;table id="S5.Ex2a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{x\in\mathcal{X}_{k}}e^{-2\Gamma(x)}\ \leq\ \sum_{z\in\mathbb{Z}^{A_{k}}}\prod_{v\in A_{k}}e^{-2(|z_{v}|+\widetilde{\omega}(v)\mathbf{1}\{z_{v}\neq 0\})}\ =\ \prod_{v\in A_{k}}\Bigl(1+\tfrac{2}{e^{2}-1}\,e^{-2\widetilde{\omega}(v)}\Bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p4.2" class="ltx_p"&gt;the factor at $v$ being $1+e^{-2\widetilde{\omega}(v)}\cdot 2\sum_{t\geq 1}e^{-2t}\text{,}$ with $2\sum_{t\geq 1}e^{-2t}=\tfrac{2}{e^{2}-1}\text{.}$ The free level $R_{0}\text{,}$ where $\widetilde{\omega}=0\text{,}$ has $|R_{0}|\leq ke^{m_{0}}=ek$ vertices by &lt;a href="#S2.Thmlemma1a" title="Lemma S.2.1 (Scale floor and net sizes). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.1&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I1.i2a" title="Item 2 ‣ Lemma S.2.1 (Scale floor and net sizes). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;), and $\log(1+\tfrac{2}{e^{2}-1})\leq\tfrac{3}{10}\text{,}$ so it contributes at most $\tfrac{3}{10}ek&amp;lt;0.82\,k$ to the logarithm. The charged vertices split into the groups $G_{j}:=\{v\in A_{k}\setminus R_{0}:\ \omega(v)=m_{j}\}\subseteq R_{j}\text{,}$ $1\leq j\leq J\text{,}$ with $|G_{j}|\leq 2ke^{m_{j}}$ by &lt;a href="#S2.Thmlemma1a" title="Lemma S.2.1 (Scale floor and net sizes). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.1&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I1.i3a" title="Item 3 ‣ Lemma S.2.1 (Scale floor and net sizes). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;); since $\log(1+y)\leq y\text{,}$ their contribution is at most&lt;/p&gt;
&lt;table id="S5.Ex3a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{j\geq 1}2ke^{m_{j}}\cdot\frac{2}{e^{2}-1}\,e^{-2m_{j}}\ =\ \frac{4k}{e^{2}-1}\sum_{j\geq 1}e^{-2^{j}}\ \leq\ \frac{4k}{e^{2}-1}\cdot 0.16\ &amp;lt;\ 0.11\,k,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p4.3" class="ltx_p"&gt;using $\sum_{j\geq 1}e^{-2^{j}}&amp;lt;e^{-2}+e^{-4}+2e^{-8}&amp;lt;0.16\text{.}$ The logarithm of the product is below $0.93\,k\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p5" class="ltx_para"&gt;
&lt;p id="S5a.p5.1" class="ltx_p"&gt;In the setting of Lemma 4.1, write&lt;/p&gt;
&lt;table id="S5.Ex4a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathcal{Z}(y)\ :=\ \sum_{g\in F}\pi_{g}\,e^{-\|y-g\|_{2}^{2}/(4\sigma^{2})}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p5.2" class="ltx_p"&gt;for the normalizing sum of the weights, positive and smooth on $\mathbb{R}^{N}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p6" class="ltx_para"&gt;
&lt;p id="S5a.p6.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Completion of the proof of Lemma 4.1.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p7" class="ltx_para"&gt;
&lt;p id="S5a.p7.1" class="ltx_p"&gt;&lt;em id="S5a.p7.1.1" class="ltx_emph ltx_font_italic"&gt;The Jacobian.&lt;/em&gt; The logarithm of a weight is $\log\pi_{f}-\|y-f\|_{2}^{2}/(4\sigma^{2})-\log\mathcal{Z}(y)\text{;}$ differentiating it in $y_{i}$ gives&lt;/p&gt;
&lt;table id="S5.Ex5a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{\partial\log\widehat{\pi}_{f}}{\partial y_{i}}\ =\ -\frac{y_{i}-f_{i}}{2\sigma^{2}}+\sum_{g\in F}\widehat{\pi}_{g}(y)\,\frac{y_{i}-g_{i}}{2\sigma^{2}}\ =\ \frac{f_{i}-\widehat{f}_{i}(y)}{2\sigma^{2}}\ ,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p7.2" class="ltx_p"&gt;that is, $\partial\widehat{\pi}_{f}/\partial y_{i}=\widehat{\pi}_{f}\,(f_{i}-\widehat{f}_{i})/(2\sigma^{2})\text{.}$ Multiplying by $f_{j}$ and summing over $f\text{,}$&lt;/p&gt;
&lt;table id="S5.Ex6a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{\partial\widehat{f}_{j}}{\partial y_{i}}\ =\ \frac{1}{2\sigma^{2}}\Bigl(\sum_{f\in F}\widehat{\pi}_{f}\,f_{i}f_{j}-\widehat{f}_{i}\,\widehat{f}_{j}\Bigr)\ =\ \frac{1}{2\sigma^{2}}\operatorname{Cov}_{\widehat{\pi}(y)}(f_{i},f_{j}),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p7.3" class="ltx_p"&gt;the Jacobian identity of the main-text sketch; taking $i=j$ and summing,&lt;/p&gt;
&lt;table id="S5.E1a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$2\sigma^{2}\operatorname{div}\widehat{f}_{\pi}(y)\ =\ \operatorname{tr}\operatorname{Cov}_{\widehat{\pi}(y)}(f)\ =\ \sum_{f\in F}\widehat{\pi}_{f}(y)\,\bigl\|f-\widehat{f}_{\pi}(y)\bigr\|_{2}^{2}\ \geq\ 0.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.5.1)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S5a.p8" class="ltx_para"&gt;
&lt;p id="S5a.p8.1" class="ltx_p"&gt;&lt;em id="S5a.p8.1.1" class="ltx_emph ltx_font_italic"&gt;The domain of Stein’s identity.&lt;/em&gt; The aggregate takes values in the convex hull of the finite set $F\text{,}$ so it is bounded; its partial derivatives are posterior covariances of coordinates of $F\text{,}$ bounded uniformly in $y\text{;}$ and both are smooth, since $\mathcal{Z}&amp;gt;0$ everywhere. For such a map, Stein’s identity &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib35" title="" class="ltx_ref"&gt;Stein, 1981&lt;/a&gt;)&lt;/cite&gt; gives&lt;/p&gt;
&lt;table id="S5.Ex7a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}_{\mu}\bigl\|\widehat{f}_{\pi}(Y)-\mu\bigr\|_{2}^{2}\ =\ \mathbb{E}\bigl\|\widehat{f}_{\pi}(Y)-Y\bigr\|_{2}^{2}+2\sigma^{2}\,\mathbb{E}\operatorname{div}\widehat{f}_{\pi}(Y)\ -\ N\sigma^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S5a.p9" class="ltx_para"&gt;
&lt;p id="S5a.p9.1" class="ltx_p"&gt;&lt;em id="S5a.p9.1.1" class="ltx_emph ltx_font_italic"&gt;The cancellation.&lt;/em&gt; At fixed $y\text{,}$ expanding $\|y-f\|_{2}^{2}$ around $\widehat{f}_{\pi}(y)$ and averaging under $\widehat{\pi}(y)$ kills the cross term, since $\sum_{f}\widehat{\pi}_{f}\,(f-\widehat{f}_{\pi})=0\text{:}$&lt;/p&gt;
&lt;table id="S5.Ex8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{f\in F}\widehat{\pi}_{f}(y)\,\|y-f\|_{2}^{2}\ =\ \bigl\|y-\widehat{f}_{\pi}(y)\bigr\|_{2}^{2}+\sum_{f\in F}\widehat{\pi}_{f}(y)\,\bigl\|f-\widehat{f}_{\pi}(y)\bigr\|_{2}^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p9.2" class="ltx_p"&gt;The last sum is $2\sigma^{2}\operatorname{div}\widehat{f}_{\pi}(y)$ by &lt;a href="#S5.E1a" title="In S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.1&lt;/span&gt;&lt;/a&gt;, so substituting the expansion into Stein’s identity cancels the divergence terms and leaves the risk identity of the main-text sketch.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p10" class="ltx_para"&gt;
&lt;p id="S5a.p10.1" class="ltx_p"&gt;&lt;em id="S5a.p10.1.1" class="ltx_emph ltx_font_italic"&gt;The variational bound.&lt;/em&gt; The relative entropy of probability vectors on $F$ is $\operatorname{KL}(\rho\,\|\,\pi):=\sum_{f}\rho_{f}\log(\rho_{f}/\pi_{f})\text{,}$ with $0\log 0:=0\text{.}$ For any such $\rho\text{,}$ inserting the definition of $\widehat{\pi}(y)$ gives the identity&lt;/p&gt;
&lt;table id="S5.Ex9" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{f\in F}\rho_{f}\,\|y-f\|_{2}^{2}+4\sigma^{2}\operatorname{KL}(\rho\,\|\,\pi)\ =\ 4\sigma^{2}\operatorname{KL}\bigl(\rho\,\|\,\widehat{\pi}(y)\bigr)\ -\ 4\sigma^{2}\log\mathcal{Z}(y),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p10.2" class="ltx_p"&gt;so the left side is minimized exactly at $\rho=\widehat{\pi}(y)\text{.}$ Comparing the minimizer with the point mass at $f_{0}\text{,}$ and dropping the nonnegative divergence $\operatorname{KL}(\widehat{\pi}(y)\,\|\,\pi)$ from the minimum,&lt;/p&gt;
&lt;table id="S5.Ex10" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{f\in F}\widehat{\pi}_{f}(y)\,\|y-f\|_{2}^{2}\ \leq\ \|y-f_{0}\|_{2}^{2}+4\sigma^{2}\log\frac{1}{\pi_{f_{0}}}\ ,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p10.3" class="ltx_p"&gt;the pathwise bound of the main body, whose expectation completes the proof there.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p11" class="ltx_para"&gt;
&lt;p id="S5a.p11.1" class="ltx_p"&gt;The elementary branches of (4.3) are next. Their analysis rests on two facts: the root-corrected observation matches $\mu(o)=V$ exactly, and $Vp_{o}$ is within $V\sqrt{h_{T}}$ of every body point.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.Thmlemma2" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmlemma2.2" class="ltx_text ltx_font_bold"&gt;Lemma S.5.2&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmlemma2.3" class="ltx_text ltx_font_bold"&gt; (Elementary branches).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmlemma2.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmlemma2.p1.1" class="ltx_p"&gt;&lt;span id="S5.Thmlemma2.p1.1.1" class="ltx_text ltx_font_italic"&gt;Write $k:=k_{\mathrm{alg}}(T,V,\sigma)\text{.}$ In each of the three elementary branches of (4.3),&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex11" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sup_{\mu\in\mathcal{F}_{V}(T)}\mathbb{E}_{\mu}\|\widehat{\mu}-\mu\|_{2}^{2}\ \leq\ C\min\{V^{2}H_{T},\ \sigma^{2}k\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5a.p12" class="ltx_para"&gt;
&lt;p id="S5a.p12.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p13" class="ltx_para"&gt;
&lt;p id="S5a.p13.1" class="ltx_p"&gt;For every $\mu=\sum_{u}\lambda_{u}\,Vp_{u}\in\mathcal{F}_{V}(T)\text{,}$ convexity of the norm and Lemma 2.2 give $\|\mu-Vp_{o}\|_{2}\leq\max_{u}\|Vp_{u}-Vp_{o}\|_{2}=V\sqrt{h_{T}}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p14" class="ltx_para"&gt;
&lt;p id="S5a.p14.1" class="ltx_p"&gt;&lt;em id="S5a.p14.1.1" class="ltx_emph ltx_font_italic"&gt;Diameter branch ($V^{2}H_{T}\leq\sigma^{2}k$).&lt;/em&gt; The estimator is the constant $Vp_{o}\text{,}$ so its risk is at most $V^{2}h_{T}\leq V^{2}H_{T}\text{,}$ which is the minimum under the branch condition.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p15" class="ltx_para"&gt;
&lt;p id="S5a.p15.1" class="ltx_p"&gt;&lt;em id="S5a.p15.1.1" class="ltx_emph ltx_font_italic"&gt;Dimension branch ($V^{2}H_{T}&amp;gt;\sigma^{2}k$ and $k&amp;gt;K$).&lt;/em&gt; Since $k\leq K+1$ always, $k=K+1\text{,}$ and $K=\lfloor n/C_{\star}\rfloor$ gives $n&amp;lt;C_{\star}(K+1)=C_{\star}k\text{.}$ The root coordinate of $\widetilde{Y}$ is exact, so&lt;/p&gt;
&lt;table id="S5.Ex12" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}_{\mu}\|\widetilde{Y}-\mu\|_{2}^{2}\ =\ (n-1)\,\sigma^{2}\ &amp;lt;\ C_{\star}\,\sigma^{2}k,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p15.2" class="ltx_p"&gt;and the minimum is $\sigma^{2}k$ under the branch condition.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p16" class="ltx_para"&gt;
&lt;p id="S5a.p16.1" class="ltx_p"&gt;&lt;em id="S5a.p16.1.1" class="ltx_emph ltx_font_italic"&gt;First-budget branch ($V^{2}H_{T}&amp;gt;\sigma^{2}k$ and $k=1\leq K$).&lt;/em&gt; Here $n\geq C_{\star}\text{,}$ so $n\geq 2\text{,}$ and, as in Section 3.3, every ancestor $r$-net with $r&amp;lt;h_{T}$ has at least two elements: the root lies in every net and covers no deepest vertex. Hence $N^{\uparrow}_{T}(r)\geq 2$ for all $r&amp;lt;h_{T}\text{,}$ and letting $r\uparrow h_{T}$ in (1.4) gives $\alpha_{1}\geq h_{T}\log 2\text{.}$ The dimension clause of (2.2) is silent at $k=1\text{,}$ since $1\leq K\text{,}$ so the surrogate crossing clause fired there, $V^{2}\overline{\delta}_{1}\leq 2A_{0}\sigma^{2}\text{,}$ and with Lemma 2.3,&lt;/p&gt;
&lt;table id="S5.Ex13" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sup_{\mu}\|\mu-Vp_{o}\|_{2}^{2}\ \leq\ V^{2}h_{T}\ \leq\ \frac{V^{2}\alpha_{1}}{\log 2}\ =\ \frac{V^{2}\delta_{1}}{\log 2}\ \leq\ \frac{V^{2}\overline{\delta}_{1}}{\log 2}\ \leq\ \frac{2A_{0}}{\log 2}\,\sigma^{2};$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p16.2" class="ltx_p"&gt;the minimum is $\sigma^{2}$ under the branch condition.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p17" class="ltx_para"&gt;
&lt;p id="S5a.p17.1" class="ltx_p"&gt;The rest of the section evaluates the interior branch. Fix $2\leq k\leq K$ and collect the prior into local kernels: for $z\in\mathbb{Z}$ put&lt;/p&gt;
&lt;table id="S5.E2a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\kappa_{v}(z)\ :=\ \begin{cases}1,&amp;amp;z=0,\\ e^{-2\widetilde{\omega}(v)}\,e^{-2|z|},&amp;amp;z\neq 0\ \text{and}\ v\in A_{k},\\ 0,&amp;amp;z\neq 0\ \text{and}\ v\notin A_{k}.\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.5.2)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p17.2" class="ltx_p"&gt;For a state vector $x\in\{0,\dots,3k\}^{\mathsf{V}}$ with leaks $z_{v}=x_{v}-\sum_{c\in\operatorname{ch}(v)}x_{c}\text{,}$ the product $\prod_{v}\kappa_{v}(z_{v})$ equals $e^{-2\Gamma(x)}$ when the leaks vanish off $A_{k}$ and is zero otherwise. The denominator of (4.2) is therefore the total &lt;em id="S5a.p17.2.1" class="ltx_emph ltx_font_italic"&gt;weight&lt;/em&gt; $\prod_{v}\kappa_{v}(z_{v})\,\varphi_{v}(x_{v})$ of all state vectors with $x_{o}=k\text{,}$ and it is positive: the vector with $x_{o}=k$ and all other states zero has its one leak at the root, where $\widetilde{\omega}(o)=0$ because $o\in R_{0}\text{,}$ so its weight is $e^{-2k}\varphi_{o}(k)\prod_{v\neq o}\varphi_{v}(0)&amp;gt;0\text{.}$ In the same terms, the coefficients of the message (4.5) are&lt;/p&gt;
&lt;table id="S5.E3a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$P_{v}[x]\ =\ \sum_{\begin{subarray}{c}x^{\prime}\in\{0,\dots,3k\}^{T_{v}}\\ x^{\prime}_{v}=x\end{subarray}}\ \prod_{w\in T_{v}}\kappa_{w}(z^{\prime}_{w})\,\varphi_{w}(x^{\prime}_{w}),\qquad z^{\prime}_{w}:=x^{\prime}_{w}-\textstyle\sum_{c\in\operatorname{ch}(w)}x^{\prime}_{c},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.5.3)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p17.3" class="ltx_p"&gt;the leaks computed within $T_{v}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p18" class="ltx_para"&gt;
&lt;p id="S5a.p18.1" class="ltx_p"&gt;Messages are polynomials of degree at most $3k\text{,}$ but the product of many children’s messages is not, and its degree must not be allowed to grow with their number. The device is a pair representation: a polynomial $F(\zeta)=\sum_{i\geq 0}F[i]\zeta^{i}$ with nonnegative coefficients is carried as its truncation $F_{0}(\zeta):=\sum_{i\leq 3k}F[i]\zeta^{i}$ together with its &lt;em id="S5a.p18.1.1" class="ltx_emph ltx_font_italic"&gt;tail&lt;/em&gt;&lt;/p&gt;
&lt;table id="S5.Ex14" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tau_{F}\ :=\ \sum_{i&amp;gt;3k}F[i]\,e^{-2(i-3k)},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p18.2" class="ltx_p"&gt;the evaluation of the high part at $e^{-2}\text{,}$ shifted to the cap. Messages have zero tail; tails arise along partial products of messages and stay scalars.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.Thmlemma3" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmlemma3.2" class="ltx_text ltx_font_bold"&gt;Lemma S.5.3&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmlemma3.3" class="ltx_text ltx_font_bold"&gt; (Product of pairs).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmlemma3.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmlemma3.p1.1" class="ltx_p"&gt;&lt;span id="S5.Thmlemma3.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $F,G$ be polynomials with nonnegative coefficients, of arbitrary degrees, given by their pairs. Then $(FG)_{0}$ is the truncation of $F_{0}G_{0}\text{,}$ and&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.E4a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tau_{FG}\ =\ \sum_{q=3k+1}^{6k}[\zeta^{q}](F_{0}G_{0})\,e^{-2(q-3k)}\ +\ F_{0}(e^{-2})\,\tau_{G}\ +\ \tau_{F}\,G_{0}(e^{-2})\ +\ e^{-6k}\,\tau_{F}\,\tau_{G}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.5.4)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.Thmlemma3.p1.2" class="ltx_p"&gt;&lt;span id="S5.Thmlemma3.p1.2.1" class="ltx_text ltx_font_italic"&gt;The pair of $FG$ is therefore computable from the pairs of $F$ and $G$ by one multiplication of two polynomials of degree at most $3k$ and $O(k)$ further operations.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5a.p19" class="ltx_para"&gt;
&lt;p id="S5a.p19.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p20" class="ltx_para"&gt;
&lt;p id="S5a.p20.1" class="ltx_p"&gt;For $q\leq 3k\text{,}$ $[\zeta^{q}](FG)=\sum_{i+j=q}F[i]G[j]$ involves only indices $i,j\leq 3k\text{,}$ which gives the truncation claim. In $\tau_{FG}=\sum_{i+j&amp;gt;3k}F[i]G[j]e^{-2(i+j-3k)}\text{,}$ partition the index pairs according to whether $i\leq 3k$ and whether $j\leq 3k\text{.}$ The low–low pairs give the first term of &lt;a href="#S5.E4a" title="In Lemma S.5.3 (Product of pairs). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.4&lt;/span&gt;&lt;/a&gt;. The low–high pairs factor as $\sum_{i\leq 3k}F[i]e^{-2i}\cdot\sum_{j&amp;gt;3k}G[j]e^{-2(j-3k)}=F_{0}(e^{-2})\tau_{G}\text{,}$ the high–low pairs symmetrically, and the high–high pairs as $e^{-6k}\tau_{F}\tau_{G}\text{,}$ since $e^{-2(i+j-3k)}=e^{-2(i-3k)}e^{-2(j-3k)}e^{-6k}\text{.}$ For the cost: the single multiplication $F_{0}G_{0}$ yields all coefficients through degree $6k\text{,}$ and every remaining ingredient of &lt;a href="#S5.E4a" title="In Lemma S.5.3 (Product of pairs). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.4&lt;/span&gt;&lt;/a&gt;, including the evaluations $F_{0}(e^{-2})$ and $G_{0}(e^{-2})\text{,}$ is $O(k)$ arithmetic on them.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p21" class="ltx_para"&gt;
&lt;p id="S5a.p21.1" class="ltx_p"&gt;The recursion of Section 4.2 now takes its precise form. At each vertex the children’s messages are merged pairwise in the pair representation, and one local pass applies the observation weight and the prior kernel.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.Thmlemma4" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmlemma4.2" class="ltx_text ltx_font_bold"&gt;Lemma S.5.4&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmlemma4.3" class="ltx_text ltx_font_bold"&gt; (Message recursion).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmlemma4.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmlemma4.p1.1" class="ltx_p"&gt;&lt;span id="S5.Thmlemma4.p1.1.1" class="ltx_text ltx_font_italic"&gt;For $v\in\mathsf{V}$ let $Q_{v}(\zeta):=\prod_{c\in\operatorname{ch}(v)}P_{c}(\zeta)\text{,}$ an empty product being $1\text{,}$ with coefficients $Q_{v}[s]$ and tail $\tau_{v}\text{,}$ and set&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex15" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\psi^{-}_{x}\ :=\ \sum_{0\leq s&amp;lt;x}e^{-2(x-s)}\,Q_{v}[s],\qquad\psi^{+}_{x}\ :=\ \sum_{s&amp;gt;x}e^{-2(s-x)}\,Q_{v}[s]\qquad(0\leq x\leq 3k).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.Thmlemma4.p1.2" class="ltx_p"&gt;&lt;span id="S5.Thmlemma4.p1.2.1" class="ltx_text ltx_font_italic"&gt;Then&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.E5a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$P_{v}[x]\ =\ \begin{cases}\varphi_{v}(x)\,Q_{v}[x],&amp;amp;v\notin A_{k},\\[2.0pt] \varphi_{v}(x)\,\bigl(Q_{v}[x]+e^{-2\widetilde{\omega}(v)}(\psi^{-}_{x}+\psi^{+}_{x})\bigr),&amp;amp;v\in A_{k},\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.5.5)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.Thmlemma4.p1.3" class="ltx_p"&gt;&lt;span id="S5.Thmlemma4.p1.3.1" class="ltx_text ltx_font_italic"&gt;and the two sums obey the linear recurrences&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.E6a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\psi^{-}_{0}=0,\quad\psi^{-}_{x}=e^{-2}\bigl(Q_{v}[x-1]+\psi^{-}_{x-1}\bigr);\qquad\psi^{+}_{3k}=\tau_{v},\quad\psi^{+}_{x}=e^{-2}\bigl(Q_{v}[x+1]+\psi^{+}_{x+1}\bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.5.6)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.Thmlemma4.p1.4" class="ltx_p"&gt;&lt;span id="S5.Thmlemma4.p1.4.1" class="ltx_text ltx_font_italic"&gt;In particular the pair of $P_{v}$ is computed from the pairs of the
children’s messages by $(|\operatorname{ch}(v)|-1)_{+}$ products of pairs and $O(k)$
further operations, and $P_{o}[k]$ is the denominator of (4.2).&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5a.p22" class="ltx_para"&gt;
&lt;p id="S5a.p22.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p23" class="ltx_para"&gt;
&lt;p id="S5a.p23.1" class="ltx_p"&gt;Assignments on the subtrees of distinct children are independent,
and weights multiply, so $Q_{v}[s]$ is the total weight of the
assignments on the child subtrees whose states at the children sum
to $s\text{;}$ here $s$ ranges over all of $\{0,1,\dots\}\text{,}$ and the pair of
$Q_{v}$ is assembled by &lt;a href="#S5.Thmlemma3" title="Lemma S.5.3 (Product of pairs). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.3&lt;/span&gt;&lt;/a&gt;. A state $x$ at $v$
completes such a family to an assignment on $T_{v}$ with local weight
$\varphi_{v}(x)\kappa_{v}(x-s)\text{,}$ so by &lt;a href="#S5.E3a" title="In S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.3&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;table id="S5.Ex16" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$P_{v}[x]\ =\ \varphi_{v}(x)\sum_{s\geq 0}\kappa_{v}(x-s)\,Q_{v}[s].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p23.2" class="ltx_p"&gt;If $v\notin A_{k}\text{,}$ the kernel forces $s=x\leq 3k\text{,}$ which is &lt;a href="#S5.E5a" title="In Lemma S.5.4 (Message recursion). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.5&lt;/span&gt;&lt;/a&gt;; child sums beyond $3k$ contribute nothing. If $v\in A_{k}\text{,}$ the kernel splits the sum at $s=x$ into $Q_{v}[x]+e^{-2\widetilde{\omega}(v)}(\psi^{-}_{x}+\psi^{+}_{x})$ with&lt;/p&gt;
&lt;table id="S5.Ex17" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\psi^{+}_{x}\ =\ \sum_{x&amp;lt;s\leq 3k}e^{-2(s-x)}Q_{v}[s]\ +\ e^{-2(3k-x)}\,\tau_{v},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p23.3" class="ltx_p"&gt;the high child sums entering exactly through the tail. The recurrences &lt;a href="#S5.E6a" title="In Lemma S.5.4 (Message recursion). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.6&lt;/span&gt;&lt;/a&gt; are immediate from the definitions; the seed $\psi^{+}_{3k}=\tau_{v}$ is the identity just displayed at $x=3k\text{.}$ Both passes cost $O(k)\text{,}$ as does applying &lt;a href="#S5.E5a" title="In Lemma S.5.4 (Message recursion). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.5&lt;/span&gt;&lt;/a&gt;, and the leaf base case ($Q_{v}\equiv 1$) is contained in the general one. At the root, &lt;a href="#S5.E3a" title="In S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.3&lt;/span&gt;&lt;/a&gt; with $x=k$ sums the weights of all state vectors with $x_{o}=k\text{,}$ which is the denominator of (4.2).
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p24" class="ltx_para"&gt;
&lt;p id="S5a.p24.1" class="ltx_p"&gt;The pruning and the chain compression described in Section 4.2 modify this recursion; neither changes the posterior.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.Thmlemma5" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmlemma5.2" class="ltx_text ltx_font_bold"&gt;Lemma S.5.5&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmlemma5.3" class="ltx_text ltx_font_bold"&gt; (Pruning and compression).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmlemma5.p1" class="ltx_para"&gt;
&lt;ol id="S5.I6" class="ltx_enumerate"&gt;
&lt;li id="S5.I6.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;1.&lt;/span&gt;
&lt;div id="S5.I6.i1.p1" class="ltx_para"&gt;
&lt;p id="S5.I6.i1.p1.1" class="ltx_p"&gt;&lt;span id="S5.I6.i1.p1.1.1" class="ltx_text ltx_font_italic"&gt;If &lt;/span&gt;$T_{w}\cap A_{k}=\varnothing$&lt;span id="S5.I6.i1.p1.1.2" class="ltx_text ltx_font_italic"&gt;, then every
state vector of nonzero weight vanishes on &lt;/span&gt;$T_{w}$&lt;span id="S5.I6.i1.p1.1.3" class="ltx_text ltx_font_italic"&gt;, and the subtree
contributes the factor &lt;/span&gt;$\prod_{u\in T_{w}}\varphi_{u}(0)$&lt;span id="S5.I6.i1.p1.1.4" class="ltx_text ltx_font_italic"&gt; to every
weight; dropping it, and every other factor common to all
assignments, changes no posterior quantity. The estimator satisfies
&lt;/span&gt;$\widehat{\mu}_{k}(u)=0$&lt;span id="S5.I6.i1.p1.1.5" class="ltx_text ltx_font_italic"&gt; for &lt;/span&gt;$u\in T_{w}$&lt;span id="S5.I6.i1.p1.1.6" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S5.I6.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;2.&lt;/span&gt;
&lt;div id="S5.I6.i2.p1" class="ltx_para"&gt;
&lt;p id="S5.I6.i2.p1.1" class="ltx_p"&gt;&lt;span id="S5.I6.i2.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let &lt;/span&gt;$\mathcal{C}$&lt;span id="S5.I6.i2.p1.1.2" class="ltx_text ltx_font_italic"&gt; be a maximal chain of
vertices not in &lt;/span&gt;$A_{k}$&lt;span id="S5.I6.i2.p1.1.3" class="ltx_text ltx_font_italic"&gt;, each having exactly one child whose subtree
meets &lt;/span&gt;$A_{k}$&lt;span id="S5.I6.i2.p1.1.4" class="ltx_text ltx_font_italic"&gt; and each, except the lowest, followed in &lt;/span&gt;$\mathcal{C}$&lt;span id="S5.I6.i2.p1.1.5" class="ltx_text ltx_font_italic"&gt; by
that child; write &lt;/span&gt;$c_{\mathcal{C}}$&lt;span id="S5.I6.i2.p1.1.6" class="ltx_text ltx_font_italic"&gt; for that child of the lowest
vertex of &lt;/span&gt;$\mathcal{C}$&lt;span id="S5.I6.i2.p1.1.7" class="ltx_text ltx_font_italic"&gt;. Every state vector of nonzero weight is constant on
&lt;/span&gt;$\mathcal{C}\cup\{c_{\mathcal{C}}\}$&lt;span id="S5.I6.i2.p1.1.8" class="ltx_text ltx_font_italic"&gt;, and the chain contributes, after
the
state-independent factor
&lt;/span&gt;$\exp(-\sum_{w\in\mathcal{C}}Y_{w}^{2}/(4\sigma^{2}))$&lt;span id="S5.I6.i2.p1.1.9" class="ltx_text ltx_font_italic"&gt; is dropped, the
diagonal kernel&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.E7a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$x\ \longmapsto\ \exp\Bigl(\frac{b\,x}{2\sigma^{2}}\sum_{w\in\mathcal{C}}Y_{w}\ -\ \frac{|\mathcal{C}|\,b^{2}x^{2}}{4\sigma^{2}}\Bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.5.7)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.I6.i2.p1.2" class="ltx_p"&gt;&lt;span id="S5.I6.i2.p1.2.1" class="ltx_text ltx_font_italic"&gt;generated in &lt;/span&gt;$O(k)$&lt;span id="S5.I6.i2.p1.2.2" class="ltx_text ltx_font_italic"&gt; operations from &lt;/span&gt;$|\mathcal{C}|$&lt;span id="S5.I6.i2.p1.2.3" class="ltx_text ltx_font_italic"&gt; and
&lt;/span&gt;$\sum_{w\in\mathcal{C}}Y_{w}$&lt;span id="S5.I6.i2.p1.2.4" class="ltx_text ltx_font_italic"&gt;. The estimator satisfies
&lt;/span&gt;$\widehat{\mu}_{k}(w)=\widehat{\mu}_{k}(c_{\mathcal{C}})$&lt;span id="S5.I6.i2.p1.2.5" class="ltx_text ltx_font_italic"&gt; for
&lt;/span&gt;$w\in\mathcal{C}$&lt;span id="S5.I6.i2.p1.2.6" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5a.p25" class="ltx_para"&gt;
&lt;p id="S5a.p25.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p26" class="ltx_para"&gt;
&lt;p id="S5a.p26.1" class="ltx_p"&gt;For (&lt;a href="#S5.I6.i1" title="Item 1 ‣ Lemma S.5.5 (Pruning and compression). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;): on $T_{w}$ all kernels force $z\equiv 0\text{,}$ so leaf-up induction gives $x\equiv 0$ on $T_{w}$ for every assignment of nonzero weight; the surviving factor is $\prod_{u\in T_{w}}\kappa_{u}(0)\varphi_{u}(0)$ as claimed. A factor common to every assignment multiplies numerator and denominator of each posterior expectation alike. Since $x_{u}=0$ with posterior probability one, $\widehat{\mu}_{k}(u)=b\,\mathbb{E}_{Y}[x_{u}]=0\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p27" class="ltx_para"&gt;
&lt;p id="S5a.p27.1" class="ltx_p"&gt;For (&lt;a href="#S5.I6.i2" title="Item 2 ‣ Lemma S.5.5 (Pruning and compression). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;): a vertex $w\in\mathcal{C}$ has $z_{w}=0$ and all of its child subtrees off the chain disjoint from $A_{k}\text{,}$ hence carrying state zero, so $x_{w}$ equals the state of its unique child toward $A_{k}\text{;}$ iterating down the chain, all these states equal $x_{c_{\mathcal{C}}}=:x\text{.}$ The chain’s likelihood factor is $\prod_{w\in\mathcal{C}}\varphi_{w}(x)\text{,}$ and expanding the exponent,&lt;/p&gt;
&lt;table id="S5.Ex18" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$-\sum_{w\in\mathcal{C}}\frac{(Y_{w}-bx)^{2}}{4\sigma^{2}}\ =\ -\sum_{w\in\mathcal{C}}\frac{Y_{w}^{2}}{4\sigma^{2}}\ +\ \frac{bx}{2\sigma^{2}}\sum_{w\in\mathcal{C}}Y_{w}\ -\ \frac{|\mathcal{C}|\,b^{2}x^{2}}{4\sigma^{2}},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p27.2" class="ltx_p"&gt;which is &lt;a href="#S5.E7a" title="In Item 2 ‣ Lemma S.5.5 (Pruning and compression). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.7&lt;/span&gt;&lt;/a&gt; after the constant is dropped. Pathwise equality of the states gives $\mathbb{E}_{Y}[x_{w}]=\mathbb{E}_{Y}[x_{c_{\mathcal{C}}}]\text{,}$ hence the coordinate claim.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p28" class="ltx_para"&gt;
&lt;p id="S5a.p28.1" class="ltx_p"&gt;The forward computation of $P_{o}[k]$ is a straight-line program in the $n(3k+1)$ inputs $\varphi_{v}(x)$ whose gates are polynomial multiplications with their tail formulas &lt;a href="#S5.E4a" title="In Lemma S.5.3 (Product of pairs). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.4&lt;/span&gt;&lt;/a&gt;, the linear recurrences &lt;a href="#S5.E6a" title="In Lemma S.5.4 (Message recursion). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.6&lt;/span&gt;&lt;/a&gt;, and the coordinatewise products &lt;a href="#S5.E5a" title="In Lemma S.5.4 (Message recursion). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.5&lt;/span&gt;&lt;/a&gt;. The reverse sweep differentiates it.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.Thmlemma6" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmlemma6.2" class="ltx_text ltx_font_bold"&gt;Lemma S.5.6&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmlemma6.3" class="ltx_text ltx_font_bold"&gt; (Reverse sweep).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmlemma6.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmlemma6.p1.1" class="ltx_p"&gt;&lt;span id="S5.Thmlemma6.p1.1.1" class="ltx_text ltx_font_italic"&gt;All $n(3k+1)$ partial derivatives $\partial P_{o}[k]/\partial\varphi_{v}(x)$ are computable in $O(1)$ times the cost of the forward computation, and&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.E8a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widehat{\mu}_{k}(v)\ =\ b\sum_{x=0}^{3k}x\cdot\frac{\varphi_{v}(x)}{P_{o}[k]}\,\frac{\partial P_{o}[k]}{\partial\varphi_{v}(x)},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.5.8)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5.Thmlemma6.p1.2" class="ltx_p"&gt;&lt;span id="S5.Thmlemma6.p1.2.1" class="ltx_text ltx_font_italic"&gt;which is the display (4.6).&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5a.p29" class="ltx_para"&gt;
&lt;p id="S5a.p29.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p30" class="ltx_para"&gt;
&lt;p id="S5a.p30.1" class="ltx_p"&gt;By &lt;a href="#S5.E3a" title="In S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.3&lt;/span&gt;&lt;/a&gt; at the root, $P_{o}[k]$ is a sum of monomials, one per state vector $x^{\prime}$ with $x^{\prime}_{o}=k\text{,}$ each containing the input $\varphi_{v}(x^{\prime}_{v})$ exactly once and otherwise only kernel constants and inputs at other vertices. Hence $\varphi_{v}(x)\,\partial P_{o}[k]/\partial\varphi_{v}(x)$ is the total weight of the state vectors with $x^{\prime}_{v}=x\text{,}$ so the ratio in &lt;a href="#S5.E8a" title="In Lemma S.5.6 (Reverse sweep). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.8&lt;/span&gt;&lt;/a&gt; is the posterior probability of $\{x_{v}=x\}$ and the sum is $b\,\mathbb{E}_{Y}[x_{v}]=\widehat{\mu}_{k}(v)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p31" class="ltx_para"&gt;
&lt;p id="S5a.p31.1" class="ltx_p"&gt;For the cost, propagate the derivatives of $P_{o}[k]$ with respect to every intermediate quantity backward through the program, from the output to the inputs. By the chain rule, the derivative with respect to a quantity is assembled from the derivatives with respect to the quantities that consume it, so one backward pass over the acyclic program suffices; each gate is handled by the transpose of its linearization, at the cost of the gate itself. For a product of pairs, the derivative with respect to a coefficient of one factor is a correlation with the other,&lt;/p&gt;
&lt;table id="S5.E9a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{\partial P_{o}[k]}{\partial F_{0}[i]}\ =\ \sum_{j=0}^{3k}\frac{\partial P_{o}[k]}{\partial\,[\zeta^{i+j}](F_{0}G_{0})}\ G_{0}[j]\qquad(0\leq i\leq 3k),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.5.9)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p31.2" class="ltx_p"&gt;one multiplication of polynomials of degree at most $6k$ after reversing the coefficient order, plus the $O(k)$ coordinatewise contributions of &lt;a href="#S5.E4a" title="In Lemma S.5.3 (Product of pairs). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.4&lt;/span&gt;&lt;/a&gt; through its low coefficients, its evaluations, and its tails. The transposed recurrences &lt;a href="#S5.E6a" title="In Lemma S.5.4 (Message recursion). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.6&lt;/span&gt;&lt;/a&gt; run in the opposite direction in $O(k)\text{,}$ and the coordinatewise products &lt;a href="#S5.E5a" title="In Lemma S.5.4 (Message recursion). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.5&lt;/span&gt;&lt;/a&gt; are differentiated in $O(k)\text{.}$ Every gate’s transpose therefore costs the order of the gate, and the sweep visits each gate once.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p32" class="ltx_para"&gt;
&lt;p id="S5a.p32.1" class="ltx_p"&gt;&lt;em id="S5a.p32.1.1" class="ltx_emph ltx_font_italic"&gt;The operation count of Theorem 2.&lt;/em&gt; Computing $k_{\mathrm{alg}}$ costs $O(n\log(n+1))$ operations by Lemma 2.3; the nets $S_{j}$ at the $J+1=O(\log(k+1))$ dyadic radii cost $O(n)$ each by &lt;a href="#S1.Thmlemma1" title="Lemma S.1.1. ‣ S.1 The Profile Toolkit ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.1.1&lt;/span&gt;&lt;/a&gt;, and the charges $\widetilde{\omega}$ one further pass. In the interior branch, the forward computation performs, over the whole tree, fewer than $n$ products of pairs, each $O(k\log(k+1))$ by &lt;a href="#S5.Thmlemma3" title="Lemma S.5.3 (Product of pairs). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.3&lt;/span&gt;&lt;/a&gt; and the multiplication model of Section 2.1, and $O(k)$ local work at each vertex (&lt;a href="#S5.Thmlemma4" title="Lemma S.5.4 (Message recursion). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.4&lt;/span&gt;&lt;/a&gt;); the reverse sweep matches this cost (&lt;a href="#S5.Thmlemma6" title="Lemma S.5.6 (Reverse sweep). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.6&lt;/span&gt;&lt;/a&gt;); and assembling &lt;a href="#S5.E8a" title="In Lemma S.5.6 (Reverse sweep). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.8&lt;/span&gt;&lt;/a&gt; at every vertex costs $O(nk)\text{.}$ Pruning and compression (&lt;a href="#S5.Thmlemma5" title="Lemma S.5.5 (Pruning and compression). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.5&lt;/span&gt;&lt;/a&gt;) only remove work. The elementary branches cost $O(n)$ beyond the preprocessing. Every tie break (child orders, the greedy of &lt;a href="#S1.Thmlemma1" title="Lemma S.1.1. ‣ S.1 The Profile Toolkit ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.1.1&lt;/span&gt;&lt;/a&gt;, the merge order) is fixed, so the whole map $(T,V,\sigma,Y)\mapsto\widehat{\mu}$ is deterministic, and the total is&lt;/p&gt;
&lt;table id="S5.Ex19" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$O\bigl(n\log(n+1)+nk\log(k+1)\bigr)\ \leq\ O\bigl(n^{2}\log(n+1)\bigr)$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p32.2" class="ltx_p"&gt;operations, since $k\leq K+1\leq n\text{:}$ the count claimed in Theorem 2, whose proof is now complete.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p33" class="ltx_para"&gt;
&lt;p id="S5a.p33.1" class="ltx_p"&gt;The remaining two lemmas support the instance sentence of Section 4.2. Sibling messages that are dilations of a common polynomial multiply in batch: the mechanism is that logarithms turn the product into power sums of the dilation parameters. Two standard consequences of fast multiplication are used &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib39" title="" class="ltx_ref"&gt;von zur Gathen and Gerhard, 2013&lt;/a&gt;)&lt;/cite&gt;: Newton iteration computes truncated inverses and logarithms of power series with constant term $1\text{,}$ and exponentials of those with constant term $0\text{,}$ at the cost of $O(1)$ multiplications of the same degree; and a degree-$D$ polynomial is evaluated at $d$ points in $O((D+d)\log^{2}(D+d))$ operations by a product tree.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.Thmlemma7" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmlemma7.2" class="ltx_text ltx_font_bold"&gt;Lemma S.5.7&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmlemma7.3" class="ltx_text ltx_font_bold"&gt; (Batched dilations).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmlemma7.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmlemma7.p1.1" class="ltx_p"&gt;&lt;span id="S5.Thmlemma7.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $F$ be a polynomial of degree at most $3k$ with $F[0]=1\text{,}$ and let $\xi_{1},\dots,\xi_{d}&amp;gt;0\text{.}$ In $O((k+d)\log^{2}(k+d))$ operations one can compute&lt;/span&gt;&lt;/p&gt;
&lt;ol id="S5.I9" class="ltx_enumerate"&gt;
&lt;li id="S5.I9.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;1.&lt;/span&gt;
&lt;div id="S5.I9.i1.p1" class="ltx_para"&gt;
&lt;p id="S5.I9.i1.p1.1" class="ltx_p"&gt;&lt;span id="S5.I9.i1.p1.1.1" class="ltx_text ltx_font_italic"&gt;the truncation of
&lt;/span&gt;$\prod_{i=1}^{d}F(\xi_{i}\zeta)$&lt;span id="S5.I9.i1.p1.1.2" class="ltx_text ltx_font_italic"&gt; modulo &lt;/span&gt;$\zeta^{3k+1}$&lt;span id="S5.I9.i1.p1.1.3" class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S5.I9.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;2.&lt;/span&gt;
&lt;div id="S5.I9.i2.p1" class="ltx_para"&gt;
&lt;p id="S5.I9.i2.p1.1" class="ltx_p"&gt;&lt;span id="S5.I9.i2.p1.1.1" class="ltx_text ltx_font_italic"&gt;the values &lt;/span&gt;$F(e^{-2}\xi_{i})$&lt;span id="S5.I9.i2.p1.1.2" class="ltx_text ltx_font_italic"&gt; and
&lt;/span&gt;$F^{\prime}(e^{-2}\xi_{i})$&lt;span id="S5.I9.i2.p1.1.3" class="ltx_text ltx_font_italic"&gt; for all &lt;/span&gt;$i\leq d$&lt;span id="S5.I9.i2.p1.1.4" class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S5.I9.i3" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;3.&lt;/span&gt;
&lt;div id="S5.I9.i3.p1" class="ltx_para"&gt;
&lt;p id="S5.I9.i3.p1.1" class="ltx_p"&gt;&lt;span id="S5.I9.i3.p1.1.1" class="ltx_text ltx_font_italic"&gt;for any given &lt;/span&gt;$y_{0},\dots,y_{3k}$&lt;span id="S5.I9.i3.p1.1.2" class="ltx_text ltx_font_italic"&gt;, the
values
&lt;/span&gt;$\ \xi_{i}\,\dfrac{\partial}{\partial\xi_{i}}\displaystyle\sum_{s=0}^{3k}y_{s}\,[\zeta^{s}]\prod_{j=1}^{d}F(\xi_{j}\zeta)\space$&lt;span id="S5.I9.i3.p1.1.3" class="ltx_text ltx_font_italic"&gt;
for all &lt;/span&gt;$i\leq d$&lt;span id="S5.I9.i3.p1.1.4" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5a.p34" class="ltx_para"&gt;
&lt;p id="S5a.p34.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p35" class="ltx_para"&gt;
&lt;p id="S5a.p35.1" class="ltx_p"&gt;Write $g(\zeta):=\log F(\zeta)=\sum_{m=1}^{3k}g_{m}\zeta^{m}$ modulo $\zeta^{3k+1}\text{,}$ computable by Newton iteration since $F[0]=1\text{,}$ and let $t_{m}:=\sum_{i\leq d}\xi_{i}^{m}$ be the power sums. Then, modulo $\zeta^{3k+1}\text{,}$&lt;/p&gt;
&lt;table id="S5.E10a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\prod_{i=1}^{d}F(\xi_{i}\zeta)\ =\ \exp\Bigl(\sum_{m=1}^{3k}g_{m}\,t_{m}\,\zeta^{m}\Bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.5.10)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p35.2" class="ltx_p"&gt;because $\log F(\xi_{i}\zeta)=\sum_{m}g_{m}\xi_{i}^{m}\zeta^{m}$ and the logarithms add. The power sums come from the auxiliary polynomial $N(\zeta):=\prod_{i\leq d}(1-\xi_{i}\zeta)\text{,}$ built by a product tree, through the logarithmic-derivative identity $-\zeta N^{\prime}(\zeta)/N(\zeta)=\sum_{m\geq 1}t_{m}\zeta^{m}\text{,}$ one derivative, one truncated inversion, and one multiplication; the exponential in &lt;a href="#S5.E10a" title="In S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.10&lt;/span&gt;&lt;/a&gt; is one more Newton iteration. This proves (&lt;a href="#S5.I9.i1" title="Item 1 ‣ Lemma S.5.7 (Batched dilations). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;), and (&lt;a href="#S5.I9.i2" title="Item 2 ‣ Lemma S.5.7 (Batched dilations). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;) is multipoint evaluation of $F$ and $F^{\prime}$ at the points $e^{-2}\xi_{i}\text{.}$ For (&lt;a href="#S5.I9.i3" title="Item 3 ‣ Lemma S.5.7 (Batched dilations). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;), write $P:=\exp(H)$ with $H:=\sum_{m}g_{m}t_{m}\zeta^{m}\text{;}$ then $dP=P\,dH\text{,}$ so the displayed quantity, as a function of the $t_{m}\text{,}$ has&lt;/p&gt;
&lt;table id="S5.Ex20" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{\partial}{\partial t_{m}}\sum_{s\leq 3k}y_{s}\,[\zeta^{s}]P\ =\ g_{m}\sum_{s=m}^{3k}y_{s}\,[\zeta^{s-m}]P,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p35.3" class="ltx_p"&gt;one correlation as in &lt;a href="#S5.E9a" title="In S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.9&lt;/span&gt;&lt;/a&gt;; and since $\xi_{i}\,\partial t_{m}/\partial\xi_{i}=m\,\xi_{i}^{m}\text{,}$ the value carried by the dilation parameter $\xi_{i}$ is the evaluation at $\xi_{i}$ of the polynomial $\sum_{m=1}^{3k}m\,g_{m}\bigl(\sum_{s\geq m}y_{s}[\zeta^{s-m}]P\bigr)\,\zeta^{m}\text{,}$ a second multipoint evaluation. Every step is a product tree, a truncated inversion, a logarithm or exponential, a correlation, or a multipoint evaluation at degree $O(k+d)\text{,}$ each within the stated bound.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p36" class="ltx_para"&gt;
&lt;p id="S5a.p36.1" class="ltx_p"&gt;On the star, either the active support collapses to the root or every leaf message is a dilation of one template; in both cases the evaluation is softly linear.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.Thmlemma8" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S5.Thmlemma8.2" class="ltx_text ltx_font_bold"&gt;Lemma S.5.8&lt;/span&gt;&lt;/span&gt;&lt;span id="S5.Thmlemma8.3" class="ltx_text ltx_font_bold"&gt; (Stars).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S5.Thmlemma8.p1" class="ltx_para"&gt;
&lt;p id="S5.Thmlemma8.p1.1" class="ltx_p"&gt;&lt;span id="S5.Thmlemma8.p1.1.1" class="ltx_text ltx_font_italic"&gt;On the star $S_{m}$ with $m\geq 2$ leaves, the estimator (4.3) is computed in $O(n\log^{2}n)$ operations, $n=m+1\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5a.p37" class="ltx_para"&gt;
&lt;p id="S5a.p37.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p38" class="ltx_para"&gt;
&lt;p id="S5a.p38.1" class="ltx_p"&gt;The preprocessing and the elementary branches cost $O(n\log(n+1))\text{,}$ so let the interior branch be selected, with budget $2\leq k\leq K$ and working scale $\bar{\alpha}=k\overline{\delta}_{k}\geq 2$ (&lt;a href="#S2.Thmlemma1a" title="Lemma S.2.1 (Scale floor and net sizes). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.1&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I1.i1a" title="Item 1 ‣ Lemma S.2.1 (Scale floor and net sizes). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;)). On the star, the minimum ancestor $r$-net with $r\geq 1$ is $\{o\}\text{,}$ a leaf being an ancestor only of itself, while at $r=0$ every vertex needs itself; so with $j_{0}:=\min\{j:\lfloor\bar{\alpha}/m_{j}\rfloor=0\}\text{,}$ understood as $j_{0}=J+1$ if no radius vanishes, the nets are $S_{j}=\{o\}$ for $j&amp;lt;j_{0}$ and $S_{j}=\mathsf{V}$ for $j\geq j_{0}\text{,}$ and $j_{0}\geq 1$ because $\lfloor\bar{\alpha}\rfloor\geq 2\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p39" class="ltx_para"&gt;
&lt;p id="S5a.p39.1" class="ltx_p"&gt;If $j_{0}=J+1\text{,}$ then $A_{k}=\{o\}\text{:}$ the only state vector with nonzero weight has $x_{o}=k$ and all leaf states zero, the posterior is a point mass, and $\widehat{\mu}_{k}=\tfrac{V}{k}\,x=Vp_{o}$ is written in $O(n)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p40" class="ltx_para"&gt;
&lt;p id="S5a.p40.1" class="ltx_p"&gt;If $j_{0}\leq J\text{,}$ then $A_{k}=\mathsf{V}$ and every leaf carries the same charge $\widetilde{\omega}=m_{j_{0}}\text{.}$ Factor the local weight of leaf $v$ at state $x$ as $\varphi_{v}(x)=e^{-Y_{v}^{2}/(4\sigma^{2})}\,e^{-b^{2}x^{2}/(4\sigma^{2})}\,\xi_{v}^{x}$ with $\xi_{v}:=e^{bY_{v}/(2\sigma^{2})}\text{;}$ the first factor is common to every assignment and is dropped. By &lt;a href="#S5.Thmlemma4" title="Lemma S.5.4 (Message recursion). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.4&lt;/span&gt;&lt;/a&gt;, the message of leaf $v$ is then $F(\xi_{v}\zeta)$ for the common template&lt;/p&gt;
&lt;table id="S5.Ex21" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$F(\zeta)\ :=\ 1\ +\ e^{-2m_{j_{0}}}\sum_{x=1}^{3k}e^{-2x}\,e^{-b^{2}x^{2}/(4\sigma^{2})}\,\zeta^{x},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p40.2" class="ltx_p"&gt;and the child product of the root is $Q_{o}(\zeta)=\prod_{v}F(\xi_{v}\zeta)\text{.}$ &lt;a href="#S5.Thmlemma7" title="Lemma S.5.7 (Batched dilations). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.7&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S5.I9.i1" title="Item 1 ‣ Lemma S.5.7 (Batched dilations). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;) gives its truncation, &lt;a href="#S5.Thmlemma7" title="Lemma S.5.7 (Batched dilations). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.7&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S5.I9.i2" title="Item 2 ‣ Lemma S.5.7 (Batched dilations). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;) gives $Q_{o}(e^{-2})=\prod_{v}F(e^{-2}\xi_{v})\text{,}$ and the tail follows as&lt;/p&gt;
&lt;table id="S5.Ex22" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tau_{o}\ =\ e^{6k}\Bigl(\,Q_{o}(e^{-2})-\sum_{s=0}^{3k}Q_{o}[s]\,e^{-2s}\Bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p40.3" class="ltx_p"&gt;exactly, from the definition of the tail. The root pass of &lt;a href="#S5.Thmlemma4" title="Lemma S.5.4 (Message recursion). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.4&lt;/span&gt;&lt;/a&gt; then yields $P_{o}[k]$ in $O(k)$ operations.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p41" class="ltx_para"&gt;
&lt;p id="S5a.p41.1" class="ltx_p"&gt;For the marginals, $P_{o}[k]$ is a linear function of $(Q_{o}[0],\dots,Q_{o}[3k],\tau_{o})$ by &lt;a href="#S5.E5a" title="In Lemma S.5.4 (Message recursion). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.5&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S5.E6a" title="In Lemma S.5.4 (Message recursion). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.6&lt;/span&gt;&lt;/a&gt;, with coefficients computable in $O(k)\text{;}$ and every assignment’s weight carries the factor $\xi_{v}^{x_{v}}\text{,}$ so Euler differentiation gives&lt;/p&gt;
&lt;table id="S5.E11a" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}_{Y}[x_{v}]\ =\ \frac{\xi_{v}}{P_{o}[k]}\,\frac{\partial P_{o}[k]}{\partial\xi_{v}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.5.11)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p41.2" class="ltx_p"&gt;The derivative splits along the linear form: the low coefficients contribute one instance of &lt;a href="#S5.Thmlemma7" title="Lemma S.5.7 (Batched dilations). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.7&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S5.I9.i3" title="Item 3 ‣ Lemma S.5.7 (Batched dilations). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;), with weights that combine the direct coefficients of the linear form and the term $-e^{6k-2s}$ that $Q_{o}[s]$ inherits from $\tau_{o}\text{,}$ while $Q_{o}(e^{-2})$ contributes&lt;/p&gt;
&lt;table id="S5.Ex23" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\xi_{v}\,\frac{\partial Q_{o}(e^{-2})}{\partial\xi_{v}}\ =\ Q_{o}(e^{-2})\cdot\frac{e^{-2}\xi_{v}\,F^{\prime}(e^{-2}\xi_{v})}{F(e^{-2}\xi_{v})}\ ,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S5a.p41.3" class="ltx_p"&gt;an $O(1)$ combination of the values from &lt;a href="#S5.Thmlemma7" title="Lemma S.5.7 (Batched dilations). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.7&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S5.I9.i2" title="Item 2 ‣ Lemma S.5.7 (Batched dilations). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;), whose denominators are positive because $F$ has positive constant term and nonnegative coefficients. Then $\widehat{\mu}_{k}(v)=b\,\mathbb{E}_{Y}[x_{v}]$ at every leaf and $\widehat{\mu}_{k}(o)=V\text{.}$ All steps beyond the preprocessing cost $O((k+m)\log^{2}(k+m))\text{,}$ and $k\leq K&amp;lt;n$ makes this $O(n\log^{2}n)\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5a.p42" class="ltx_para"&gt;
&lt;p id="S5a.p42.1" class="ltx_p"&gt;Together, &lt;a href="#S5.Thmlemma7" title="Lemma S.5.7 (Batched dilations). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemmas&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.7&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S5.Thmlemma8" title="Lemma S.5.8 (Stars). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;S.5.8&lt;/span&gt;&lt;/a&gt; verify the instance sentence of Section 4.2: a group of sibling messages agreeing up to a dilation of the variable multiplies in batch, and on stars the entire evaluation is softly linear in $n\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S6" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="adaptation-1"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;S.6 &lt;/span&gt;Adaptation&lt;/h2&gt;
&lt;div id="S6.p1" class="ltx_para"&gt;
&lt;p id="S6.p1.1" class="ltx_p"&gt;This section proves the statements deferred from Section 4.3: the selection oracle (4.8), in the weighted and random-penalty form stated there; the scale calculus for the minimax risk; the subspace approximation (4.7); the enumeration of admissible supports; the assembly of the sufficiency half of Theorem 3, including its running time; the difference statistics of Theorem 4 with their contamination bound, the concentration of the noise estimate, and the moment bookkeeping; and the noise-estimation ceiling stated at the end of Section 4.3. Throughout, $K:=\lfloor n/C_{\star}\rfloor$ and dyadic integers are powers of two; the selection constant of (4.8) is instantiated as $C_{2}:=128\text{.}$ The standard Gaussian tail bound $\mathbb{P}\bigl(N(0,\tau^{2})\geq t\bigr)\leq e^{-t^{2}/(2\tau^{2})}\text{,}$ valid for $t\geq 0\text{,}$ is used without further comment.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p2" class="ltx_para"&gt;
&lt;p id="S6.p2.1" class="ltx_p"&gt;The selection engine comes first. The lemma below is the oracle promised with (4.8): the noise may have unequal, even zero, coordinate variances, which is how conditioning on the root observation will enter, and the penalties may be random as long as they are bracketed on an event, which is how the estimated noise scale will enter.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.Thmlemma1" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S6.Thmlemma1.2" class="ltx_text ltx_font_bold"&gt;Lemma S.6.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S6.Thmlemma1.3" class="ltx_text ltx_font_bold"&gt; (Weighted affine selection).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S6.Thmlemma1.p1" class="ltx_para"&gt;
&lt;p id="S6.Thmlemma1.p1.1" class="ltx_p"&gt;&lt;span id="S6.Thmlemma1.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $Y=\theta+Z\in\mathbb{R}^{N}\text{,}$ where $\theta\in\mathbb{R}^{N}$ and $Z$ is a centered Gaussian vector with independent coordinates whose variances are at most $\sigma^{2}\text{,}$ some possibly zero. Let $\mathcal{M}$ be a countable collection of affine models $m=c_{m}+W_{m}\subseteq\mathbb{R}^{N}\text{,}$ each $W_{m}$ a linear subspace of finite dimension $D_{m}\text{,}$ with weights $\Delta_{m}\geq 0$ such that $\sum_{m\in\mathcal{M}}e^{-\Delta_{m}}\leq 1\text{.}$ Let $\widehat{\theta}$ minimize $\|Y-\nu\|_{2}^{2}+\operatorname{pen}(m)$ over $m\in\mathcal{M}$ and $\nu\in m\text{,}$ and over a full model whose fit is $\nu=Y$ itself. The penalties are nonnegative, possibly random, and such that the minimum defining $\widehat{\theta}$ is attained, as it is in particular for finite $\mathcal{M}\text{.}$ Suppose that on an event $E\text{,}$ for a constant $\bar{\kappa}\geq 32\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="S6.EGx6"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S6.Ex1"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S6.Ex2"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{gathered}
\displaystyle 32\,\sigma^{2}(D_{m}+\Delta_{m})\ \leq\ \operatorname{pen}(m)\ \leq\ \bar{\kappa}\,\sigma^{2}(D_{m}+\Delta_{m})\qquad\text{for every }m\in\mathcal{M}, \\
\displaystyle 32\,\sigma^{2}N\ \leq\ \operatorname{pen}(\mathrm{full})\ \leq\ \bar{\kappa}\,\sigma^{2}N.
\end{gathered}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p id="S6.Thmlemma1.p1.2" class="ltx_p"&gt;&lt;span id="S6.Thmlemma1.p1.2.1" class="ltx_text ltx_font_italic"&gt;Then&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\bigl[\|\widehat{\theta}-\theta\|_{2}^{2}\,\mathbf{1}_{E}\bigr]\ \leq\ C_{\bar{\kappa}}\Bigl(\min\Bigl\{\ \inf_{m\in\mathcal{M}}\bigl(\operatorname{dist}^{2}(\theta,m)+\sigma^{2}(D_{m}+\Delta_{m}+1)\bigr),\ \ \sigma^{2}N\ \Bigr\}\ +\ \sigma^{2}\Bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.Thmlemma1.p1.3" class="ltx_p"&gt;&lt;span id="S6.Thmlemma1.p1.3.1" class="ltx_text ltx_font_italic"&gt;where $C_{\bar{\kappa}}$ depends only on $\bar{\kappa}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S6.p3" class="ltx_para"&gt;
&lt;p id="S6.p3.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p4" class="ltx_para"&gt;
&lt;p id="S6.p4.1" class="ltx_p"&gt;The selected model is compared with one fixed model through the basic inequality of penalized least squares; a single Kraft-weighted deviation variable controls the Gaussian fluctuations over the whole collection, and the full model is handled by its own comparison.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p5" class="ltx_para"&gt;
&lt;p id="S6.p5.1" class="ltx_p"&gt;&lt;em id="S6.p5.1.1" class="ltx_emph ltx_font_italic"&gt;A projection bound.&lt;/em&gt; Let $U\subseteq\mathbb{R}^{N}$ be a fixed subspace of dimension $d$ and $P_{U}$ the orthogonal projection onto it. For an orthonormal basis $u_{1},\dots,u_{d}$ of $U\text{,}$ the vector $(\langle Z,u_{i}\rangle)_{i\leq d}$ is centered Gaussian with covariance $\Sigma\preceq\sigma^{2}I_{d}\text{:}$ its quadratic form at $a\in\mathbb{R}^{d}$ is $\operatorname{Var}\langle Z,\sum_{i}a_{i}u_{i}\rangle\leq\sigma^{2}\|\sum_{i}a_{i}u_{i}\|_{2}^{2}=\sigma^{2}\|a\|_{2}^{2}\text{.}$ For a centered Gaussian $g$ of variance $\tau^{2}\leq\sigma^{2}\text{,}$ direct integration gives $\mathbb{E}e^{g^{2}/(4\sigma^{2})}=(1-\tau^{2}/(2\sigma^{2}))^{-1/2}\leq\sqrt{2}\text{,}$ the case $\tau^{2}=0$ included; diagonalizing $\Sigma$ and multiplying over the independent coordinates,&lt;/p&gt;
&lt;table id="S6.Ex4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\,e^{\|P_{U}Z\|_{2}^{2}/(4\sigma^{2})}\ \leq\ 2^{d/2};$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p5.2" class="ltx_p"&gt;hence, by Markov’s inequality and $2^{1/2}\leq e\text{,}$ for every $t\geq 0\text{,}$&lt;/p&gt;
&lt;table id="S6.Ex5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{P}\bigl(\|P_{U}Z\|_{2}^{2}\geq 4\sigma^{2}(d+t)\bigr)\ \leq\ 2^{d/2}\,e^{-d-t}\ \leq\ e^{-t}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S6.p6" class="ltx_para"&gt;
&lt;p id="S6.p6.1" class="ltx_p"&gt;&lt;em id="S6.p6.1.1" class="ltx_emph ltx_font_italic"&gt;The deviation variable.&lt;/em&gt; Fix a comparison model $m_{0}\in\mathcal{M}$ and let $f_{0}\in m_{0}$ attain $a:=\operatorname{dist}(\theta,m_{0})\text{,}$ the metric projection of $\theta$ onto the closed affine set $m_{0}\text{.}$ For $m\in\mathcal{M}$ put&lt;/p&gt;
&lt;table id="S6.Ex6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$U_{m}\ :=\ W_{m}+W_{m_{0}}+\operatorname{span}(c_{m}-f_{0}),\qquad d_{m}\ :=\ \dim U_{m}\ \leq\ D_{m}+D_{m_{0}}+1,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p6.2" class="ltx_p"&gt;so that every $\nu=c_{m}+w\in m$ has $\nu-f_{0}=(c_{m}-f_{0})+w\in U_{m}\text{,}$ and define&lt;/p&gt;
&lt;table id="S6.Ex7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$Z^{*}\ :=\ \sup_{m\in\mathcal{M}}\ \Bigl[\frac{\|P_{U_{m}}Z\|_{2}^{2}}{4\sigma^{2}}-(d_{m}+\Delta_{m})\Bigr]_{+}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p6.3" class="ltx_p"&gt;By the projection bound and a union bound, $\mathbb{P}(Z^{*}&amp;gt;t)\leq\sum_{m}e^{-\Delta_{m}-t}\leq e^{-t}\text{,}$ so $\mathbb{E}Z^{*}=\int_{0}^{\infty}\mathbb{P}(Z^{*}&amp;gt;t)\,dt\leq 1\text{;}$ and by its definition, $\|P_{U_{m}}Z\|_{2}^{2}\leq 4\sigma^{2}(d_{m}+\Delta_{m}+Z^{*})$ for every $m$ simultaneously.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p7" class="ltx_para"&gt;
&lt;p id="S6.p7.1" class="ltx_p"&gt;&lt;em id="S6.p7.1.1" class="ltx_emph ltx_font_italic"&gt;A model is selected.&lt;/em&gt; Suppose the minimum is attained at some $\widehat{m}\in\mathcal{M}$ with fit $\widehat{\theta}\in\widehat{m}\text{,}$ and write $d:=\widehat{\theta}-\theta\text{.}$ Expanding the basic inequality against $(m_{0},f_{0})\text{,}$ $\|Y-\widehat{\theta}\|_{2}^{2}+\operatorname{pen}(\widehat{m})\leq\|Y-f_{0}\|_{2}^{2}+\operatorname{pen}(m_{0})\text{,}$ at $Y=\theta+Z$ and combining the two cross terms into $2\langle Z,\widehat{\theta}-f_{0}\rangle$ gives&lt;/p&gt;
&lt;table id="S6.Ex8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\|d\|_{2}^{2}\ \leq\ a^{2}+2\langle Z,\widehat{\theta}-f_{0}\rangle-\operatorname{pen}(\widehat{m})+\operatorname{pen}(m_{0}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p7.2" class="ltx_p"&gt;Since $\widehat{\theta}-f_{0}\in U_{\widehat{m}}\text{,}$ the inequality $2xy\leq\tfrac{1}{4}x^{2}+4y^{2}$ and the deviation variable give&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="S6.EGx7"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S6.Ex9"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S6.Ex10"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle 2\langle Z,\widehat{\theta}-f_{0}\rangle\ =\ 2\bigl\langle P_{U_{\widehat{m}}}Z,\ \widehat{\theta}-f_{0}\bigr\rangle\space &amp;amp; \displaystyle\leq\ \tfrac{1}{4}\|\widehat{\theta}-f_{0}\|_{2}^{2}+4\,\|P_{U_{\widehat{m}}}Z\|_{2}^{2} \\
&amp;amp; \displaystyle\leq\ \tfrac{1}{4}\bigl(\|d\|_{2}+a\bigr)^{2}+16\sigma^{2}\bigl(d_{\widehat{m}}+\Delta_{\widehat{m}}+Z^{*}\bigr).
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p id="S6.p7.3" class="ltx_p"&gt;By $d_{\widehat{m}}\leq D_{\widehat{m}}+D_{m_{0}}+1\text{,}$ the last term splits into $16\sigma^{2}(D_{\widehat{m}}+\Delta_{\widehat{m}})+16\sigma^{2}(D_{m_{0}}+1)+16\sigma^{2}Z^{*}\text{,}$ and on $E$ the penalty dominates its first piece: $\operatorname{pen}(\widehat{m})\geq 32\sigma^{2}(D_{\widehat{m}}+\Delta_{\widehat{m}})\text{.}$ Together with $\tfrac{1}{4}(\|d\|_{2}+a)^{2}\leq\tfrac{1}{2}\|d\|_{2}^{2}+\tfrac{1}{2}a^{2}\text{,}$ the expansion rearranges to&lt;/p&gt;
&lt;table id="S6.E1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\|d\|_{2}^{2}\ \leq\ 3a^{2}+2\operatorname{pen}(m_{0})+32\sigma^{2}(D_{m_{0}}+1)+32\sigma^{2}Z^{*}\qquad\text{on }E\cap\{\text{a model is selected}\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.6.1)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S6.p8" class="ltx_para"&gt;
&lt;p id="S6.p8.1" class="ltx_p"&gt;&lt;em id="S6.p8.1.1" class="ltx_emph ltx_font_italic"&gt;The full model is selected.&lt;/em&gt; Then $\widehat{\theta}=Y$ and $\|d\|_{2}^{2}=\|Z\|_{2}^{2}\text{,}$ while the full model’s own residual vanishes, so the basic inequality against $(m_{0},f_{0})$ reads $\operatorname{pen}(\mathrm{full})\leq\|Y-f_{0}\|_{2}^{2}+\operatorname{pen}(m_{0})\leq 2a^{2}+2\|Z\|_{2}^{2}+\operatorname{pen}(m_{0})\text{;}$ on $E$ this gives $32\sigma^{2}N\leq 2a^{2}+2\|Z\|_{2}^{2}+\operatorname{pen}(m_{0})\text{.}$ On the event $\{\|Z\|_{2}^{2}\leq 2\sigma^{2}N\}\text{,}$ where $2\|Z\|_{2}^{2}\leq 4\sigma^{2}N\text{,}$ the preceding two inequalities force $28\sigma^{2}N\leq 2a^{2}+\operatorname{pen}(m_{0})\text{,}$ hence $\|Z\|_{2}^{2}\leq 2\sigma^{2}N\leq\tfrac{1}{14}\bigl(2a^{2}+\operatorname{pen}(m_{0})\bigr)\text{.}$ On the complement, the projection bound at $U=\mathbb{R}^{N}$ gives $\mathbb{P}(\|Z\|_{2}^{2}&amp;gt;2\sigma^{2}N)\leq 2^{N/2}e^{-N/2}\leq e^{-N/8}\text{;}$ moreover $\mathbb{E}\|Z\|_{2}^{4}=\sum_{i}\mathbb{E}Z_{i}^{4}+\sum_{i\neq j}\mathbb{E}Z_{i}^{2}\,\mathbb{E}Z_{j}^{2}\leq 3\sigma^{4}N+\sigma^{4}N(N-1)\leq 3\sigma^{4}N^{2}\text{,}$ the coordinates being independent with fourth moments at most $3\sigma^{4}\text{,}$ so the Cauchy–Schwarz inequality gives&lt;/p&gt;
&lt;table id="S6.Ex11" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\bigl[\|Z\|_{2}^{2}\,\mathbf{1}\{\|Z\|_{2}^{2}&amp;gt;2\sigma^{2}N\}\bigr]\ \leq\ \sqrt{3}\,\sigma^{2}N\,e^{-N/16}\ \leq\ C\sigma^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p8.2" class="ltx_p"&gt;the map $N\mapsto Ne^{-N/16}$ being bounded.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p9" class="ltx_para"&gt;
&lt;p id="S6.p9.1" class="ltx_p"&gt;&lt;em id="S6.p9.1.1" class="ltx_emph ltx_font_italic"&gt;Assembly.&lt;/em&gt; Combining &lt;a href="#S6.E1" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.1&lt;/span&gt;&lt;/a&gt; with the two estimates of the full-model case and using $\mathbb{E}Z^{*}\leq 1$ and the bracketing of $\operatorname{pen}(m_{0})$ on $E\text{,}$&lt;/p&gt;
&lt;table id="S6.Ex12" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\bigl[\|\widehat{\theta}-\theta\|_{2}^{2}\,\mathbf{1}_{E}\bigr]\ \leq\ C\bigl(a^{2}+\bar{\kappa}\,\sigma^{2}(D_{m_{0}}+\Delta_{m_{0}}+1)\bigr)+C\sigma^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p9.2" class="ltx_p"&gt;and taking the infimum over $m_{0}$ gives the first branch of the minimum. For the second branch, compare with the full model instead: if the full model is selected, then $\mathbb{E}[\|d\|_{2}^{2}\,\mathbf{1}_{E}]\leq\mathbb{E}\|Z\|_{2}^{2}\leq\sigma^{2}N\text{;}$ if some $\widehat{m}$ is selected, the basic inequality against the full model gives $\|Y-\widehat{\theta}\|_{2}^{2}\leq\operatorname{pen}(\mathrm{full})\leq\bar{\kappa}\sigma^{2}N$ on $E\text{,}$ so $\|d\|_{2}^{2}\leq 2\|Y-\widehat{\theta}\|_{2}^{2}+2\|Z\|_{2}^{2}$ has expectation at most $(2\bar{\kappa}+2)\sigma^{2}N$ there. Taking the minimum of the two comparisons completes the proof.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p10" class="ltx_para"&gt;
&lt;p id="S6.p10.1" class="ltx_p"&gt;Three features are used below. The penalties may be random, only their bracketing on $E$ entering the argument. The coordinate variances may differ and may vanish. And a point $\nu$ is the affine model $\{\nu\}$ with $D_{m}=0\text{,}$ whose oracle value reads $\|\theta-\nu\|_{2}^{2}+\sigma^{2}(\Delta_{\{\nu\}}+1)\text{;}$ we write $w(\nu)$ for the weight of a point model. The display (4.8) is the deterministic special case: penalties $C_{2}\sigma^{2}(\dim m+\Delta_{m})$ and $C_{2}\sigma^{2}N$ satisfy the bracketing with $E$ the whole probability space and $\bar{\kappa}=C_{2}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p11" class="ltx_para"&gt;
&lt;p id="S6.p11.1" class="ltx_p"&gt;The coverage argument will replace the unknown amplitude by a grid value and the unknown noise level by a rounded estimate. The next lemma prices both substitutions.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.Thmlemma2" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S6.Thmlemma2.2" class="ltx_text ltx_font_bold"&gt;Lemma S.6.2&lt;/span&gt;&lt;/span&gt;&lt;span id="S6.Thmlemma2.3" class="ltx_text ltx_font_bold"&gt; (Scale calculus).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S6.Thmlemma2.p1" class="ltx_para"&gt;
&lt;p id="S6.Thmlemma2.p1.1" class="ltx_p"&gt;&lt;span id="S6.Thmlemma2.p1.1.1" class="ltx_text ltx_font_italic"&gt;For every finite rooted tree, $R^{*}_{T}(V,\sigma)$ is nondecreasing in $V$ and in $\sigma\text{,}$ and for every $c\geq 1\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex13" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{*}_{T}(cV,\sigma)\ \leq\ c^{2}\,R^{*}_{T}(V,\sigma),\qquad R^{*}_{T}(V,c\sigma)\ \leq\ c^{2}\,R^{*}_{T}(V,\sigma).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S6.p12" class="ltx_para"&gt;
&lt;p id="S6.p12.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p13" class="ltx_para"&gt;
&lt;p id="S6.p13.1" class="ltx_p"&gt;&lt;em id="S6.p13.1.1" class="ltx_emph ltx_font_italic"&gt;Monotonicity in $V\text{.}$&lt;/em&gt; Let $V\leq V^{\prime}\text{.}$ The translation $\iota(\mu):=\mu+(V^{\prime}-V)p_{o}$ adds $V^{\prime}-V$ to the leak at the root and changes no other leak, so it maps $\mathcal{F}_{V}(T)$ into $\mathcal{F}_{V^{\prime}}(T)$ by Lemma 2.1. Given any estimator $\widehat{\mu}^{\prime}\text{,}$ define $\widehat{\mu}(Y):=\widehat{\mu}^{\prime}\bigl(Y+(V^{\prime}-V)p_{o}\bigr)-(V^{\prime}-V)p_{o}\text{.}$ Under $\mu\in\mathcal{F}_{V}(T)\text{,}$ the shifted data $Y+(V^{\prime}-V)p_{o}$ are distributed as an observation of $\iota(\mu)\text{,}$ and $\|\widehat{\mu}-\mu\|_{2}=\|\widehat{\mu}^{\prime}(Y+(V^{\prime}-V)p_{o})-\iota(\mu)\|_{2}\text{,}$ so the risk of $\widehat{\mu}$ at $\mu$ equals the risk of $\widehat{\mu}^{\prime}$ at $\iota(\mu)\in\mathcal{F}_{V^{\prime}}(T)\text{.}$ Taking the supremum over $\mu$ and then the infimum over $\widehat{\mu}^{\prime}$ gives $R^{*}_{T}(V,\sigma)\leq R^{*}_{T}(V^{\prime},\sigma)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p14" class="ltx_para"&gt;
&lt;p id="S6.p14.1" class="ltx_p"&gt;&lt;em id="S6.p14.1.1" class="ltx_emph ltx_font_italic"&gt;Monotonicity in $\sigma\text{.}$&lt;/em&gt; Let $\sigma\leq\sigma^{\prime}$ and let $W\sim N(0,(\sigma^{\prime 2}-\sigma^{2})I_{n})$ be independent of the data. For any estimator $\widehat{\mu}^{\prime}\text{,}$ the randomized procedure $\widehat{\mu}^{\prime}(Y+W)$ has, at every $\mu\text{,}$ the risk of $\widehat{\mu}^{\prime}$ under noise level $\sigma^{\prime}\text{;}$ replacing it by its average $\widehat{\mu}(Y):=\mathbb{E}_{W}\widehat{\mu}^{\prime}(Y+W)$ only lowers the squared-error risk, by Jensen’s inequality conditionally on $Y\text{,}$ and produces a deterministic estimator. Hence $R^{*}_{T}(V,\sigma)\leq R^{*}_{T}(V,\sigma^{\prime})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p15" class="ltx_para"&gt;
&lt;p id="S6.p15.1" class="ltx_p"&gt;&lt;em id="S6.p15.1.1" class="ltx_emph ltx_font_italic"&gt;The quadratic bounds.&lt;/em&gt; Scaling the observation, the parameter, and the estimator by $a&amp;gt;0$ turns the experiment at $(V,\sigma)$ into the experiment at $(aV,a\sigma)\text{,}$ since $\mathcal{F}_{aV}(T)=a\,\mathcal{F}_{V}(T)\text{;}$ the squared error scales by $a^{2}\text{,}$ so&lt;/p&gt;
&lt;table id="S6.Ex14" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{*}_{T}(aV,a\sigma)\ =\ a^{2}\,R^{*}_{T}(V,\sigma)\qquad(a&amp;gt;0).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p15.2" class="ltx_p"&gt;For $c\geq 1\text{,}$ combining this exact identity with the monotonicity just proved gives&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="S6.Ex15"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S6.Ex15X"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S6.Ex15Xa"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle R^{*}_{T}(cV,\sigma) &amp;amp; \displaystyle=\ c^{2}R^{*}_{T}(V,\sigma/c)\ \leq\ c^{2}R^{*}_{T}(V,\sigma), \\
\displaystyle R^{*}_{T}(V,c\sigma) &amp;amp; \displaystyle=\ c^{2}R^{*}_{T}(V/c,\sigma)\ \leq\ c^{2}R^{*}_{T}(V,\sigma),
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p id="S6.p15.3" class="ltx_p"&gt;using $\sigma/c\leq\sigma$ and $V/c\leq V\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p16" class="ltx_para"&gt;
&lt;p id="S6.p16.1" class="ltx_p"&gt;Two consequences are used repeatedly. First, for every amplitude $v&amp;gt;0$ and every working scale $s\in[\sigma/2,4\sigma]\text{,}$ monotonicity and the quadratic bound at $c=4$ give&lt;/p&gt;
&lt;table id="S6.E2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{*}_{T}(v,s)\ \leq\ R^{*}_{T}(v,4\sigma)\ \leq\ 16\,R^{*}_{T}(v,\sigma).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.6.2)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p16.2" class="ltx_p"&gt;Second, $k_{\mathrm{alg}}(T,v,s)\leq k_{0}(T,v,s)$ by Lemma 2.3(3), and the middle term below is at most $CR^{*}_{T}(v,s)$ by Theorem 1 at $(v,s)\text{,}$ so &lt;a href="#S6.E2" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.2&lt;/span&gt;&lt;/a&gt; gives&lt;/p&gt;
&lt;table id="S6.E3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\min\bigl\{v^{2}H_{T},\ s^{2}k_{\mathrm{alg}}(T,v,s)\bigr\}\ \leq\ \min\bigl\{v^{2}H_{T},\ s^{2}k_{0}(T,v,s)\bigr\}\ \leq\ C\,R^{*}_{T}(v,\sigma),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.6.3)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p16.3" class="ltx_p"&gt;valid for all $v&amp;gt;0$ and $s\in[\sigma/2,4\sigma]\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p17" class="ltx_para"&gt;
&lt;p id="S6.p17.1" class="ltx_p"&gt;The amplitude-free half of the candidate system rests on the subspace approximation (4.7), verified next with an explicit constant.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.Thmlemma3" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S6.Thmlemma3.2" class="ltx_text ltx_font_bold"&gt;Lemma S.6.3&lt;/span&gt;&lt;/span&gt;&lt;span id="S6.Thmlemma3.3" class="ltx_text ltx_font_bold"&gt; (Subspace approximation).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S6.Thmlemma3.p1" class="ltx_para"&gt;
&lt;p id="S6.Thmlemma3.p1.1" class="ltx_p"&gt;&lt;span id="S6.Thmlemma3.p1.1.1" class="ltx_text ltx_font_italic"&gt;For every $\mu\in\mathcal{F}_{V}(T)$ and every integer $2\leq k\leq n/C_{\star}$ there is an admissible support $S$ with&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex16" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\operatorname{dist}^{2}\bigl(\mu,\ \mathcal{V}_{k,S}\bigr)\ \leq\ 22\,V^{2}\overline{\delta}_{k}(T).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S6.p18" class="ltx_para"&gt;
&lt;p id="S6.p18.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p19" class="ltx_para"&gt;
&lt;p id="S6.p19.1" class="ltx_p"&gt;Run the proof of Proposition 3.1 on the normalized signal $f:=\mu/V\text{,}$ retaining its objects: the terminal cells $L$ with masses $\lambda_{L}$ and exits $q_{L}\text{;}$ the collapse $g$ with $\|f-g\|_{2}^{2}\leq 3\bar{\alpha}/k$ by (3.4); the skeleton $g_{0}=\sum_{h\in U}b_{h}\,p_{h}\text{,}$ supported on the set $U$ consisting of $R_{0}$ and the heavy roots, with $g=g_{0}+\sum_{L}\lambda_{L}q_{L}\text{;}$ and the exit sampling, fixed at a realization with $W\leq 2k$ and $\|\sum_{L}(Z_{L}-\lambda_{L})q_{L}\|_{2}^{2}\leq 8\bar{\alpha}/k\text{.}$ Keep the skeleton unrounded and set&lt;/p&gt;
&lt;table id="S6.Ex17" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\nu\ :=\ g_{0}+\sum_{L}Z_{L}q_{L},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p19.2" class="ltx_p"&gt;a real linear combination of $\{p_{v}:\ v\in U\cup\{a_{L}:Z_{L}\neq 0\}\}\text{.}$ The set $S:=\bigl(U\cup\{a_{L}:Z_{L}\neq 0\}\bigr)\setminus R_{0}$ is admissible: the heavy roots carry total activation charge below $2k$ by &lt;a href="#S2.Thmlemma3a" title="Lemma S.2.3 (The heavy structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.3&lt;/span&gt;&lt;/a&gt;(3); the selected exit roots are pairwise distinct with $\widetilde{\omega}(a_{L})\leq m(L)\text{,}$ so their charges total at most $W\leq 2k\text{;}$ and a union is charged at most the sum of its parts. Hence $\sum_{v\in S}\widetilde{\omega}(v)\leq 4k\text{.}$ Since $\nu\in\mathcal{V}_{k,S}$ and $f-\nu=(f-g)+\sum_{L}(\lambda_{L}-Z_{L})q_{L}\text{,}$&lt;/p&gt;
&lt;table id="S6.Ex18" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\operatorname{dist}^{2}\bigl(f,\ \mathcal{V}_{k,S}\bigr)\ \leq\ \|f-\nu\|_{2}^{2}\ \leq\ 2\,\frac{3\bar{\alpha}}{k}+2\,\frac{8\bar{\alpha}}{k}\ =\ 22\,\frac{\bar{\alpha}}{k}\ =\ 22\,\overline{\delta}_{k}(T).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p19.3" class="ltx_p"&gt;Restoring the amplitude multiplies the squared distance by $V^{2}\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p20" class="ltx_para"&gt;
&lt;p id="S6.p20.1" class="ltx_p"&gt;Selecting over the capped subspaces requires listing them; this is the enumeration claim of Section 4.3.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.Thmlemma4" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S6.Thmlemma4.2" class="ltx_text ltx_font_bold"&gt;Lemma S.6.4&lt;/span&gt;&lt;/span&gt;&lt;span id="S6.Thmlemma4.3" class="ltx_text ltx_font_bold"&gt; (Support enumeration).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S6.Thmlemma4.p1" class="ltx_para"&gt;
&lt;p id="S6.Thmlemma4.p1.1" class="ltx_p"&gt;&lt;span id="S6.Thmlemma4.p1.1.1" class="ltx_text ltx_font_italic"&gt;For every integer $2\leq k\leq n/C_{\star}\text{,}$ the admissible supports at budget $k$ number at most $e^{C_{1}k}\text{,}$ and they can be listed in $O(|A_{k}|\,e^{C_{1}k})$ operations.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S6.p21" class="ltx_para"&gt;
&lt;p id="S6.p21.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p22" class="ltx_para"&gt;
&lt;p id="S6.p22.1" class="ltx_p"&gt;An admissible support is a subset of $A_{k}\setminus R_{0}$ of total activation charge at most $4k\leq 9k\text{,}$ hence one of the charged parts counted in the proof of &lt;a href="#S2.Thmlemma5" title="Lemma S.2.5 (Counting bound). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.5&lt;/span&gt;&lt;/a&gt;, where the generating-function estimate bounds their number by $e^{19k}\leq e^{C_{1}k}\text{.}$ To enumerate, fix a linear order on $A_{k}\setminus R_{0}$ and run a depth-first search over subsets that appends only higher-indexed vertices and recurses only while the accumulated charge remains at most $4k\text{.}$ Every node visited by the search is an admissible support, every admissible support is visited exactly once, along the insertion order of its elements, and testing all extensions of a visited support costs $O(|A_{k}|)$ operations.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p23" class="ltx_para"&gt;
&lt;p id="S6.p23.1" class="ltx_p"&gt;&lt;em id="S6.p23.1.1" class="ltx_emph ltx_font_italic"&gt;The candidate system.&lt;/em&gt; The estimator of Theorem 3 is the penalized selection of &lt;a href="#S6.Thmlemma1" title="Lemma S.6.1 (Weighted affine selection). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.1&lt;/span&gt;&lt;/a&gt; over the candidates described in Section 4.3, which we now fix precisely. The system is parameterized by a working scale $s\text{,}$ equal to $\sigma$ in Theorem 3 and to the rounded noise estimate in Theorem 4. Fix a universal threshold $n_{\star}$ such that&lt;/p&gt;
&lt;table id="S6.Ex19" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Bigl\lfloor\frac{\log n}{2C_{1}}\Bigr\rfloor\ \geq\ 2\qquad\text{and}\qquad\Bigl\lfloor\frac{\log n}{2C_{1}}\Bigr\rfloor\ \leq\ \Bigl\lfloor\frac{n}{C_{\star}}\Bigr\rfloor\qquad\text{for every }n\geq n_{\star}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p23.2" class="ltx_p"&gt;For $n&amp;lt;n_{\star}$ the estimator returns $Y\text{,}$ whose risk $n\sigma^{2}\leq n_{\star}\sigma^{2}$ is absorbed by the additive $\sigma^{2}$ after enlarging the universal constant; assume $n\geq n_{\star}$ from here on, and set $k^{\star}:=\lfloor\log n/(2C_{1})\rfloor\text{,}$ so that $2\leq k^{\star}\leq K\text{.}$ Write&lt;/p&gt;
&lt;table id="S6.Ex20" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$v_{i}:=(Y_{o})_{+}+2^{i}s\ \ (0\leq i\leq J^{+}),\qquad v^{-}_{j}:=2^{-j}s\ \ (1\leq j\leq J^{-}),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p23.3" class="ltx_p"&gt;with $J^{+}=J^{-}:=\lceil\log_{2}(n+1)\rceil+2\text{,}$ for the root-anchored and the low-amplitude grids. Throughout, $\mathcal{X}_{k}$ is the class (4.1) of integer states of Section 4.1. The candidates are:&lt;/p&gt;
&lt;ul id="S6.I5" class="ltx_itemize"&gt;
&lt;li id="S6.I5.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S6.I5.i1.p1" class="ltx_para"&gt;
&lt;p id="S6.I5.i1.p1.1" class="ltx_p"&gt;the subspaces $\mathcal{V}_{k,S}$ for dyadic $2\leq k\leq k^{\star}$
and admissible $S\text{,}$ with weights $\Delta_{k,S}:=(C_{1}+1)k\text{,}$ together
with $\operatorname{span}(p_{o})$ at weight $1\text{;}$&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S6.I5.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S6.I5.i2.p1" class="ltx_para"&gt;
&lt;p id="S6.I5.i2.p1.1" class="ltx_p"&gt;the point models $\nu_{i,k,x}:=(v_{i}/k)\,x$ for $x\in\mathcal{X}_{k}$ and dyadic $2\leq k\leq K\text{,}$ at weights
$w(\nu_{i,k,x}):=2\Gamma(x)+k+i+\log_{2}k+4\text{,}$ and the root points
$\nu^{0}_{i}:=v_{i}\,p_{o}$ at weights $i+4\text{;}$ their low-amplitude
counterparts $\nu^{-}_{j,k,x}:=(v^{-}_{j}/k)\,x$ at weights
$2\Gamma(x)+k+2\log(1+j)+\log_{2}k+4\text{,}$ and $\nu^{0-}_{j}:=v^{-}_{j}\,p_{o}$ at
weights $2\log(1+j)+4\text{;}$&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S6.I5.i3" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S6.I5.i3.p1" class="ltx_para"&gt;
&lt;p id="S6.I5.i3.p1.1" class="ltx_p"&gt;the full model.&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p id="S6.p23.4" class="ltx_p"&gt;The penalties are $\operatorname{pen}(m):=C_{2}s^{2}(D_{m}+\Delta_{m})$ for the affine and point models, with $\Delta_{m}$ the weight just listed, and $\operatorname{pen}(\mathrm{full}):=C_{2}s^{2}n\text{.}$ The supports $A_{k}\text{,}$ the charges $\widetilde{\omega}\text{,}$ and hence $\Gamma$ and $\mathcal{X}_{k}$ depend only on $(T,k)$ (Proposition 3.1); a grid index enters only through its amplitude and its weight, and all tie breaks are fixed, so the system and its penalties are deterministic given $(Y_{o},s)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p24" class="ltx_para"&gt;
&lt;p id="S6.p24.1" class="ltx_p"&gt;The weights are Kraft-summable with room to spare. For the subspaces, &lt;a href="#S6.Thmlemma4" title="Lemma S.6.4 (Support enumeration). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.4&lt;/span&gt;&lt;/a&gt; gives&lt;/p&gt;
&lt;table id="S6.Ex21" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{\begin{subarray}{c}k\ \mathrm{dyadic}\\ 2\leq k\leq k^{\star}\end{subarray}}\ \sum_{S\ \mathrm{admissible}}e^{-(C_{1}+1)k}\ +\ e^{-1}\ \leq\ \sum_{\begin{subarray}{c}k\ \mathrm{dyadic}\\ k\geq 2\end{subarray}}e^{-k}+e^{-1}\ &amp;lt;\ 0.16+0.37\ =\ 0.53.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p24.2" class="ltx_p"&gt;For the grid family, &lt;a href="#S5.Thmlemma1" title="Lemma S.5.1 (Normalizing sum). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.1&lt;/span&gt;&lt;/a&gt; gives $\sum_{x\in\mathcal{X}_{k}}e^{-2\Gamma(x)-k}\leq 1$ for every dyadic $k=2^{\ell}\text{,}$ so, once the price of the grid index is factored out, each amplitude contributes at most $1$ from its root candidate and $\sum_{\ell\geq 1}e^{-\ell}$ from its flow candidates, and&lt;/p&gt;
&lt;table id="S6.E4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{\text{grid models}}e^{-w}\ \leq\ \Bigl(\sum_{i\geq 0}e^{-i-4}+\sum_{j\geq 1}\frac{e^{-4}}{(1+j)^{2}}\Bigr)\Bigl(1+\sum_{\ell\geq 1}e^{-\ell}\Bigr)\\ =\ e^{-4}\Bigl(\frac{e}{e-1}+\frac{\pi^{2}}{6}-1\Bigr)\frac{e}{e-1}\ &amp;lt;\ \frac{1}{8}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.6.4)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p24.3" class="ltx_p"&gt;The total is below $1\text{,}$ as &lt;a href="#S6.Thmlemma1" title="Lemma S.6.1 (Weighted affine selection). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.1&lt;/span&gt;&lt;/a&gt; requires.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p25" class="ltx_para"&gt;
&lt;p id="S6.p25.1" class="ltx_p"&gt;The root-anchored grid is finite, and the truth can exceed its top value only after a downward root-noise fluctuation of order $n\text{.}$ The next lemma quantifies both halves of this statement; its event $\mathcal{E}_{+}$ is the one announced in Section 4.3.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.Thmlemma5" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S6.Thmlemma5.2" class="ltx_text ltx_font_bold"&gt;Lemma S.6.5&lt;/span&gt;&lt;/span&gt;&lt;span id="S6.Thmlemma5.3" class="ltx_text ltx_font_bold"&gt; (Anchor event).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S6.Thmlemma5.p1" class="ltx_para"&gt;
&lt;p id="S6.Thmlemma5.p1.1" class="ltx_p"&gt;&lt;span id="S6.Thmlemma5.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $s\in[\sigma/2,4\sigma]\text{,}$ extend the anchored grid to $v_{i}=(Y_{o})_{+}+2^{i}s$ for all integers $i\geq 0\text{,}$ and set&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex22" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$i^{*}\ :=\ \min\{i\geq 0:\ v_{i}\geq V\},\qquad\mathcal{E}_{+}\ :=\ \{i^{*}\leq J^{+}\},\qquad Z_{o}\ :=\ Z(o).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.Thmlemma5.p1.2" class="ltx_p"&gt;&lt;span id="S6.Thmlemma5.p1.2.1" class="ltx_text ltx_font_italic"&gt;Then:&lt;/span&gt;&lt;/p&gt;
&lt;ol id="S6.I6" class="ltx_enumerate"&gt;
&lt;li id="S6.I6.i1" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;1.&lt;/span&gt;
&lt;div id="S6.I6.i1.p1" class="ltx_para"&gt;
&lt;p id="S6.I6.i1.p1.1" class="ltx_p"&gt;&lt;span id="S6.I6.i1.p1.1.1" class="ltx_text ltx_font_italic"&gt;pointwise,
&lt;/span&gt;$2^{i^{*}}s\leq 2s+2\sigma|Z_{o}|$&lt;span id="S6.I6.i1.p1.1.2" class="ltx_text ltx_font_italic"&gt;, and consequently&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex23" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$i^{*}\leq 1+\log_{2}\bigl(1+2|Z_{o}|\bigr),\qquad v_{i^{*}}\leq V+2s+3\sigma|Z_{o}|,\qquad 0\ \leq\ v_{i^{*}}-Y_{o}\ \leq\ 2s+3\sigma|Z_{o}|,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.I6.i1.p1.2" class="ltx_p"&gt;&lt;span id="S6.I6.i1.p1.2.1" class="ltx_text ltx_font_italic"&gt;and in expectation
&lt;/span&gt;$\mathbb{E}\bigl[\sigma^{2}(1+i^{*})+(Y_{o}-v_{i^{*}})^{2}\bigr]\leq C\sigma^{2}$&lt;span id="S6.I6.i1.p1.2.2" class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S6.I6.i2" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;2.&lt;/span&gt;
&lt;div id="S6.I6.i2.p1" class="ltx_para"&gt;
&lt;p id="S6.I6.i2.p1.1" class="ltx_p"&gt;$\mathcal{E}_{+}^{\,c}\subseteq\{Z_{o}&amp;lt;-2(n+1)\}$&lt;span id="S6.I6.i2.p1.1.1" class="ltx_text ltx_font_italic"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li id="S6.I6.i3" class="ltx_item" style="list-style-type:none;"&gt;&lt;span class="ltx_tag ltx_tag_item"&gt;3.&lt;/span&gt;
&lt;div id="S6.I6.i3.p1" class="ltx_para"&gt;
&lt;p id="S6.I6.i3.p1.1" class="ltx_p"&gt;&lt;span id="S6.I6.i3.p1.1.1" class="ltx_text ltx_font_italic"&gt;every penalized selection of this section,
the full model carrying penalty &lt;/span&gt;$C_{2}s^{2}n$&lt;span id="S6.I6.i3.p1.1.2" class="ltx_text ltx_font_italic"&gt; and all penalties being
nonnegative, satisfies pathwise
&lt;/span&gt;$\|\widehat{\mu}-\mu\|_{2}^{2}\leq 2C_{2}s^{2}n+2\sigma^{2}\|Z\|_{2}^{2}$&lt;span id="S6.I6.i3.p1.1.3" class="ltx_text ltx_font_italic"&gt;, and therefore
&lt;/span&gt;$\mathbb{E}\bigl[\|\widehat{\mu}-\mu\|_{2}^{2}\,\mathbf{1}_{\mathcal{E}_{+}^{c}}\bigr]\leq C\sigma^{2}$&lt;span id="S6.I6.i3.p1.1.4" class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S6.p26" class="ltx_para"&gt;
&lt;p id="S6.p26.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p27" class="ltx_para"&gt;
&lt;p id="S6.p27.1" class="ltx_p"&gt;&lt;em id="S6.p27.1.1" class="ltx_emph ltx_font_italic"&gt;Part (1).&lt;/em&gt; Since $Y_{o}=V+\sigma Z_{o}$ and $(Y_{o})_{+}\geq Y_{o}\text{,}$&lt;/p&gt;
&lt;table id="S6.Ex24" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$V-(Y_{o})_{+}\ \leq\ (V-Y_{o})_{+}\ =\ (-\sigma Z_{o})_{+}\ \leq\ \sigma|Z_{o}|.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p27.2" class="ltx_p"&gt;If $\sigma|Z_{o}|\leq s\text{,}$ then $v_{0}=(Y_{o})_{+}+s\geq V-\sigma|Z_{o}|+s\geq V\text{,}$ so $i^{*}=0$ and $2^{i^{*}}s=s\text{.}$ If $\sigma|Z_{o}|&amp;gt;s$ and $i^{*}\geq 1\text{,}$ minimality gives $v_{i^{*}-1}&amp;lt;V\text{,}$ that is, $2^{i^{*}-1}s&amp;lt;V-(Y_{o})_{+}\leq\sigma|Z_{o}|\text{,}$ so $2^{i^{*}}s&amp;lt;2\sigma|Z_{o}|\text{;}$ and if $\sigma|Z_{o}|&amp;gt;s$ and $i^{*}=0\text{,}$ then $2^{i^{*}}s=s&amp;lt;2\sigma|Z_{o}|\text{.}$ In every case $2^{i^{*}}s\leq 2s+2\sigma|Z_{o}|\text{,}$ and $i^{*}$ is finite, the grid values increasing to infinity. Dividing by $s\geq\sigma/2$ gives $2^{i^{*}}\leq 2+4|Z_{o}|=2(1+2|Z_{o}|)\text{,}$ which is the bound on $i^{*}\text{.}$ Next, $(Y_{o})_{+}\leq V+\sigma|Z_{o}|\text{,}$ since $Y_{o}\leq V+\sigma|Z_{o}|$ and $0\leq V\text{,}$ so $v_{i^{*}}=(Y_{o})_{+}+2^{i^{*}}s\leq V+\sigma|Z_{o}|+2s+2\sigma|Z_{o}|\text{.}$ For the last pointwise claim, $v_{i^{*}}\geq Y_{o}$ because $(Y_{o})_{+}\geq Y_{o}\text{,}$ and&lt;/p&gt;
&lt;table id="S6.Ex25" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$v_{i^{*}}-Y_{o}\ =\ \bigl((Y_{o})_{+}-Y_{o}\bigr)+2^{i^{*}}s\ \leq\ (-Y_{o})_{+}+2s+2\sigma|Z_{o}|\ \leq\ 2s+3\sigma|Z_{o}|,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p27.3" class="ltx_p"&gt;since $-Y_{o}=-V-\sigma Z_{o}\leq\sigma|Z_{o}|\text{.}$ In expectation, $\mathbb{E}\,i^{*}\leq 1+\log_{2}(1+2\,\mathbb{E}|Z_{o}|)\leq 3$ by concavity of $t\mapsto\log_{2}(1+2t)$ and $\mathbb{E}|Z_{o}|\leq 1\text{,}$ while $\mathbb{E}(Y_{o}-v_{i^{*}})^{2}\leq 2(2s)^{2}+18\sigma^{2}\mathbb{E}Z_{o}^{2}\leq 146\sigma^{2}\text{,}$ using $s\leq 4\sigma\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p28" class="ltx_para"&gt;
&lt;p id="S6.p28.1" class="ltx_p"&gt;&lt;em id="S6.p28.1.1" class="ltx_emph ltx_font_italic"&gt;Part (2).&lt;/em&gt; On $\mathcal{E}_{+}^{\,c}\text{,}$ $i^{*}&amp;gt;J^{+}\text{,}$ so $v_{J^{+}}&amp;lt;V$ and&lt;/p&gt;
&lt;table id="S6.Ex26" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$(-\sigma Z_{o})_{+}\ \geq\ V-(Y_{o})_{+}\ &amp;gt;\ 2^{J^{+}}s\ \geq\ 4(n+1)\cdot\frac{\sigma}{2}\ =\ 2(n+1)\,\sigma,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p28.2" class="ltx_p"&gt;using $2^{J^{+}}\geq 2^{\log_{2}(n+1)+2}=4(n+1)$ and $s\geq\sigma/2\text{;}$ the positive part is positive here, so it equals $-\sigma Z_{o}\text{,}$ and $Z_{o}&amp;lt;-2(n+1)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p29" class="ltx_para"&gt;
&lt;p id="S6.p29.1" class="ltx_p"&gt;&lt;em id="S6.p29.1.1" class="ltx_emph ltx_font_italic"&gt;Part (3).&lt;/em&gt; The selected criterion value is at most the full model’s, whose fit is $Y$ itself, so $\|Y-\widehat{\mu}\|_{2}^{2}\leq\|Y-\widehat{\mu}\|_{2}^{2}+\operatorname{pen}(\widehat{m})\leq\operatorname{pen}(\mathrm{full})=C_{2}s^{2}n\text{,}$ and $\|\widehat{\mu}-\mu\|_{2}^{2}\leq 2\|\widehat{\mu}-Y\|_{2}^{2}+2\|Y-\mu\|_{2}^{2}\leq 2C_{2}s^{2}n+2\sigma^{2}\|Z\|_{2}^{2}\text{.}$ Put $a:=2(n+1)\text{.}$ By part (&lt;a href="#S6.I6.i2" title="Item 2 ‣ Lemma S.6.5 (Anchor event). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;) and the independence of $Z_{o}$ from the nonroot coordinates,&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="S6.EGx8"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S6.Ex27"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S6.Ex28"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle\mathbb{E}\bigl[\|Z\|_{2}^{2}\,\mathbf{1}_{\mathcal{E}_{+}^{c}}\bigr]\space &amp;amp; \displaystyle\leq\ (n-1)\,\mathbb{P}(Z_{o}&amp;lt;-a)+\mathbb{E}\bigl[Z_{o}^{2}\,\mathbf{1}\{Z_{o}&amp;lt;-a\}\bigr] \\
&amp;amp; \displaystyle\leq\ (n-1)\,e^{-a^{2}/2}+a\,\phi_{\mathcal{N}}(a)+\Phi_{\mathcal{N}}(-a)\ \leq\ C,
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p id="S6.p29.2" class="ltx_p"&gt;where $\phi_{\mathcal{N}}$ is the standard normal density, the middle step by the Gaussian tail bound and one integration by parts. With $s^{2}\leq 16\sigma^{2}$ and $n\,e^{-a^{2}/2}\leq C\text{,}$ the pathwise bound integrates to $\mathbb{E}[\|\widehat{\mu}-\mu\|_{2}^{2}\mathbf{1}_{\mathcal{E}_{+}^{c}}]\leq C\sigma^{2}\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p30" class="ltx_para"&gt;
&lt;p id="S6.p30.1" class="ltx_p"&gt;With the anchor in place, some grid candidate always sits close to the truth at a price the selection can afford. The lemma is stated conditionally on the root observation, matching the conditional analysis of the selection to come.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.Thmlemma6" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S6.Thmlemma6.2" class="ltx_text ltx_font_bold"&gt;Lemma S.6.6&lt;/span&gt;&lt;/span&gt;&lt;span id="S6.Thmlemma6.3" class="ltx_text ltx_font_bold"&gt; (Grid coverage).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S6.Thmlemma6.p1" class="ltx_para"&gt;
&lt;p id="S6.Thmlemma6.p1.1" class="ltx_p"&gt;&lt;span id="S6.Thmlemma6.p1.1.1" class="ltx_text ltx_font_italic"&gt;Condition on $Y_{o}=y_{0}\text{,}$ let $s\in[\sigma/2,4\sigma]\text{,}$ suppose $\mathcal{E}_{+}$ holds, and write $v:=v_{i^{*}}\text{,}$ $k^{\prime}:=k_{\mathrm{alg}}(T,v,s)\text{,}$ and $\widetilde{\theta}:=(y_{0},\mu_{-o})\text{.}$ Let $\mathfrak{O}$ be the minimum, over the point models of the candidate system and the full model, of the oracle values of &lt;a href="#S6.Thmlemma1" title="Lemma S.6.1 (Weighted affine selection). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.1&lt;/span&gt;&lt;/a&gt; at mean $\widetilde{\theta}\text{:}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex29" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathfrak{O}\ :=\ \min\Bigl\{\ \inf_{\nu}\bigl(\|\widetilde{\theta}-\nu\|_{2}^{2}+\sigma^{2}(w(\nu)+1)\bigr),\ \ \sigma^{2}n\ \Bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.Thmlemma6.p1.2" class="ltx_p"&gt;&lt;span id="S6.Thmlemma6.p1.2.1" class="ltx_text ltx_font_italic"&gt;Then, for every realization,&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.E5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathfrak{O}\ \leq\ C\Bigl(R^{*}_{T}(v,\sigma)+(y_{0}-v)^{2}+\sigma^{2}(1+i^{*})\Bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.6.5)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.Thmlemma6.p1.3" class="ltx_p"&gt;&lt;span id="S6.Thmlemma6.p1.3.1" class="ltx_text ltx_font_italic"&gt;If moreover $V&amp;lt;s/2\text{,}$ set $j^{*}:=\lfloor\log_{2}(s/V)\rfloor\geq 1\text{,}$ so that $v^{-}_{j^{*}}\in[V,2V]\text{;}$ if $j^{*}\leq J^{-}\text{,}$ then also&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.E6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathfrak{O}\ \leq\ C\Bigl(R^{*}_{T}\bigl(v^{-}_{j^{*}},\sigma\bigr)+\bigl(y_{0}-v^{-}_{j^{*}}\bigr)^{2}+\sigma^{2}\bigl(1+\log(1+j^{*})\bigr)\Bigr).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.6.6)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S6.p31" class="ltx_para"&gt;
&lt;p id="S6.p31.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p32" class="ltx_para"&gt;
&lt;p id="S6.p32.1" class="ltx_p"&gt;Every candidate of anchored index $i^{*}$ has root coordinate exactly $v\text{:}$ the flow candidates because their root state is $k\text{,}$ so $\nu_{i^{*},k,x}(o)=(v/k)\,k=v\text{,}$ and the root candidates trivially. Since $v\geq V\text{,}$ the translate $\mu^{\prime}:=\mu+(v-V)p_{o}$ lies in $\mathcal{F}_{v}(T)$ by Lemma 2.1 and agrees with $\mu$ off the root, with $\mu^{\prime}(o)=v\text{;}$ hence, for every such candidate $\nu\text{,}$&lt;/p&gt;
&lt;table id="S6.E7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\|\widetilde{\theta}-\nu\|_{2}^{2}\ =\ (y_{0}-v)^{2}+\|\mu^{\prime}-\nu\|_{2}^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.6.7)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p32.2" class="ltx_p"&gt;Let $k_{\max}$ be the largest dyadic integer at most $K\text{,}$ defined when $K\geq 2\text{,}$ so that $2k_{\max}&amp;gt;K\text{.}$ There are three exhaustive cases.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p33" class="ltx_para"&gt;
&lt;p id="S6.p33.1" class="ltx_p"&gt;&lt;em id="S6.p33.1.1" class="ltx_emph ltx_font_italic"&gt;Case (a): $s^{2}k^{\prime}\leq v^{2}H_{T}\text{,}$ $K\geq 2\text{,}$ and $k^{\prime}\leq k_{\max}\text{.}$&lt;/em&gt; Choose the smallest dyadic $k\geq\max\{k^{\prime},2\}\text{;}$ then $k\leq 2k^{\prime}$ and $k\leq k_{\max}\leq K\text{,}$ since $k_{\max}$ is itself a dyadic integer at least $\max\{k^{\prime},2\}\text{.}$ Proposition 3.1(1), applied to $\mu^{\prime}\in\mathcal{F}_{v}(T)$ at budget $k$ and taken with the explicit constant of its error assembly in &lt;a href="#S2a" title="S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2&lt;/span&gt;&lt;/a&gt;, supplies $x^{\star}\in\mathcal{X}_{k}$ with $\Gamma(x^{\star})\leq 9k$ and&lt;/p&gt;
&lt;table id="S6.Ex30" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\|\mu^{\prime}-\nu_{i^{*},k,x^{\star}}\|_{2}^{2}\ \leq\ 51\,v^{2}\overline{\delta}_{k}(T)\ \leq\ 51\,v^{2}\overline{\delta}_{k^{\prime}}(T)\ \leq\ 102\,A_{0}\,s^{2}k^{\prime},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p33.2" class="ltx_p"&gt;the second step by the monotonicity of $\overline{\delta}$ (Lemma 2.3(3)) and $k\geq k^{\prime}\text{,}$ the third because the dimension clause of (2.2) is silent at $k^{\prime}\leq K\text{,}$ so its surrogate crossing clause fired there: $v^{2}\overline{\delta}_{k^{\prime}}\leq 2A_{0}s^{2}k^{\prime}\text{.}$ The weight obeys&lt;/p&gt;
&lt;table id="S6.Ex31" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$w(\nu_{i^{*},k,x^{\star}})\ =\ 2\Gamma(x^{\star})+k+i^{*}+\log_{2}k+4\ \leq\ 19k+i^{*}+\log_{2}k+4\ \leq\ C(k^{\prime}+i^{*}+1).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p33.3" class="ltx_p"&gt;By the case hypothesis and &lt;a href="#S6.E3" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.3&lt;/span&gt;&lt;/a&gt;, $s^{2}k^{\prime}=\min\{v^{2}H_{T},s^{2}k^{\prime}\}\leq CR^{*}_{T}(v,\sigma)\text{,}$ and $\sigma^{2}k^{\prime}\leq 4s^{2}k^{\prime}\text{;}$ with &lt;a href="#S6.E7" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.7&lt;/span&gt;&lt;/a&gt;, the candidate’s oracle value is therefore at most $(y_{0}-v)^{2}+CR^{*}_{T}(v,\sigma)+C\sigma^{2}(1+i^{*})\text{,}$ which is &lt;a href="#S6.E5" title="In Lemma S.6.6 (Grid coverage). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.5&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p34" class="ltx_para"&gt;
&lt;p id="S6.p34.1" class="ltx_p"&gt;&lt;em id="S6.p34.1.1" class="ltx_emph ltx_font_italic"&gt;Case (b): $v^{2}H_{T}&amp;lt;s^{2}k^{\prime}\text{.}$&lt;/em&gt; Take the root candidate $\nu^{0}_{i^{*}}\text{,}$ whose nonroot coordinates vanish. By &lt;a href="#S6.E7" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.7&lt;/span&gt;&lt;/a&gt; and the convexity bound $\|\mu-Vp_{o}\|_{2}\leq V\sqrt{h_{T}}$ established in the proof of &lt;a href="#S5.Thmlemma2" title="Lemma S.5.2 (Elementary branches). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.2&lt;/span&gt;&lt;/a&gt;,&lt;/p&gt;
&lt;table id="S6.Ex32" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\|\widetilde{\theta}-\nu^{0}_{i^{*}}\|_{2}^{2}\ =\ (y_{0}-v)^{2}+\|\mu-Vp_{o}\|_{2}^{2}\ \leq\ (y_{0}-v)^{2}+V^{2}h_{T},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p34.2" class="ltx_p"&gt;and $V^{2}h_{T}\leq v^{2}H_{T}=\min\{v^{2}H_{T},s^{2}k^{\prime}\}\leq CR^{*}_{T}(v,\sigma)$ by &lt;a href="#S6.E3" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.3&lt;/span&gt;&lt;/a&gt;. The weight is $i^{*}+4\text{,}$ so the oracle value is at most $(y_{0}-v)^{2}+CR^{*}_{T}(v,\sigma)+\sigma^{2}(i^{*}+5)\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p35" class="ltx_para"&gt;
&lt;p id="S6.p35.1" class="ltx_p"&gt;&lt;em id="S6.p35.1.1" class="ltx_emph ltx_font_italic"&gt;Case (c): $s^{2}k^{\prime}\leq v^{2}H_{T}\text{,}$ and $K\leq 1$ or $k^{\prime}&amp;gt;k_{\max}\text{.}$&lt;/em&gt; If $K\geq 2$ and $k^{\prime}&amp;gt;k_{\max}\text{,}$ then $K&amp;lt;2k_{\max}&amp;lt;2k^{\prime}$ and $n&amp;lt;C_{\star}(K+1)\leq 2C_{\star}K&amp;lt;4C_{\star}k^{\prime}\text{,}$ so&lt;/p&gt;
&lt;table id="S6.Ex33" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sigma^{2}n\ \leq\ 4s^{2}n\ &amp;lt;\ 16\,C_{\star}\,s^{2}k^{\prime}\ \leq\ C\,R^{*}_{T}(v,\sigma)$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p35.2" class="ltx_p"&gt;by the case hypothesis and &lt;a href="#S6.E3" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.3&lt;/span&gt;&lt;/a&gt;: the full-model branch of $\mathfrak{O}$ qualifies. If $K\leq 1\text{,}$ then $n&amp;lt;2C_{\star}\text{,}$ and $\sigma^{2}n\leq 2C_{\star}\sigma^{2}$ is absorbed by the term $\sigma^{2}(1+i^{*})$ of &lt;a href="#S6.E5" title="In Lemma S.6.6 (Grid coverage). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.5&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p36" class="ltx_para"&gt;
&lt;p id="S6.p36.1" class="ltx_p"&gt;&lt;em id="S6.p36.1.1" class="ltx_emph ltx_font_italic"&gt;The low-amplitude bound.&lt;/em&gt; Let $V&amp;lt;s/2$ and $j^{*}\leq J^{-}\text{.}$ From $2^{j^{*}}\leq s/V&amp;lt;2^{j^{*}+1}\text{,}$ the amplitude $v^{-}_{j^{*}}=2^{-j^{*}}s$ lies in $[V,2V)\text{,}$ the translate $\mu+(v^{-}_{j^{*}}-V)p_{o}$ lies in $\mathcal{F}_{v^{-}_{j^{*}}}(T)$ and agrees with $\mu$ off the root, and every candidate of low-amplitude index $j^{*}$ has root coordinate exactly $v^{-}_{j^{*}}\text{,}$ so &lt;a href="#S6.E7" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.7&lt;/span&gt;&lt;/a&gt; holds with $v^{-}_{j^{*}}$ in place of $v\text{.}$ The three cases above run verbatim at the amplitude $v^{-}_{j^{*}}$ and its crossing index $k_{\mathrm{alg}}(T,v^{-}_{j^{*}},s)\text{,}$ the weight contributions $i^{*}+\log_{2}k+4$ and $i^{*}+4$ replaced by $2\log(1+j^{*})+\log_{2}k+4$ and $2\log(1+j^{*})+4\text{;}$ they yield &lt;a href="#S6.E6" title="In Lemma S.6.6 (Grid coverage). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.6&lt;/span&gt;&lt;/a&gt;.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p37" class="ltx_para"&gt;
&lt;p id="S6.p37.1" class="ltx_p"&gt;One computational ingredient remains before the assembly: the inner minimization of the selection criterion over an integer-state class. It is the min-plus analogue of the evaluation of &lt;a href="#S5.Thmlemma4" title="Lemma S.5.4 (Message recursion). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.4&lt;/span&gt;&lt;/a&gt;, on the same one-dimensional state and with its own overflow scalar.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.Thmlemma7" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S6.Thmlemma7.2" class="ltx_text ltx_font_bold"&gt;Lemma S.6.7&lt;/span&gt;&lt;/span&gt;&lt;span id="S6.Thmlemma7.3" class="ltx_text ltx_font_bold"&gt; (Min-plus evaluation).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S6.Thmlemma7.p1" class="ltx_para"&gt;
&lt;p id="S6.Thmlemma7.p1.1" class="ltx_p"&gt;&lt;span id="S6.Thmlemma7.p1.1.1" class="ltx_text ltx_font_italic"&gt;Fix an amplitude $v&amp;gt;0\text{,}$ a dyadic budget $2\leq k\leq K\text{,}$ and a constant $c\geq 0\text{.}$ The minimum&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex34" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$m_{v,k}\ :=\ \min_{x\in\mathcal{X}_{k}}\Bigl[\bigl\|Y-\tfrac{v}{k}\,x\bigr\|_{2}^{2}+c\,\Gamma(x)\Bigr]$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.Thmlemma7.p1.2" class="ltx_p"&gt;&lt;span id="S6.Thmlemma7.p1.2.1" class="ltx_text ltx_font_italic"&gt;and one minimizer are computable exactly in $O(nk^{2})$ operations.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S6.p38" class="ltx_para"&gt;
&lt;p id="S6.p38.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p39" class="ltx_para"&gt;
&lt;p id="S6.p39.1" class="ltx_p"&gt;Write $b:=v/k$ and $D:=3k\text{.}$ The class is nonempty: the state vector with $x_{o}=k$ and all other states zero belongs to $\mathcal{X}_{k}\text{,}$ its one leak sitting at the root. Losses and charges are vertex-additive, and the admissible completions on the subtrees of distinct children are independent given the state at their parent, so the minimum is computed by a postorder dynamic program over one state per vertex.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p40" class="ltx_para"&gt;
&lt;p id="S6.p40.1" class="ltx_p"&gt;As in &lt;a href="#S5.Thmlemma5" title="Lemma S.5.5 (Pruning and compression). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.5&lt;/span&gt;&lt;/a&gt;, every $x\in\mathcal{X}_{k}$ vanishes on a subtree disjoint from $A_{k}\text{,}$ so such a subtree contributes one state-independent constant, the sum of $Y_{w}^{2}$ over its vertices, to every candidate; and a maximal chain of vertices off $A_{k}$ with a single child subtree meeting $A_{k}$ carries one common state. Call the tree obtained by pruning the zero subtrees and contracting these chains the &lt;em id="S6.p40.1.1" class="ltx_emph ltx_font_italic"&gt;reduced tree&lt;/em&gt;. The cost of such a chain is the explicit quadratic $x\mapsto\sum_{u}(Y_{u}-bx)^{2}$ in the state $x$ at the reduced-tree vertex below it, generated in $O(k)$ operations from the chain’s length, sum, and sum of squares. Unlike its sum-product counterpart, the min-plus recursion retains these additive constants: the values $m_{v,k}$ of different candidates are later compared, so nothing may be dropped. The reduction partitions the vertices: each vertex $u$ of the reduced tree owns itself, the suppressed chain entering it, and the zero subtrees pruned at $u$ or along that chain. Write $\widehat{T}_{u}$ for the union of the blocks owned by $u$ and by its descendants in the reduced tree, so that $\widehat{T}_{o}=\mathsf{V}\text{,}$ and define at each such $u$ the table&lt;/p&gt;
&lt;table id="S6.Ex35" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$m_{u}(x)\ :=\ \min\Bigl\{\sum_{w\in\widehat{T}_{u}}(Y_{w}-bx^{\prime}_{w})^{2}+c\,\Gamma\bigl(z^{\prime}|_{\widehat{T}_{u}}\bigr)\Bigr\}\qquad(0\leq x\leq D),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p40.2" class="ltx_p"&gt;the minimum over the state vectors $x^{\prime}\in\{0,\dots,D\}^{\widehat{T}_{u}}$ with $x^{\prime}_{u}=x$ whose leaks $z^{\prime}$ vanish off $A_{k}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p41" class="ltx_para"&gt;
&lt;p id="S6.p41.1" class="ltx_p"&gt;&lt;em id="S6.p41.1.1" class="ltx_emph ltx_font_italic"&gt;Overflow.&lt;/em&gt; Child states are individually at most $D\text{,}$ but their sum is not. A partial min-plus product of child tables, with conceptual value $A(t)$ at child sum $t\geq 0\text{,}$ is carried as its truncation $A(0),\dots,A(D)$ together with the overflow scalar&lt;/p&gt;
&lt;table id="S6.Ex36" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tau_{A}\ :=\ \min_{t&amp;gt;D}\ \bigl\{A(t)+c\,(t-D)\bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p41.2" class="ltx_p"&gt;the minimum of an empty set being $+\infty\text{.}$ For the min-plus convolution of two partial products, $H(q)=\min_{i+j=q}\{A(i)+B(j)\}\text{,}$ the values $H(0),\dots,H(D)$ cost $O(D^{2})$ directly, and partitioning the pairs $(i,j)$ with $i+j&amp;gt;D$ according to whether each index exceeds $D$ gives the exact overflow&lt;/p&gt;
&lt;table id="S6.E8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tau_{H}\ =\ \min\Bigl\{\min_{\begin{subarray}{c}0\leq i,j\leq D\\ i+j&amp;gt;D\end{subarray}}\{A(i)+B(j)+c(i+j-D)\},\\ \tau_{A}+\min_{0\leq j\leq D}\{B(j)+cj\},\ \ \tau_{B}+\min_{0\leq i\leq D}\{A(i)+ci\},\ \ \tau_{A}+\tau_{B}+cD\Bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.6.8)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p41.3" class="ltx_p"&gt;since $A(i)+c(i-D)$ ranges over the overflowed side: for instance, $i&amp;gt;D$ and $j\leq D$ give $A(i)+B(j)+c(i+j-D)=[A(i)+c(i-D)]+[B(j)+cj]\text{,}$ minimized by the second block. Each merge therefore costs $O(D^{2})=O(k^{2})\text{,}$ and there are fewer than $n$ merges in the whole tree.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p42" class="ltx_para"&gt;
&lt;p id="S6.p42.1" class="ltx_p"&gt;&lt;em id="S6.p42.1.1" class="ltx_emph ltx_font_italic"&gt;The local step.&lt;/em&gt; Let $(Q(0),\dots,Q(D),\tau_{Q})$ be the assembled child-sum table at $u\text{,}$ an empty product having $Q(0)=0\text{,}$ $Q(t)=+\infty$ for $t\geq 1\text{,}$ and $\tau_{Q}=+\infty\text{,}$ and let $\chi_{u}(x)$ be the cost of the rest of $u$’s own block: the quadratic cost of the suppressed chain entering $u\text{,}$ all of whose vertices carry the state $x\text{,}$ plus the constants of the block’s pruned subtrees, zero if the block is the singleton $\{u\}\text{.}$ If $u\notin A_{k}\text{,}$ conservation forces the child sum to equal $x\leq D\text{,}$ the overflow is irrelevant, and $m_{u}(x)=(Y_{u}-bx)^{2}+\chi_{u}(x)+Q(x)\text{.}$ If $u\in A_{k}\text{,}$ splitting on $z_{u}=0$ against $z_{u}\neq 0$ gives&lt;/p&gt;
&lt;table id="S6.Ex37" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$m_{u}(x)\ =\ (Y_{u}-bx)^{2}+\chi_{u}(x)+\min\Bigl\{Q(x),\ \ c\,\widetilde{\omega}(u)+\min_{t\geq 0}\bigl[Q(t)+c\,|x-t|\bigr]\Bigr\};$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p42.2" class="ltx_p"&gt;including $t=x$ in the charged branch only adds the option $Q(x)+c\widetilde{\omega}(u)\text{,}$ dominated by the first branch, so the split is exact. The inner minimum is a one-dimensional distance transform, the min-plus mirror of the recurrences in &lt;a href="#S5.Thmlemma4" title="Lemma S.5.4 (Message recursion). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.4&lt;/span&gt;&lt;/a&gt;: with&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="S6.EGx9"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S6.Ex38"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S6.Ex39"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{gathered}
\displaystyle F(0):=Q(0),\qquad F(x):=\min\{Q(x),\,F(x-1)+c\}; \\
\displaystyle B(D):=\min\{Q(D),\,\tau_{Q}\},\qquad B(x):=\min\{Q(x),\,B(x+1)+c\},
\end{gathered}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p id="S6.p42.3" class="ltx_p"&gt;one has $F(x)=\min_{t\leq x}\{Q(t)+c(x-t)\}$ and $B(x)=\min_{t\geq x}\{Q(t)+c(t-x)\}\text{,}$ the seed at $D$ covering the overflowed sums because $\min_{t&amp;gt;D}\{Q(t)+c(t-x)\}=\tau_{Q}+c(D-x)$ for $x\leq D\text{;}$ hence $\min_{t\geq 0}\{Q(t)+c|x-t|\}=\min\{F(x),B(x)\}\text{,}$ at cost $O(k)$ for the two passes. At the root, $x_{o}=k$ is pinned and $\widetilde{\omega}(o)=0\text{,}$ so $m_{v,k}$ is the local step evaluated at $x=k\text{.}$ Storing, at every minimum, an attaining index, an attaining block of &lt;a href="#S6.E8" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.8&lt;/span&gt;&lt;/a&gt;, and an attaining overflow sum, and backtracking from the root, recovers a minimizer $x\in\mathcal{X}_{k}\text{.}$ The total is $O(k^{2})$ per merge and $O(k)$ per vertex, hence $O(nk^{2})$ operations.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p43" class="ltx_para"&gt;
&lt;p id="S6.p43.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Completion of the proof of Theorem&amp;nbsp;3, sufficiency.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p44" class="ltx_para"&gt;
&lt;p id="S6.p44.1" class="ltx_p"&gt;The estimator is the penalized selection of &lt;a href="#S6.Thmlemma1" title="Lemma S.6.1 (Weighted affine selection). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.1&lt;/span&gt;&lt;/a&gt; over the candidate system at working scale $s=\sigma\text{,}$ with penalties $C_{2}\sigma^{2}(D_{m}+\Delta_{m})$ and $C_{2}\sigma^{2}n\text{;}$ for $n&amp;lt;n_{\star}$ it returns $Y\text{,}$ a case already absorbed. Condition on $Y_{o}=y_{0}\text{:}$ the candidate system is deterministic, the data decompose as $Y=\widetilde{\theta}+(0,\sigma Z_{-o})$ with $\widetilde{\theta}=(y_{0},\mu_{-o})\text{,}$ the noise being centered Gaussian with independent coordinates of variances at most $\sigma^{2}\text{,}$ the root variance zero, and the penalties are deterministic, so &lt;a href="#S6.Thmlemma1" title="Lemma S.6.1 (Weighted affine selection). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.1&lt;/span&gt;&lt;/a&gt; applies conditionally with $E$ the whole space, $\bar{\kappa}=C_{2}\text{,}$ and $N=n\text{.}$ Since $\widetilde{\theta}-\mu=(Y_{o}-V)p_{o}\text{,}$ the pathwise root replacement&lt;/p&gt;
&lt;table id="S6.E9" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\|\widehat{\mu}-\mu\|_{2}^{2}\ \leq\ 2\,\|\widehat{\mu}-\widetilde{\theta}\|_{2}^{2}+2\,(Y_{o}-V)^{2},\qquad\mathbb{E}(Y_{o}-V)^{2}=\sigma^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.6.9)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p44.2" class="ltx_p"&gt;converts conditional bounds on $\|\widehat{\mu}-\widetilde{\theta}\|_{2}^{2}$ into risk bounds. Write $k_{a}:=k_{\mathrm{alg}}(T,V,\sigma)$ and $r:=\min\{V^{2}H_{T},\sigma^{2}k_{a}\}\text{;}$ by Theorem 1 and the sandwich $k_{a}\leq k_{0}\leq 2k_{a}$ of Lemma 2.3(3), $r\asymp R^{*}_{T}(V,\sigma)\text{.}$ The anchor event $\mathcal{E}_{+}$ is determined by $Y_{o}\text{.}$ Its complement contributes at most $C\sigma^{2}$ to the risk, by &lt;a href="#S6.Thmlemma5" title="Lemma S.6.5 (Anchor event). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.5&lt;/span&gt;&lt;/a&gt;(3); on $\mathcal{E}_{+}\text{,}$ taking conditional expectations in &lt;a href="#S6.E9" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.9&lt;/span&gt;&lt;/a&gt; and applying &lt;a href="#S6.Thmlemma1" title="Lemma S.6.1 (Weighted affine selection). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.1&lt;/span&gt;&lt;/a&gt; conditionally bounds the contribution by $C\,\mathbb{E}[\mathfrak{O}^{\prime}\,\mathbf{1}_{\mathcal{E}_{+}}]+C\sigma^{2}\text{,}$ where $\mathfrak{O}^{\prime}$ is the conditional oracle value of &lt;a href="#S6.Thmlemma1" title="Lemma S.6.1 (Weighted affine selection). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.1&lt;/span&gt;&lt;/a&gt;, the minimum over all candidates including the subspaces. It therefore suffices to prove&lt;/p&gt;
&lt;table id="S6.E10" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\bigl[\mathfrak{O}^{\prime}\,\mathbf{1}_{\mathcal{E}_{+}}\bigr]\ \leq\ C\,(r+\sigma^{2}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.6.10)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p44.3" class="ltx_p"&gt;There are three exhaustive regimes; in the first two the bound is pointwise.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p45" class="ltx_para"&gt;
&lt;p id="S6.p45.1" class="ltx_p"&gt;&lt;em id="S6.p45.1.1" class="ltx_emph ltx_font_italic"&gt;Diameter regime: $V^{2}H_{T}\leq\sigma^{2}k_{a}\text{.}$&lt;/em&gt; The model $\operatorname{span}(p_{o})$ contains $y_{0}p_{o}\text{,}$ and $\widetilde{\theta}-y_{0}p_{o}$ vanishes at the root and equals $\mu$ off it, so&lt;/p&gt;
&lt;table id="S6.Ex40" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\operatorname{dist}^{2}\bigl(\widetilde{\theta},\operatorname{span}(p_{o})\bigr)\ \leq\ \|\mu-Vp_{o}\|_{2}^{2}\ \leq\ V^{2}h_{T}\ \leq\ r,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p45.2" class="ltx_p"&gt;by convexity as in &lt;a href="#S5.Thmlemma2" title="Lemma S.5.2 (Elementary branches). ‣ S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.5.2&lt;/span&gt;&lt;/a&gt;. Dimension and weight are one each, so $\mathfrak{O}^{\prime}\leq r+3\sigma^{2}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p46" class="ltx_para"&gt;
&lt;p id="S6.p46.1" class="ltx_p"&gt;&lt;em id="S6.p46.1.1" class="ltx_emph ltx_font_italic"&gt;Entropy regime with small crossing: $\sigma^{2}k_{a}&amp;lt;V^{2}H_{T}$ and $k_{a}\leq k^{\star}/2\text{.}$&lt;/em&gt; Choose the smallest dyadic $k\geq\max\{k_{a},2\}\text{,}$ so that $k\leq\max\{2k_{a},2\}\leq k^{\star}$ and $k\leq 4k_{a}\text{.}$ Since $k_{a}\leq k^{\star}/2\leq K/2\text{,}$ the dimension clause of (2.2) is silent at $k_{a}\text{,}$ so its surrogate crossing clause fired there: $V^{2}\overline{\delta}_{k_{a}}\leq 2A_{0}\sigma^{2}k_{a}\text{.}$ &lt;a href="#S6.Thmlemma3" title="Lemma S.6.3 (Subspace approximation). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.3&lt;/span&gt;&lt;/a&gt; at budget $k$ and the monotonicity of $\overline{\delta}$ (Lemma 2.3(3)) give an admissible $S$ with&lt;/p&gt;
&lt;table id="S6.Ex41" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\operatorname{dist}^{2}\bigl(\mu,\ \mathcal{V}_{k,S}\bigr)\ \leq\ 22\,V^{2}\overline{\delta}_{k}\ \leq\ 22\,V^{2}\overline{\delta}_{k_{a}}\ \leq\ 44\,A_{0}\,\sigma^{2}k_{a}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p46.2" class="ltx_p"&gt;The root indicator $p_{o}$ lies in every profile subspace, $o$ being in $R_{0}\text{,}$ so translating an approximant of $\mu$ by $(y_{0}-V)p_{o}$ shows $\operatorname{dist}(\widetilde{\theta},\mathcal{V}_{k,S})\leq\operatorname{dist}(\mu,\mathcal{V}_{k,S})\text{.}$ With $\dim\mathcal{V}_{k,S}\leq|R_{0}|+|S|\leq(e+4)k$ and $\Delta_{k,S}=(C_{1}+1)k\text{,}$ the oracle value of this subspace is at most $44A_{0}\sigma^{2}k_{a}+C\sigma^{2}k\leq C\sigma^{2}k_{a}=Cr\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p47" class="ltx_para"&gt;
&lt;p id="S6.p47.1" class="ltx_p"&gt;&lt;em id="S6.p47.1.1" class="ltx_emph ltx_font_italic"&gt;Entropy regime with large crossing: $\sigma^{2}k_{a}&amp;lt;V^{2}H_{T}$ and $k_{a}&amp;gt;k^{\star}/2\text{.}$&lt;/em&gt; Suppose first $V\geq\sigma/2\text{.}$ On $\mathcal{E}_{+}\text{,}$ &lt;a href="#S6.Thmlemma5" title="Lemma S.6.5 (Anchor event). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.5&lt;/span&gt;&lt;/a&gt;(1) with $s=\sigma$ and $\sigma/V\leq 2$ gives, pointwise,&lt;/p&gt;
&lt;table id="S6.Ex42" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{v_{i^{*}}}{V}\ \leq\ 1+\frac{2\sigma}{V}+\frac{3\sigma|Z_{o}|}{V}\ \leq\ 5+6|Z_{o}|,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p47.2" class="ltx_p"&gt;so &lt;a href="#S6.Thmlemma2" title="Lemma S.6.2 (Scale calculus). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.2&lt;/span&gt;&lt;/a&gt;, at the factor $c=v_{i^{*}}/V\geq 1\text{,}$ gives $R^{*}_{T}(v_{i^{*}},\sigma)\leq(5+6|Z_{o}|)^{2}R^{*}_{T}(V,\sigma)$ pointwise, of expectation at most $CR^{*}_{T}(V,\sigma)\text{.}$ Since $\mathfrak{O}^{\prime}\leq\mathfrak{O}\text{,}$ the infimum running over more candidates, &lt;a href="#S6.E5" title="In Lemma S.6.6 (Grid coverage). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.5&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S6.Thmlemma5" title="Lemma S.6.5 (Anchor event). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.5&lt;/span&gt;&lt;/a&gt;(1) together prove &lt;a href="#S6.E10" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.10&lt;/span&gt;&lt;/a&gt; in this regime. Suppose now $V&amp;lt;\sigma/2\text{.}$ The regime inequality and $H_{T}&amp;lt;n$ give $\sigma^{2}k_{a}&amp;lt;V^{2}H_{T}\leq V^{2}n\text{,}$ so $\sigma/V&amp;lt;\sqrt{n/k_{a}}\leq\sqrt{n}$ and $j^{*}=\lfloor\log_{2}(\sigma/V)\rfloor$ satisfies $1\leq j^{*}\leq\tfrac{1}{2}\log_{2}n\leq J^{-}\text{.}$ The low-amplitude bound &lt;a href="#S6.E6" title="In Lemma S.6.6 (Grid coverage). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.6&lt;/span&gt;&lt;/a&gt; applies, and its three terms are handled in turn: $v^{-}_{j^{*}}\in[V,2V]$ and &lt;a href="#S6.Thmlemma2" title="Lemma S.6.2 (Scale calculus). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.2&lt;/span&gt;&lt;/a&gt; give $R^{*}_{T}(v^{-}_{j^{*}},\sigma)\leq 4R^{*}_{T}(V,\sigma)\text{;}$ the amplitude $v^{-}_{j^{*}}=2^{-j^{*}}\sigma$ is deterministic, so&lt;/p&gt;
&lt;table id="S6.Ex43" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\bigl(Y_{o}-v^{-}_{j^{*}}\bigr)^{2}\ \leq\ 2\sigma^{2}\,\mathbb{E}Z_{o}^{2}+2\bigl(V-v^{-}_{j^{*}}\bigr)^{2}\ \leq\ 2\sigma^{2}+2V^{2}\ \leq\ 3\sigma^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p47.3" class="ltx_p"&gt;using $|V-v^{-}_{j^{*}}|\leq V&amp;lt;\sigma/2\text{;}$ and, since $\log(1+t)\leq t$ and $k_{a}&amp;gt;k^{\star}/2\geq\log n/(8C_{1})$ for $n\geq n_{\star}\text{,}$&lt;/p&gt;
&lt;table id="S6.Ex44" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sigma^{2}\log(1+j^{*})\ \leq\ \sigma^{2}\,\frac{\log_{2}n}{2}\ \leq\ C\,\sigma^{2}k_{a}\ =\ C\,r.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p47.4" class="ltx_p"&gt;This proves &lt;a href="#S6.E10" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.10&lt;/span&gt;&lt;/a&gt; in every regime, hence the risk bound of Theorem 3.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p48" class="ltx_para"&gt;
&lt;p id="S6.p48.1" class="ltx_p"&gt;&lt;em id="S6.p48.1.1" class="ltx_emph ltx_font_italic"&gt;Running time.&lt;/em&gt; The dyadic budgets $k\leq k^{\star}$ carry $\sum_{k}e^{C_{1}k}\leq 2e^{C_{1}k^{\star}}\leq 2\sqrt{n}$ admissible supports in total, the terms of the sum growing at least geometrically; by &lt;a href="#S6.Thmlemma4" title="Lemma S.6.4 (Support enumeration). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.4&lt;/span&gt;&lt;/a&gt; they are listed in $O(n\sqrt{n})$ operations. One $O(n\log n)$ preprocessing pass stores every vertex’s $2^{j}$-th ancestor for $j\leq\lceil\log_{2}n\rceil$ and every root-path sum of $Y\text{;}$ lifting the deeper endpoint and then both endpoints finds the deepest common ancestor of any pair in $O(\log n)$ operations, and, by the ancestor count recorded with Lemma 2.2, $\langle p_{u},p_{w}\rangle=\operatorname{depth}(u\wedge w)+1\text{,}$ while $\langle Y,p_{u}\rangle$ is the stored root-path sum at $u\text{.}$ Forming and solving the normal equations of one subspace, of dimension $O(\log n)\text{,}$ therefore costs $O(\log^{3}n)$ operations after the preprocessing, and the subspace half costs $O(n^{3/2})$ in total, up to logarithmic factors. The grid half has $O(\log n)$ amplitudes, $O(\log n)$ budgets, and, for each pair, one run of &lt;a href="#S6.Thmlemma7" title="Lemma S.6.7 (Min-plus evaluation). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.7&lt;/span&gt;&lt;/a&gt; with $c=2C_{2}\sigma^{2}\text{:}$ the remaining weight $C_{2}\sigma^{2}(k+i+\log_{2}k+4)$ of a flow candidate is constant across $x\in\mathcal{X}_{k}\text{,}$ so the penalized criterion is minimized by the returned minimizer. With $k\leq n\text{,}$ the grid half costs $O(n^{3}\log^{2}n)$ operations, a conservative bound, and the final comparison across all candidates is dominated by it. All tie breaks are fixed, so the estimator is a deterministic function of $(T,\sigma,Y)\text{,}$ computable in polynomial time.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p49" class="ltx_para"&gt;
&lt;p id="S6.p49.1" class="ltx_p"&gt;It remains to remove the noise level; the difference statistics and their contamination bound come first. Write $\operatorname{hc}(u)$ for the size-heavy child of an internal vertex $u\text{,}$ fixed in Section 4.3, pair the children of each branching vertex by a fixed rule, one child left unpaired when their number is odd, and take&lt;/p&gt;
&lt;table id="S6.E11" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$X_{u}\ :=\ Y_{u}-Y_{\operatorname{hc}(u)}\ \ (u\ \text{internal}),\qquad X_{c,c^{\prime}}\ :=\ Y_{c}-Y_{c^{\prime}}\ \ (\{c,c^{\prime}\}\ \text{a pair of children}),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.6.11)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p49.2" class="ltx_p"&gt;at least $(n-1)/2$ statistics in all, each a Gaussian of variance $2\sigma^{2}$ around a signal difference. For every $\varepsilon&amp;gt;0\text{,}$ the contamination bound announced in the main body reads&lt;/p&gt;
&lt;table id="S6.E12" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\#\bigl\{u:\ \mathbb{E}X_{u}\geq\varepsilon\sigma\bigr\}\ +\ \#\bigl\{\{c,c^{\prime}\}:\ |\mathbb{E}X_{c,c^{\prime}}|\geq\varepsilon\sigma\bigr\}\ \leq\ \frac{V\,w_{T}}{\varepsilon\sigma}\ .$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.6.12)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S6.p50" class="ltx_para"&gt;
&lt;p id="S6.p50.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof of &lt;a class="ltx_ref" href="#S6.E12"&gt;(S.6.12)&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p51" class="ltx_para"&gt;
&lt;p id="S6.p51.1" class="ltx_p"&gt;Fix $\varepsilon&amp;gt;0\text{.}$ Both counts rest on the identity, valid for every vertex set $B$ by the subtree sums of Lemma 2.1,&lt;/p&gt;
&lt;table id="S6.E13" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{a\in B}\mu(a)\ =\ \sum_{a\in B}\ \sum_{u:\,u\succeq a}s_{u}\ =\ \sum_{u\in\mathsf{V}}s_{u}\,\#\{a\in B:\ a\preceq u\}\ ;$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.6.13)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p51.2" class="ltx_p"&gt;when every root path meets $B$ in at most $w$ vertices, the count on the right is at most $w\text{,}$ and the leaks total $V\text{,}$ so $\sum_{a\in B}\mu(a)\leq Vw\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p52" class="ltx_para"&gt;
&lt;p id="S6.p52.1" class="ltx_p"&gt;&lt;em id="S6.p52.1.1" class="ltx_emph ltx_font_italic"&gt;Heavy differences.&lt;/em&gt; Every internal vertex carries exactly one heavy edge, and every vertex is the size-heavy child of at most one vertex, its parent, so the heavy edges partition $\mathsf{V}$ into vertex-disjoint paths; the &lt;em id="S6.p52.1.2" class="ltx_emph ltx_font_italic"&gt;top&lt;/em&gt; of such a path is the root or the lower endpoint of a light edge. The flow form of Lemma 2.1 makes every mean $\mathbb{E}X_{u}=\mu(u)-\mu(\operatorname{hc}(u))$ nonnegative, and along one heavy path the means telescope to $\mu(\mathrm{top})-\mu(\mathrm{bottom})\leq\mu(\mathrm{top})\text{.}$ A root path contains at most $w_{\mathrm{lt}}$ tops, one for the root and one per light edge it crosses, so &lt;a href="#S6.E13" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.13&lt;/span&gt;&lt;/a&gt;, applied to the set of tops, gives&lt;/p&gt;
&lt;table id="S6.Ex45" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\varepsilon\sigma\,\#\bigl\{u:\ \mathbb{E}X_{u}\geq\varepsilon\sigma\bigr\}\ \leq\ \sum_{u\ \mathrm{internal}}\mathbb{E}X_{u}\ \leq\ \sum_{\mathrm{tops}\ a}\mu(a)\ \leq\ V\,w_{\mathrm{lt}}\ .$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S6.p53" class="ltx_para"&gt;
&lt;p id="S6.p53.1" class="ltx_p"&gt;&lt;em id="S6.p53.1.1" class="ltx_emph ltx_font_italic"&gt;Sibling pairs.&lt;/em&gt; The coordinates $\mu(c)$ of the children of a branching vertex $u$ are nonnegative, so a pair with $|\mathbb{E}X_{c,c^{\prime}}|=|\mu(c)-\mu(c^{\prime})|\geq\varepsilon\sigma$ contains a child whose coordinate is at least $\varepsilon\sigma\text{;}$ such children number at most $\mu(u)/(\varepsilon\sigma)\text{,}$ since $\sum_{c\in\operatorname{ch}(u)}\mu(c)\leq\mu(u)\text{,}$ and distinct pairs contain distinct children. Summing over the branching vertices, of which a root path contains at most $w_{\mathrm{br}}\text{,}$ and applying &lt;a href="#S6.E13" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.13&lt;/span&gt;&lt;/a&gt; to their set,&lt;/p&gt;
&lt;table id="S6.Ex46" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\#\bigl\{\{c,c^{\prime}\}:\ |\mathbb{E}X_{c,c^{\prime}}|\geq\varepsilon\sigma\bigr\}\ \leq\ \frac{1}{\varepsilon\sigma}\sum_{u\ \mathrm{branching}}\mu(u)\ \leq\ \frac{V\,w_{\mathrm{br}}}{\varepsilon\sigma}\ .$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p53.2" class="ltx_p"&gt;Adding the two displays gives &lt;a href="#S6.E12" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.12&lt;/span&gt;&lt;/a&gt;, the width being $w_{T}=w_{\mathrm{lt}}+w_{\mathrm{br}}\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p54" class="ltx_para"&gt;
&lt;p id="S6.p54.1" class="ltx_p"&gt;The statistic family &lt;a href="#S6.E11" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.11&lt;/span&gt;&lt;/a&gt; has at least $(n-1)/2$ members: an internal vertex with $g$ children contributes the difference along its heavy edge together with $\lfloor g/2\rfloor$ sibling pairs, $1+\lfloor g/2\rfloor\geq(g+1)/2\text{,}$ and the child counts of the internal vertices sum to $n-1\text{.}$ Each vertex $u$ enters at most three statistics: its own difference $X_{u}$ when internal, the difference $X_{\operatorname{pa}(u)}$ when it is the size-heavy child of its parent, and at most one pair. Scan the family in a fixed order and retain every statistic both of whose coordinates are unused by the statistics retained so far: a retained statistic blocks at most four others, two through each coordinate, so at least a fifth of the family is retained. This produces a deterministic subfamily, relabeled $X_{1},\dots,X_{N}\text{,}$ with $N\geq(n-1)/10$ and pairwise disjoint coordinate pairs; the $X_{i}$ are therefore independent, with $X_{i}-\mathbb{E}X_{i}\sim N(0,2\sigma^{2})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.Thmlemma8" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S6.Thmlemma8.2" class="ltx_text ltx_font_bold"&gt;Lemma S.6.8&lt;/span&gt;&lt;/span&gt;&lt;span id="S6.Thmlemma8.3" class="ltx_text ltx_font_bold"&gt; (Noise estimate).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S6.Thmlemma8.p1" class="ltx_para"&gt;
&lt;p id="S6.Thmlemma8.p1.1" class="ltx_p"&gt;&lt;span id="S6.Thmlemma8.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $n\geq 2\text{,}$ write $\operatorname{med}\{|X_{1}|,\dots,|X_{N}|\}$ for the $\lceil N/2\rceil$-th smallest of the absolute values, and set&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex47" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widehat{\sigma}\ :=\ \frac{\operatorname{med}\{|X_{1}|,\dots,|X_{N}|\}}{\sqrt{2}\,\Phi_{\mathcal{N}}^{-1}(3/4)},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.Thmlemma8.p1.2" class="ltx_p"&gt;&lt;span id="S6.Thmlemma8.p1.2.1" class="ltx_text ltx_font_italic"&gt;the denominator being the median of $|N(0,2)|\text{,}$ with $\Phi_{\mathcal{N}}$ the standard normal distribution function. If $V\,w_{T}\leq\sigma n/1280\text{,}$ then&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex48" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{P}\bigl(\widehat{\sigma}\in[\sigma/2,\ 2\sigma]\bigr)\ \geq\ 1-2e^{-c(n-1)}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.Thmlemma8.p1.3" class="ltx_p"&gt;&lt;span id="S6.Thmlemma8.p1.3.1" class="ltx_text ltx_font_italic"&gt;with a universal $c&amp;gt;0\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S6.p55" class="ltx_para"&gt;
&lt;p id="S6.p55.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p56" class="ltx_para"&gt;
&lt;p id="S6.p56.1" class="ltx_p"&gt;Call $X_{i}$ &lt;em id="S6.p56.1.1" class="ltx_emph ltx_font_italic"&gt;clean&lt;/em&gt; when $|\mathbb{E}X_{i}|\leq\sigma/8\text{.}$ The contamination count &lt;a href="#S6.E12" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.12&lt;/span&gt;&lt;/a&gt; at $\varepsilon=1/8\text{,}$ applied to the full family and hence to the subfamily, bounds the number of statistics that are not clean by $8Vw_{T}/\sigma\leq n/160\leq N/8\text{,}$ the last step because $N\geq(n-1)/10\geq n/20$ for $n\geq 2\text{.}$ A clean statistic satisfies, for every $t\geq 0\text{,}$&lt;/p&gt;
&lt;table id="S6.Ex49" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{P}\bigl(|X_{i}|\leq t\bigr)\ \leq\ \mathbb{P}\Bigl(|N(0,2)|\leq\frac{t}{\sigma}+\frac{1}{8}\Bigr),\qquad\mathbb{P}\bigl(|X_{i}|&amp;gt;t\bigr)\ \leq\ \mathbb{P}\Bigl(|N(0,2)|&amp;gt;\frac{t}{\sigma}-\frac{1}{8}\Bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p56.2" class="ltx_p"&gt;and two numerical evaluations of the standard normal distribution function give&lt;/p&gt;
&lt;table id="S6.Ex50" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{P}\bigl(|N(0,2)|\leq 0.625\bigr)\ &amp;lt;\ 0.35\ &amp;lt;\ \tfrac{3}{8},\qquad\mathbb{P}\bigl(|N(0,2)|&amp;gt;1.675\bigr)\ &amp;lt;\ 0.24\ &amp;lt;\ \tfrac{3}{8}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p56.3" class="ltx_p"&gt;If $\operatorname{med}|X|&amp;lt;\sigma/2\text{,}$ at least $\lceil N/2\rceil$ of the absolute values are below $\sigma/2\text{,}$ of which at least $N/2-N/8=3N/8$ belong to clean statistics, and each clean statistic falls below $\sigma/2$ with probability less than $0.35\text{.}$ If $\operatorname{med}|X|&amp;gt;9\sigma/5\text{,}$ at least $N-\lceil N/2\rceil+1\geq N/2$ of the absolute values exceed $9\sigma/5\text{,}$ at least $3N/8$ of them clean, each clean statistic exceeding $9\sigma/5$ with probability less than $0.24\text{.}$ In either case, a count of at most $N$ independent indicators, each of success probability at most a fixed $p&amp;lt;3/8\text{,}$ must reach $3N/8\text{.}$ For $\lambda&amp;gt;0\text{,}$ Markov’s inequality applied to the exponential of $\lambda$ times this count bounds the probability by $[e^{-3\lambda/8}(1-p+pe^{\lambda})]^{N}\text{,}$ each missing indicator only lowering the moment generating function below the factor $1-p+pe^{\lambda}&amp;gt;1\text{;}$ the bracket equals $1$ at $\lambda=0$ with derivative $p-\tfrac{3}{8}&amp;lt;0\text{,}$ so a fixed small $\lambda$ makes it $e^{-c}&amp;lt;1\text{,}$ and each probability is at most $e^{-cN}\leq e^{-c(n-1)/10}\text{;}$ renaming $c\text{,}$ the two events together have probability at most $2e^{-c(n-1)}\text{,}$ the claimed exceptional probability. On the complement of the two events, $\operatorname{med}|X|\in[\sigma/2,\,9\sigma/5]\text{;}$ since $\Phi_{\mathcal{N}}(0.6718)&amp;lt;\tfrac{3}{4}&amp;lt;\Phi_{\mathcal{N}}(0.6788)$ by a numerical evaluation, the denominator $\sqrt{2}\,\Phi_{\mathcal{N}}^{-1}(3/4)$ lies in $(0.95,\,0.96)\text{,}$ and&lt;/p&gt;
&lt;table id="S6.Ex51" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widehat{\sigma}\ \in\ \Bigl[\frac{\sigma/2}{0.96},\ \frac{9\sigma/5}{0.95}\Bigr]\ \subseteq\ [\sigma/2,\ 2\sigma].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S6.p57" class="ltx_para"&gt;
&lt;p id="S6.p57.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Completion of the proof of Theorem&amp;nbsp;4.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p58" class="ltx_para"&gt;
&lt;p id="S6.p58.1" class="ltx_p"&gt;For $n&amp;lt;n_{\star}$ return $Y\text{,}$ whose risk $n\sigma^{2}\leq n_{\star}\sigma^{2}$ is absorbed as before; assume $n\geq n_{\star}\text{.}$ The estimator computes $\widehat{\sigma}\text{;}$ on the null event $\{\widehat{\sigma}=0\}$ it returns $Y\text{,}$ and otherwise it rounds upward to $\widetilde{\sigma}:=2^{\lceil\log_{2}\widehat{\sigma}\rceil}$ and runs the selection of Theorem 3 at working scale $s=\widetilde{\sigma}\text{,}$ with the weight of every subspace and point model increased by two and the penalties built from these shifted weights at scale $\widetilde{\sigma}\text{.}$ The estimator depends only on $(T,Y)\text{,}$ and its running time adds $O(n\log n)$ for the statistics and the median to the polynomial cost already accounted. We prove the risk bound with $c=1/1280$ in the regime condition.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p59" class="ltx_para"&gt;
&lt;p id="S6.p59.1" class="ltx_p"&gt;Let $\widehat{E}:=\{\widehat{\sigma}\in[\sigma/2,2\sigma]\}\text{,}$ so that $\mathbb{P}(\widehat{E}^{c})\leq 2e^{-c(n-1)}$ by &lt;a href="#S6.Thmlemma8" title="Lemma S.6.8 (Noise estimate). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.8&lt;/span&gt;&lt;/a&gt; under the regime condition. On $\widehat{E}\text{,}$ the rounding gives $\widetilde{\sigma}\in[\sigma/2,4\sigma]\text{,}$ and $\widetilde{\sigma}$ is a power of two in that interval, hence takes at most four values determined by $\sigma\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p60" class="ltx_para"&gt;
&lt;p id="S6.p60.1" class="ltx_p"&gt;&lt;em id="S6.p60.1.1" class="ltx_emph ltx_font_italic"&gt;On $\widehat{E}\text{.}$&lt;/em&gt; Condition on $Y_{o}=y_{0}\text{.}$ The realized candidate-and-penalty system is one of the four deterministic systems indexed by the possible values of $\widetilde{\sigma}\text{;}$ the subspace candidates are common to all four, while the grids differ. The penalties satisfy the bracketing of &lt;a href="#S6.Thmlemma1" title="Lemma S.6.1 (Weighted affine selection). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.1&lt;/span&gt;&lt;/a&gt; with respect to the true $\sigma$ on $\widehat{E}\text{:}$ with shifted weights $\Delta_{m}+2\text{,}$ since $\widetilde{\sigma}^{2}\in[\sigma^{2}/4,16\sigma^{2}]$ and $C_{2}/4=32\text{,}$&lt;/p&gt;
&lt;table id="S6.Ex52" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$32\,\sigma^{2}(D_{m}+\Delta_{m}+2)\ \leq\ C_{2}\widetilde{\sigma}^{2}(D_{m}+\Delta_{m}+2)\ \leq\ 16C_{2}\,\sigma^{2}(D_{m}+\Delta_{m}+2),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p60.2" class="ltx_p"&gt;and likewise for the full model, so $E=\widehat{E}$ and $\bar{\kappa}=16C_{2}\text{.}$ The proof of &lt;a href="#S6.Thmlemma1" title="Lemma S.6.1 (Weighted affine selection). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.1&lt;/span&gt;&lt;/a&gt; is repeated with one change: the deviation variable is the supremum over the four systems, each paired with its own comparison model. The weight shift by two keeps the combined Kraft sum below one, since $4e^{-2}\bigl(0.53+\tfrac{1}{8}\bigr)&amp;lt;1$ by &lt;a href="#S6.E4" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.4&lt;/span&gt;&lt;/a&gt; and the subspace sum, so the expectation of the deviation variable is still at most one; the basic inequality is unchanged, the selected and the comparison model both lying in the realized subsystem. The conditional oracle bound of &lt;a href="#S6.Thmlemma1" title="Lemma S.6.1 (Weighted affine selection). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.1&lt;/span&gt;&lt;/a&gt; therefore holds on $\widehat{E}$ for the realized system.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p61" class="ltx_para"&gt;
&lt;p id="S6.p61.1" class="ltx_p"&gt;Coverage now runs as in the completion of Theorem 3, at the realized scale $s=\widetilde{\sigma}\in[\sigma/2,4\sigma]\text{,}$ with $k_{a}(s):=k_{\mathrm{alg}}(T,V,s)$ and $r_{s}:=\min\{V^{2}H_{T},s^{2}k_{a}(s)\}\text{;}$ by &lt;a href="#S6.E3" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.3&lt;/span&gt;&lt;/a&gt;, $r_{s}\leq CR^{*}_{T}(V,\sigma)$ uniformly over the four values, and the weight shift adds $2\sigma^{2}$ to every oracle value, absorbed by the additive term. In the diameter regime, the pointwise bound through $\operatorname{span}(p_{o})$ is unchanged. In the entropy regime with $k_{a}(s)\leq k^{\star}/2\text{,}$ the surrogate crossing at scale $s$ gives $V^{2}\overline{\delta}_{k_{a}(s)}\leq 2A_{0}s^{2}k_{a}(s)\text{,}$ and the subspace bound reads $22V^{2}\overline{\delta}_{k}\leq 44A_{0}s^{2}k_{a}(s)\leq Cr_{s}\text{.}$ In the entropy regime with $k_{a}(s)&amp;gt;k^{\star}/2\text{:}$ for $V\geq s/2\text{,}$ &lt;a href="#S6.Thmlemma5" title="Lemma S.6.5 (Anchor event). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.5&lt;/span&gt;&lt;/a&gt;(1) gives, pointwise,&lt;/p&gt;
&lt;table id="S6.Ex53" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{v_{i^{*}}}{V}\ \leq\ 1+\frac{2s}{V}+\frac{3\sigma|Z_{o}|}{V}\ \leq\ 5+12\,|Z_{o}|,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p61.2" class="ltx_p"&gt;using $s/V\leq 2$ and $\sigma\leq 2s\text{,}$ so &lt;a href="#S6.E5" title="In Lemma S.6.6 (Grid coverage). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.5&lt;/span&gt;&lt;/a&gt;, &lt;a href="#S6.Thmlemma2" title="Lemma S.6.2 (Scale calculus). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.2&lt;/span&gt;&lt;/a&gt;, and &lt;a href="#S6.Thmlemma5" title="Lemma S.6.5 (Anchor event). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.5&lt;/span&gt;&lt;/a&gt;(1) give the bound $C(R^{*}_{T}(V,\sigma)+\sigma^{2})$ in expectation as before. For $V&amp;lt;s/2\text{,}$ the index $j^{*}=\lfloor\log_{2}(s/V)\rfloor$ again lies in $\{1,\dots,J^{-}\}\text{,}$ since $s^{2}k_{a}(s)&amp;lt;V^{2}H_{T}\leq V^{2}n\text{;}$ the amplitude $v^{-}_{j^{*}}=2^{-j^{*}}\widetilde{\sigma}$ now depends on the data through $\widetilde{\sigma}\text{,}$ so no independence from $Z_{o}$ is available, and the root-coordinate term of &lt;a href="#S6.E6" title="In Lemma S.6.6 (Grid coverage). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.6&lt;/span&gt;&lt;/a&gt; is bounded pathwise on $\widehat{E}$ instead:&lt;/p&gt;
&lt;table id="S6.Ex54" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\bigl(Y_{o}-v^{-}_{j^{*}}\bigr)^{2}\ \leq\ 2\sigma^{2}Z_{o}^{2}+2\bigl(V-v^{-}_{j^{*}}\bigr)^{2}\ \leq\ 2\sigma^{2}Z_{o}^{2}+2V^{2}\ \leq\ 2\sigma^{2}Z_{o}^{2}+8\sigma^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p61.3" class="ltx_p"&gt;using $v^{-}_{j^{*}}\in[V,2V]$ and $V&amp;lt;s/2\leq 2\sigma\text{,}$ of expectation $O(\sigma^{2})\text{;}$ the weight term $\sigma^{2}\log(1+j^{*})\leq C\sigma^{2}k_{a}(s)=Cr_{s}$ as before. Finally, for every realized $s$ the omitted-anchor event is contained in $\{Z_{o}&amp;lt;-2(n+1)\}$ by &lt;a href="#S6.Thmlemma5" title="Lemma S.6.5 (Anchor event). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.5&lt;/span&gt;&lt;/a&gt;(2), and &lt;a href="#S6.Thmlemma5" title="Lemma S.6.5 (Anchor event). ‣ S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.5&lt;/span&gt;&lt;/a&gt;(3) with $s^{2}\leq 16\sigma^{2}$ bounds its loss contribution by $C\sigma^{2}\text{.}$ Splitting along the realized anchor event and applying the pathwise root replacement &lt;a href="#S6.E9" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.9&lt;/span&gt;&lt;/a&gt; on it, as in the completion of Theorem 3, gives $\mathbb{E}[\|\widehat{\mu}-\mu\|_{2}^{2}\,\mathbf{1}_{\widehat{E}}]\leq C(R^{*}_{T}(V,\sigma)+\sigma^{2})\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p62" class="ltx_para"&gt;
&lt;p id="S6.p62.1" class="ltx_p"&gt;&lt;em id="S6.p62.1.1" class="ltx_emph ltx_font_italic"&gt;Off $\widehat{E}\text{.}$&lt;/em&gt; On $\{\widehat{\sigma}=0\}$ the loss is $\sigma^{2}\|Z\|_{2}^{2}\text{.}$ On $\{\widehat{\sigma}&amp;gt;0\}\cap\widehat{E}^{c}\text{,}$ compare the selected criterion with $\operatorname{span}(p_{o})\text{,}$ of dimension one and shifted weight three:&lt;/p&gt;
&lt;table id="S6.Ex55" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\|Y-\widehat{\mu}\|_{2}^{2}\ \leq\ \bigl\|Y-P_{\operatorname{span}(p_{o})}Y\bigr\|_{2}^{2}+4C_{2}\widetilde{\sigma}^{2}\ \leq\ \|Y\|_{2}^{2}+4C_{2}\widetilde{\sigma}^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p62.2" class="ltx_p"&gt;so $\|\widehat{\mu}-\mu\|_{2}\leq\|\widehat{\mu}-Y\|_{2}+\|Y-\mu\|_{2}\leq 2\|Y\|_{2}+\|\mu\|_{2}+2\sqrt{C_{2}}\,\widetilde{\sigma}\text{.}$ Pathwise, $\widetilde{\sigma}\leq 2\widehat{\sigma}\leq 3\operatorname{med}|X|\leq 3\max_{i}|X_{i}|\leq 6\|Y\|_{\infty}\leq 6\|Y\|_{2}\text{,}$ each $X_{i}$ being a difference of two coordinates of $Y\text{,}$ so all losses off $\widehat{E}$ obey $\|\widehat{\mu}-\mu\|_{2}\leq C(\|Y\|_{2}+\|\mu\|_{2})\text{.}$ For the moments: $\mu(u)\leq V$ at every vertex and $\sum_{u}\mu(u)=\sum_{x}s_{x}(\operatorname{depth}(x)+1)\leq Vn$ by Lemma 2.1, so $\|\mu\|_{2}^{2}\leq V^{2}n\text{;}$ $\mathbb{E}\|Z\|_{2}^{4}\leq 3n^{2}$ gives $\mathbb{E}\|Y\|_{2}^{4}\leq 8(\|\mu\|_{2}^{4}+\sigma^{4}\mathbb{E}\|Z\|_{2}^{4})\leq 8(V^{4}n^{2}+3\sigma^{4}n^{2})\text{;}$ and the regime condition with $w_{T}\geq 1$ gives $V\leq\sigma n/1280\text{,}$ hence $V^{4}n^{2}\leq\sigma^{4}n^{6}\text{.}$ The squared loss therefore has second moment at most $C\sigma^{4}n^{6}$ off $\widehat{E}\text{,}$ and the Cauchy–Schwarz inequality gives&lt;/p&gt;
&lt;table id="S6.Ex56" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\bigl[\|\widehat{\mu}-\mu\|_{2}^{2}\,\mathbf{1}_{\widehat{E}^{c}}\bigr]\ \leq\ \bigl(C\sigma^{4}n^{6}\bigr)^{1/2}\bigl(2e^{-c(n-1)}\bigr)^{1/2}\ \leq\ C\sigma^{2}n^{3}e^{-c(n-1)/2}\ \leq\ C\sigma^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p62.3" class="ltx_p"&gt;Adding the two contributions proves Theorem 4.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p63" class="ltx_para"&gt;
&lt;p id="S6.p63.1" class="ltx_p"&gt;The width of the benchmark families is read off the definition in Section 4.3. A path has no light edge and no branching vertex, so $w_{T}=1\text{.}$ On the complete binary tree of height $h\text{,}$ every internal vertex has one light child edge, and a root-to-leaf path may cross a light edge and a branching vertex at each of its $h$ internal levels, so $w_{T}=(1+h)+h=2h+1\text{.}$ On a star with $m\geq 2$ leaves, and on the broom of Theorem 5, a root-to-leaf path crosses at most one light edge and one branching vertex, so $w_{T}\leq 3\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p64" class="ltx_para"&gt;
&lt;p id="S6.p64.1" class="ltx_p"&gt;The regime of Theorem 4 cannot be removed entirely by a better noise estimate. The following converse, promised at the end of Section 4.3, shows that once budgets of order $\sigma n\sqrt{\log n}$ are admitted, no estimator lands strictly within a factor $\sqrt{2}$ of the noise level, uniformly, on any tree.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.Thmlemma9" class="ltx_theorem ltx_theorem_prop"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S6.Thmlemma9.2" class="ltx_text ltx_font_bold"&gt;Proposition S.6.9&lt;/span&gt;&lt;/span&gt;&lt;span id="S6.Thmlemma9.3" class="ltx_text ltx_font_bold"&gt; (Noise-estimation ceiling).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S6.Thmlemma9.p1" class="ltx_para"&gt;
&lt;p id="S6.Thmlemma9.p1.1" class="ltx_p"&gt;&lt;span id="S6.Thmlemma9.p1.1.1" class="ltx_text ltx_font_italic"&gt;For every finite rooted tree and every $\sigma&amp;gt;0\text{,}$ put
$\lambda_{n}:=\log\bigl(4(n+1)\bigr)$ and
$V_{1}:=6\,\sigma n\sqrt{\lambda_{n}}\text{.}$ In the model $Y=\mu+sZ\text{,}$
$Z\sim N(0,I_{n})\text{,}$ where $\mu$ is a monotone flow of root value at
most $V_{1}\text{,}$ that is, $\mu\in\bigcup_{0\leq V^{\prime}\leq V_{1}}\mathcal{F}_{V^{\prime}}(T)$ with $\mathcal{F}_{0}(T):=\{0\}\text{,}$ and $s\in\{\sigma,2\sigma\}\text{,}$ every estimator
$\widehat{s}=\widehat{s}(Y)$ satisfies&lt;/span&gt;&lt;/p&gt;
&lt;table id="S6.Ex57" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sup_{(\mu,s)}\ \mathbb{P}_{\mu,s}\Bigl(\widehat{s}\notin\bigl(s/\sqrt{2},\ \sqrt{2}\,s\bigr)\Bigr)\ \geq\ \frac{3}{8},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.Thmlemma9.p1.2" class="ltx_p"&gt;&lt;span id="S6.Thmlemma9.p1.2.1" class="ltx_text ltx_font_italic"&gt;the supremum running over the admitted pairs. The same
bound holds for randomized estimators, by averaging over their
internal randomness.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S6.p65" class="ltx_para"&gt;
&lt;p id="S6.p65.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p66" class="ltx_para"&gt;
&lt;p id="S6.p66.1" class="ltx_p"&gt;The mechanism is a scale mixture: doubling the noise of a Gaussian shift is a random perturbation of its mean, and a signal whose flow inequalities all carry enough slack absorbs the perturbation without leaving the cone.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p67" class="ltx_para"&gt;
&lt;p id="S6.p67.1" class="ltx_p"&gt;&lt;em id="S6.p67.1.1" class="ltx_emph ltx_font_italic"&gt;Step 1: the mixture identity.&lt;/em&gt; In one coordinate, with $a:=3\sigma^{2}$ and $b:=\sigma^{2}\text{,}$ the exponent of the convolution integrand of $N(0,a)$ and $N(0,b)$ completes the square as&lt;/p&gt;
&lt;table id="S6.Ex58" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{w^{2}}{2a}+\frac{(y-w)^{2}}{2b}\ =\ \frac{a+b}{2ab}\Bigl(w-\frac{ay}{a+b}\Bigr)^{2}+\frac{y^{2}}{2(a+b)}\ ,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p67.2" class="ltx_p"&gt;and integrating out $w$ leaves a Gaussian integral at variance $ab/(a+b)\text{;}$ the normalizers combine into that of $N(0,a+b)\text{,}$ so the convolution is $N(0,4\sigma^{2})\text{.}$ Coordinates being independent, with $\gamma:=N(0,3\sigma^{2}I_{n})$ and any fixed $\mu_{0}\in\mathbb{R}^{n}\text{,}$&lt;/p&gt;
&lt;table id="S6.E14" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$N\bigl(\mu_{0},\,4\sigma^{2}I_{n}\bigr)\ =\ \int N\bigl(\mu_{0}+w,\ \sigma^{2}I_{n}\bigr)\,d\gamma(w):$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.6.14)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p67.3" class="ltx_p"&gt;the law of $Y$ at signal $\mu_{0}$ and noise $2\sigma$ is a $\gamma$-mixture of laws at noise $\sigma$ and shifted signals.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p68" class="ltx_para"&gt;
&lt;p id="S6.p68.1" class="ltx_p"&gt;&lt;em id="S6.p68.1.1" class="ltx_emph ltx_font_italic"&gt;Step 2: a signal with slack.&lt;/em&gt; Define $\mu_{0}$ through its leaks,&lt;/p&gt;
&lt;table id="S6.Ex59" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$s_{v}\ :=\ \sigma\sqrt{6\,(1+|\operatorname{ch}(v)|)\,\lambda_{n}}\qquad(v\in\mathsf{V}),\qquad V_{0}\ :=\ \sum_{v}s_{v},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p68.2" class="ltx_p"&gt;so that $\mu_{0}\in\mathcal{F}_{V_{0}}(T)$ by Lemma 2.1. The Cauchy–Schwarz inequality and $\sum_{v}(1+|\operatorname{ch}(v)|)=n+(n-1)\leq 2n$ give $V_{0}\leq\sigma\sqrt{6\lambda_{n}}\,\sqrt{n}\,\sqrt{2n}=\sigma n\sqrt{12\lambda_{n}}\leq V_{1}\text{,}$ so $\mu_{0}$ is admitted. Define the legality event&lt;/p&gt;
&lt;table id="S6.Ex60" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$A\ :=\ \Bigl\{w\in\mathbb{R}^{\mathsf{V}}:\ w_{v}-\textstyle\sum_{c\in\operatorname{ch}(v)}w_{c}\ \geq\ -s_{v}\ \text{ for all }v\in\mathsf{V}\Bigr\}\ \cap\ \bigl\{w_{o}\leq\sigma\sqrt{6\lambda_{n}}\bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p68.3" class="ltx_p"&gt;The leak map is linear, so on $A$ the leak of $\mu_{0}+w$ at $v$ is $s_{v}+(w_{v}-\sum_{c}w_{c})\geq 0\text{:}$ the shifted signal is a monotone flow, of root value&lt;/p&gt;
&lt;table id="S6.Ex61" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$V_{0}+w_{o}\ \leq\ \sigma n\sqrt{12\lambda_{n}}+\sigma\sqrt{6\lambda_{n}}\ \leq\ \bigl(\sqrt{12}+\sqrt{6}\bigr)\,\sigma n\sqrt{\lambda_{n}}\ \leq\ V_{1},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p68.4" class="ltx_p"&gt;hence admitted. Under $\gamma\text{,}$ the constraint at $v$ fails when a centered Gaussian of variance $3\sigma^{2}(1+|\operatorname{ch}(v)|)$ exceeds $s_{v}\text{,}$ and the root cap fails when a centered Gaussian of variance $3\sigma^{2}$ exceeds $\sigma\sqrt{6\lambda_{n}}\text{;}$ by the Gaussian tail bound each failure has probability at most $e^{-\lambda_{n}}\text{,}$ so&lt;/p&gt;
&lt;table id="S6.Ex62" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\gamma(A^{c})\ \leq\ (n+1)\,e^{-\lambda_{n}}\ =\ \frac{1}{4}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S6.p69" class="ltx_para"&gt;
&lt;p id="S6.p69.1" class="ltx_p"&gt;&lt;em id="S6.p69.1.1" class="ltx_emph ltx_font_italic"&gt;Step 3: two inseparable hypotheses.&lt;/em&gt; Let $P:=N(\mu_{0},4\sigma^{2}I_{n})\text{,}$ the law of $Y$ at the admitted pair $(\mu_{0},2\sigma)\text{,}$ and let&lt;/p&gt;
&lt;table id="S6.Ex63" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$Q_{A}\ :=\ \frac{1}{\gamma(A)}\int_{A}N\bigl(\mu_{0}+w,\ \sigma^{2}I_{n}\bigr)\,d\gamma(w),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p69.2" class="ltx_p"&gt;a mixture of laws at admitted pairs with noise level $\sigma\text{.}$ Splitting &lt;a href="#S6.E14" title="In S.6 Adaptation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.6.14&lt;/span&gt;&lt;/a&gt; over $A$ and $A^{c}$ gives $P=\gamma(A)Q_{A}+\gamma(A^{c})Q_{A^{c}}\text{,}$ so every event $B$ satisfies&lt;/p&gt;
&lt;table id="S6.Ex64" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\bigl|P(B)-Q_{A}(B)\bigr|\ =\ \gamma(A^{c})\,\bigl|Q_{A^{c}}(B)-Q_{A}(B)\bigr|\ \leq\ \frac{1}{4}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S6.p69.3" class="ltx_p"&gt;Given $\widehat{s}\text{,}$ let $B:=\{\widehat{s}&amp;lt;\sqrt{2}\,\sigma\}\text{.}$ Then $Q_{A}(B^{c})+P(B)=1-[Q_{A}(B)-P(B)]\geq\tfrac{3}{4}\text{,}$ so at least one term is at least $\tfrac{3}{8}\text{.}$ If $P(B)\geq\tfrac{3}{8}\text{:}$ at $(\mu_{0},2\sigma)$ the event $B$ reads $\{\widehat{s}&amp;lt;s/\sqrt{2}\}\text{,}$ outside the window. If $Q_{A}(B^{c})\geq\tfrac{3}{8}\text{:}$ a mixture average is at least $\tfrac{3}{8}\text{,}$ so some $w\in A$ has $\mathbb{P}_{\mu_{0}+w,\,\sigma}(B^{c})\geq\tfrac{3}{8}\text{,}$ and at $(\mu_{0}+w,\sigma)$ the event $B^{c}$ reads $\{\widehat{s}\geq\sqrt{2}\,s\}\text{,}$ outside the window. A randomized estimator is handled by averaging the display over its internal randomness.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p70" class="ltx_para"&gt;
&lt;p id="S6.p70.1" class="ltx_p"&gt;The statements deferred from Section 4.3 are now all in place.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S7" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="the-universal-upper-bound-for-least-squares"&gt;&lt;span class="ltx_tag ltx_tag_section"&gt;S.7 &lt;/span&gt;The Universal Upper Bound for Least Squares&lt;/h2&gt;
&lt;div id="S7.p1" class="ltx_para"&gt;
&lt;p id="S7.p1.1" class="ltx_p"&gt;This section proves the upper bound of Theorem 5, following the three blocks sketched in Section 5: the localized projection principle (&lt;a href="#S7.Thmlemma1" title="Lemma S.7.1 (Localized projection). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.1&lt;/span&gt;&lt;/a&gt;), the truth-localized width bound (5.10) (&lt;a href="#S7.Thmlemma4" title="Lemma S.7.4 (Truth-localized width). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.4&lt;/span&gt;&lt;/a&gt;), which rests on a noise-compatible choice of centers in the coded cover (&lt;a href="#S7.Thmlemma3" title="Lemma S.7.3 (Noise-compatible centers). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.3&lt;/span&gt;&lt;/a&gt;), and the closure of the exponent, for which &lt;a href="#S7.Thmlemma5" title="Lemma S.7.5 (Height floor). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.5&lt;/span&gt;&lt;/a&gt; supplies the height branch. The capped order-statistics bound of &lt;a href="#S7.Thmlemma2" title="Lemma S.7.2 (Capped order statistics). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.2&lt;/span&gt;&lt;/a&gt; does the repeated work inside &lt;a href="#S7.Thmlemma3" title="Lemma S.7.3 (Noise-compatible centers). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.3&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p2" class="ltx_para"&gt;
&lt;p id="S7.p2.1" class="ltx_p"&gt;Throughout, $Z\sim N(0,I_{n})$ is the noise, $\ell_{n}:=1+\log(en)\text{,}$ and, for an integer $2\leq k\leq n/C_{\star}\text{,}$ the construction of Proposition 3.1 is in force with the notation and of &lt;a href="#S2a" title="S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2&lt;/span&gt;&lt;/a&gt;: the working scale $\bar{\alpha}=k\overline{\delta}_{k}(T)\text{,}$ the nets $R_{j}$ with level weights $m_{j}=2^{j}$ and deepest-ancestor maps $a_{j}(\cdot)\text{,}$ and, for a signal $f\in\mathcal{F}_{1}(T)\text{,}$ the terminal cells $L$ with masses $\lambda_{L}$ and levels $m(L)\text{,}$ the collapse $g\text{,}$ the skeleton $g_{0}$ supported on $U\text{,}$ its rounding $\bar{g}_{0}\text{,}$ the exits $q_{L}\text{,}$ and the sampling variables $Z_{L}$ with selection weight $W\text{,}$ a notation fixed in the proof of Proposition 3.1; the unsubscripted $Z$ is always the noise. Root coordinates never contribute: every point of $\mathcal{F}_{V}(T)$ has root coordinate $V\text{,}$ so every difference below vanishes there. The Gaussian tail bound $\mathbb{P}(N(0,\tau^{2})\geq u)\leq e^{-u^{2}/(2\tau^{2})}\text{,}$ valid for $u\geq 0\text{,}$ and Gaussian concentration for Lipschitz functions &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib40" title="" class="ltx_ref"&gt;Borell, 1975&lt;/a&gt;; &lt;a href="#bib.bib41" title="" class="ltx_ref"&gt;Cirel’son et al., 1976&lt;/a&gt;)&lt;/cite&gt;, namely $\mathbb{P}\bigl(F(Z)\geq\mathbb{E}F(Z)+u\bigr)\leq e^{-u^{2}/(2\Lambda^{2})}$ for $\Lambda$-Lipschitz $F:\mathbb{R}^{n}\to\mathbb{R}\text{,}$ are used without further comment.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p3" class="ltx_para"&gt;
&lt;p id="S7.p3.1" class="ltx_p"&gt;The first lemma turns a bound on the localized Gaussian width into a risk bound for the projection. It is the fixed-point principle of Chatterjee’s analysis of least squares &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(&lt;a href="#bib.bib14" title="" class="ltx_ref"&gt;Chatterjee, 2014&lt;/a&gt;)&lt;/cite&gt;, in the form quoted in Section 5; nothing in it refers to trees.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.Thmlemma1" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S7.Thmlemma1.2" class="ltx_text ltx_font_bold"&gt;Lemma S.7.1&lt;/span&gt;&lt;/span&gt;&lt;span id="S7.Thmlemma1.3" class="ltx_text ltx_font_bold"&gt; (Localized projection).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S7.Thmlemma1.p1" class="ltx_para"&gt;
&lt;p id="S7.Thmlemma1.p1.1" class="ltx_p"&gt;&lt;span id="S7.Thmlemma1.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $C\subseteq\mathbb{R}^{N}$ be compact and convex, let $\mu\in C\text{,}$ let $Y=\mu+\sigma Z$ with $Z\sim N(0,I_{N})\text{,}$ and let $\widehat{\mu}:=\Pi_{C}(Y)$ be the Euclidean projection of $Y$ onto $C\text{.}$ Suppose that $t\geq\sigma$ and that for every $s\geq t$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S7.E1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sigma\,\mathbb{E}\,\sup\bigl\{\langle Z,x-\mu\rangle:\ x\in C,\ \|x-\mu\|_{2}\leq s\bigr\}\ \leq\ \frac{s^{2}}{4}\,.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.7.1)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.Thmlemma1.p1.2" class="ltx_p"&gt;&lt;span id="S7.Thmlemma1.p1.2.1" class="ltx_text ltx_font_italic"&gt;Then $\mathbb{E}\|\widehat{\mu}-\mu\|_{2}^{2}\leq 33\,t^{2}\text{.}$&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S7.p4" class="ltx_para"&gt;
&lt;p id="S7.p4.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p5" class="ltx_para"&gt;
&lt;p id="S7.p5.1" class="ltx_p"&gt;Write $\widehat{z}:=\widehat{\mu}-\mu$ and, for $s&amp;gt;0\text{,}$ let $X_{s}$ denote the supremum in &lt;a href="#S7.E1" title="In Lemma S.7.1 (Localized projection). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.1&lt;/span&gt;&lt;/a&gt;, so that the hypothesis reads $\mathbb{E}X_{s}\leq s^{2}/(4\sigma)$ for $s\geq t\text{.}$ The projection is the nearest point of $C$ and $\mu\in C\text{,}$ so $\|Y-\widehat{\mu}\|_{2}^{2}\leq\|Y-\mu\|_{2}^{2}\text{;}$ expanding both sides at $Y=\mu+\sigma Z$ and cancelling $\sigma^{2}\|Z\|_{2}^{2}$ gives&lt;/p&gt;
&lt;table id="S7.E2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\|\widehat{z}\|_{2}^{2}\ \leq\ 2\sigma\,\langle Z,\widehat{z}\rangle.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.7.2)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p5.2" class="ltx_p"&gt;Fix $s\geq t$ and suppose $\|\widehat{z}\|_{2}\geq s\text{.}$ The point $\mu+s\widehat{z}/\|\widehat{z}\|_{2}$ lies in $C$ by convexity, on the segment from $\mu$ to $\widehat{\mu}\text{,}$ and within distance $s$ of $\mu\text{,}$ so&lt;/p&gt;
&lt;table id="S7.Ex1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$X_{s}\ \geq\ \frac{s}{\|\widehat{z}\|_{2}}\,\langle Z,\widehat{z}\rangle\ \geq\ \frac{s\,\|\widehat{z}\|_{2}}{2\sigma}\ \geq\ \frac{s^{2}}{2\sigma}\,,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p5.3" class="ltx_p"&gt;the middle inequality by &lt;a href="#S7.E2" title="In S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.2&lt;/span&gt;&lt;/a&gt;. As a function of $Z$ the supremum $X_{s}$ is $s$-Lipschitz, being a maximum of linear functionals with gradients of norm at most $s\text{,}$ so concentration and $\mathbb{E}X_{s}\leq s^{2}/(4\sigma)$ give&lt;/p&gt;
&lt;table id="S7.Ex2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{P}\bigl(\|\widehat{z}\|_{2}\geq s\bigr)\ \leq\ \mathbb{P}\Bigl(X_{s}\geq\mathbb{E}X_{s}+\frac{s^{2}}{4\sigma}\Bigr)\ \leq\ \exp\Bigl(-\frac{(s^{2}/4\sigma)^{2}}{2s^{2}}\Bigr)\ =\ e^{-s^{2}/(32\sigma^{2})}\qquad(s\geq t).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p5.4" class="ltx_p"&gt;The layer-cake formula integrates the tail:&lt;/p&gt;
&lt;table id="S7.Ex3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\|\widehat{z}\|_{2}^{2}\ \leq\ t^{2}+\int_{t}^{\infty}2s\,e^{-s^{2}/(32\sigma^{2})}\,ds\ =\ t^{2}+32\sigma^{2}e^{-t^{2}/(32\sigma^{2})}\ \leq\ t^{2}+32\sigma^{2}\ \leq\ 33\,t^{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p5.5" class="ltx_p"&gt;the last step by $t\geq\sigma\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p6" class="ltx_para"&gt;
&lt;p id="S7.p6.1" class="ltx_p"&gt;For $C=\mathcal{F}_{V}(T)$ the expectation in &lt;a href="#S7.E1" title="In Lemma S.7.1 (Localized projection). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.1&lt;/span&gt;&lt;/a&gt; is the localized width $w_{\mu}(s)$ of Section 5, and the lemma is the principle stated there. Bounding $w_{\mu}$ requires expected maxima of many correlated Gaussian terms whose weights are capped individually and in total; the next lemma is the tool. For $a\in(0,1]$ and $y\in\mathbb{R}^{M}$ define&lt;/p&gt;
&lt;table id="S7.E3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathfrak{M}_{a}(y)\ :=\ \sup\Bigl\{\,\sum_{i=1}^{M}w_{i}y_{i}:\ 0\leq w_{i}\leq a\ \text{ for all }i,\ \ \sum_{i=1}^{M}w_{i}\leq 1\Bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.7.3)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p6.2" class="ltx_p"&gt;the largest weighted sum under a cap on each weight and on the total.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.Thmlemma2" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S7.Thmlemma2.2" class="ltx_text ltx_font_bold"&gt;Lemma S.7.2&lt;/span&gt;&lt;/span&gt;&lt;span id="S7.Thmlemma2.3" class="ltx_text ltx_font_bold"&gt; (Capped order statistics).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S7.Thmlemma2.p1" class="ltx_para"&gt;
&lt;p id="S7.Thmlemma2.p1.1" class="ltx_p"&gt;&lt;span id="S7.Thmlemma2.p1.1.1" class="ltx_text ltx_font_italic"&gt;Let $G_{1},\dots,G_{M}$ be jointly Gaussian, each centered with variance at most $\tau^{2}\text{,}$ not necessarily independent, and let $a\in(0,1]\text{.}$ Then&lt;/span&gt;&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="S7.EGx10"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S7.Ex4"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S7.Ex5"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{gathered}
\displaystyle\mathbb{E}\,\mathfrak{M}_{a}(G_{1},\dots,G_{M})\ \leq\ C\tau\sqrt{1+[\log(Ma)]_{+}}\,, \\
\displaystyle\mathbb{E}\,\mathfrak{M}_{a}\bigl(G_{1}^{2},\dots,G_{M}^{2}\bigr)\ \leq\ C\tau^{2}\bigl(1+[\log(Ma)]_{+}\bigr).
\end{gathered}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S7.p7" class="ltx_para"&gt;
&lt;p id="S7.p7.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p8" class="ltx_para"&gt;
&lt;p id="S7.p8.1" class="ltx_p"&gt;Write $G_{(1)}^{+}\geq G_{(2)}^{+}\geq\cdots$ for the decreasing rearrangement of the positive parts $[G_{i}]_{+}$ and $Q_{(1)}\geq Q_{(2)}\geq\cdots$ for that of the squares $G_{i}^{2}\text{,}$ and set $q:=\min\{\lceil 1/a\rceil,M\}\text{.}$&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p9" class="ltx_para"&gt;
&lt;p id="S7.p9.1" class="ltx_p"&gt;&lt;em id="S7.p9.1.1" class="ltx_emph ltx_font_italic"&gt;Reduction to order statistics.&lt;/em&gt; A feasible weight vector puts total weight at most $1\text{,}$ each entry at most $a\text{,}$ and gains nothing from coordinates where $G_{i}&amp;lt;0\text{;}$ moving weight from a smaller to a larger positive coordinate only increases the sum, so the supremum is attained by filling the largest positive coordinates to capacity $a\text{,}$ with at most one fractional entry. Since $aq\geq 1$ when $q=\lceil 1/a\rceil\text{,}$ while all $M$ coordinates are already covered when $q=M\text{,}$&lt;/p&gt;
&lt;table id="S7.E4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathfrak{M}_{a}(G)\ \leq\ a\sum_{j\leq q}G_{(j)}^{+},\qquad\mathfrak{M}_{a}(G_{1}^{2},\dots,G_{M}^{2})\ \leq\ a\sum_{j\leq q}Q_{(j)}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.7.4)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S7.p10" class="ltx_para"&gt;
&lt;p id="S7.p10.1" class="ltx_p"&gt;&lt;em id="S7.p10.1.1" class="ltx_emph ltx_font_italic"&gt;Tails of the order statistics.&lt;/em&gt; If $G_{(j)}^{+}\geq u$ for some $u&amp;gt;0\text{,}$ at least $j$ of the $G_{i}$ are at least $u\text{;}$ Markov’s inequality applied to the count, whose mean is at most $Me^{-u^{2}/(2\tau^{2})}$ by the Gaussian tail bound, gives&lt;/p&gt;
&lt;table id="S7.Ex6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{P}\bigl(G_{(j)}^{+}\geq u\bigr)\ \leq\ \min\Bigl\{1,\ \frac{M}{j}\,e^{-u^{2}/(2\tau^{2})}\Bigr\},\qquad\mathbb{P}\bigl(Q_{(j)}\geq u^{2}\bigr)\ \leq\ \min\Bigl\{1,\ \frac{2M}{j}\,e^{-u^{2}/(2\tau^{2})}\Bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p10.2" class="ltx_p"&gt;the second by the same argument applied to $|G_{i}|\text{.}$ Splitting the first tail at $u_{j}\text{,}$ where $u_{j}^{2}:=2\tau^{2}\log(eM/j)\text{,}$ gives&lt;/p&gt;
&lt;table id="S7.p10.3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$\mathbb{E}\,G_{(j)}^{+}\ \leq\ u_{j}+\frac{M}{j}\int_{u_{j}}^{\infty}e^{-u^{2}/(2\tau^{2})}\,du\\ \leq\ u_{j}+\frac{M}{j}\cdot\frac{\tau^{2}}{u_{j}}\,e^{-u_{j}^{2}/(2\tau^{2})}\ =\ u_{j}+\frac{\tau^{2}}{e\,u_{j}}\ \leq\ C\tau\sqrt{\log\frac{eM}{j}}\,,$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p10.4" class="ltx_p"&gt;where the integrand is at most $(u/u_{j})\,e^{-u^{2}/(2\tau^{2})}\text{.}$ Splitting the second tail at $2\tau^{2}\log(2eM/j)$ gives&lt;/p&gt;
&lt;table id="S7.Ex7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\,Q_{(j)}\ \leq\ 2\tau^{2}\log\frac{2eM}{j}+\frac{2\tau^{2}}{e}\ \leq\ C\tau^{2}\log\frac{eM}{j}\,.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S7.p11" class="ltx_para"&gt;
&lt;p id="S7.p11.1" class="ltx_p"&gt;&lt;em id="S7.p11.1.1" class="ltx_emph ltx_font_italic"&gt;Summation.&lt;/em&gt; Summing the first bound over $j\leq q$ and applying the Cauchy–Schwarz inequality to the average,&lt;/p&gt;
&lt;table id="S7.Ex8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$a\sum_{j\leq q}\mathbb{E}\,G_{(j)}^{+}\ \leq\ Ca\tau\,q\,\Bigl(\frac{1}{q}\sum_{j\leq q}\log\frac{eM}{j}\Bigr)^{1/2}\ \leq\ Ca\tau\,q\sqrt{2+\log(M/q)}\,,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p11.2" class="ltx_p"&gt;using $\sum_{j\leq q}\log(eM/j)=q\log(eM)-\log q!\leq q\bigl(2+\log(M/q)\bigr)\text{,}$ by $\log q!\geq q\log q-q\text{.}$ Now $aq\leq a\lceil 1/a\rceil\leq 1+a\leq 2\text{;}$ and either $q=\lceil 1/a\rceil\text{,}$ in which case $M/q\leq Ma\text{,}$ or $q=M\text{,}$ in which case $\log(M/q)=0\text{.}$ In both cases the right side is at most $C\tau\sqrt{1+[\log(Ma)]_{+}}\text{,}$ which with &lt;a href="#S7.E4" title="In S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.4&lt;/span&gt;&lt;/a&gt; proves the first claim. The second is identical with $\tau^{2}\log(eM/j)$ in place of $\tau\sqrt{\log(eM/j)}\text{,}$ without the Cauchy–Schwarz step.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p12" class="ltx_para"&gt;
&lt;p id="S7.p12.1" class="ltx_p"&gt;The heart of the matter is the next lemma: for each signal and noise realization, take the best accurate member of the coded cover; the resulting pairing with the noise, maximized over the body, is small in expectation. Its proof prices the three residuals of the construction separately, and only the last one, the sampled exits, needs the noise-dependent choice.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.Thmlemma3" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S7.Thmlemma3.2" class="ltx_text ltx_font_bold"&gt;Lemma S.7.3&lt;/span&gt;&lt;/span&gt;&lt;span id="S7.Thmlemma3.3" class="ltx_text ltx_font_bold"&gt; (Noise-compatible centers).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S7.Thmlemma3.p1" class="ltx_para"&gt;
&lt;p id="S7.Thmlemma3.p1.1" class="ltx_p"&gt;&lt;span id="S7.Thmlemma3.p1.1.1" class="ltx_text ltx_font_italic"&gt;Fix an integer $2\leq k\leq n/C_{\star}$ and let $\mathcal{D}_{k}$ be the coded cover at amplitude $V=1\text{.}$ For $f\in\mathcal{F}_{1}(T)$ and a noise realization $Z$ set&lt;/span&gt;&lt;/p&gt;
&lt;table id="S7.E5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathfrak{r}_{Z}(f)\ :=\ \inf\Bigl\{\langle Z,\ f-\nu\rangle:\ \nu\in\mathcal{D}_{k},\ \|f-\nu\|_{2}^{2}\leq 51\,\overline{\delta}_{k}(T)\Bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.7.5)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.Thmlemma3.p1.2" class="ltx_p"&gt;&lt;span id="S7.Thmlemma3.p1.2.1" class="ltx_text ltx_font_italic"&gt;The infimum runs over a nonempty set for every $f$ and every $Z\text{,}$ and&lt;/span&gt;&lt;/p&gt;
&lt;table id="S7.E6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\,\sup_{f\in\mathcal{F}_{1}(T)}\mathfrak{r}_{Z}(f)\ \leq\ C\Bigl[\sqrt{\bar{\alpha}}\,\log(2+\ell_{n})+\sqrt{\overline{\delta}_{k}(T)\,\ell_{n}}\,\Bigr].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.7.6)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S7.p13" class="ltx_para"&gt;
&lt;p id="S7.p13.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p14" class="ltx_para"&gt;
&lt;p id="S7.p14.1" class="ltx_p"&gt;Fix $f$ and run the proof of Proposition 3.1 on it, retaining its objects. Each realization of the sampling defines the candidate $\nu:=\bar{g}_{0}+\sum_{L}Z_{L}q_{L}\text{,}$ and the error decomposes as there:&lt;/p&gt;
&lt;table id="S7.E7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$f-\nu\ =\ (f-g)\ +\ (g_{0}-\bar{g}_{0})\ +\ \sum_{L}(\lambda_{L}-Z_{L})\,q_{L}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.7.7)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p14.2" class="ltx_p"&gt;On the sampling event of that proof, call it $A\text{,}$ of probability at least $\tfrac{1}{4}\text{,}$ where $W\leq 2k$ and $\|\sum_{L}(Z_{L}-\lambda_{L})q_{L}\|_{2}^{2}\leq 8\bar{\alpha}/k\text{,}$ the candidate lies in $\mathcal{D}_{k}\text{,}$ and the three residuals assemble, as in &lt;a href="#S2a" title="S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2&lt;/span&gt;&lt;/a&gt;, to $\|f-\nu\|_{2}^{2}\leq 3(3+6+8)\bar{\alpha}/k=51\,\overline{\delta}_{k}(T)\text{:}$ the feasible set of &lt;a href="#S7.E5" title="In Lemma S.7.3 (Noise-compatible centers). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.5&lt;/span&gt;&lt;/a&gt; is nonempty, for every $f$ and irrespective of $Z\text{.}$ Pairing &lt;a href="#S7.E7" title="In S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.7&lt;/span&gt;&lt;/a&gt; with the noise and taking on $A$ the realization that minimizes the third term,&lt;/p&gt;
&lt;table id="S7.E8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathfrak{r}_{Z}(f)\ \leq\ \langle Z,f-g\rangle+\langle Z,g_{0}-\bar{g}_{0}\rangle+\min_{A}\,\Bigl\langle Z,\sum_{L}(\lambda_{L}-Z_{L})q_{L}\Bigr\rangle.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.7.8)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p14.3" class="ltx_p"&gt;The three terms are bounded uniformly over $f$ in turn; the first carries the main contribution, the second is a union bound over few subspaces, and the third is where choosing the center after the noise pays.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p15" class="ltx_para"&gt;
&lt;p id="S7.p15.1" class="ltx_p"&gt;&lt;em id="S7.p15.1.1" class="ltx_emph ltx_font_italic"&gt;The collapse residual.&lt;/em&gt; Let $\tau(u)$ be the level of the terminal cell containing $u\text{,}$ so that $g=\sum_{u}\lambda_{u}\,p_{a_{\tau(u)}(u)}$ and the difference telescopes through the levels:&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="S7.EGx11"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S7.Ex9"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S7.Ex10"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{gathered}
\displaystyle f-g\ =\ \sum_{u}\lambda_{u}\bigl(p_{u}-p_{a_{\tau(u)}(u)}\bigr), \\
\displaystyle p_{u}-p_{a_{\tau(u)}(u)}\ =\ \sum_{j=\tau(u)}^{J-1}\bigl(p_{a_{j+1}(u)}-p_{a_{j}(u)}\bigr)+\bigl(p_{u}-p_{a_{J}(u)}\bigr).
\end{gathered}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p id="S7.p15.2" class="ltx_p"&gt;Fix a level $j&amp;lt;J$ and group the contributions by the level-$(j{+}1)$ root: by &lt;a href="#S2.Thmlemma2a" title="Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I3.i3a" title="Item 3 ‣ Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;), $a_{j}(u)=a_{j}(b)$ whenever $a_{j+1}(u)=b\text{,}$ so the level-$j$ increment of every $u$ in the group of $b$ is the same vector $p_{b}-p_{a_{j}(b)}\text{,}$ of squared norm at most $d_{T}(a_{j}(b),b)\leq\bar{\alpha}/m_{j}$ by &lt;a href="#S2.Thmlemma2a" title="Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I3.i4" title="Item 4 ‣ Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;). The group mass&lt;/p&gt;
&lt;table id="S7.Ex11" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\lambda_{b}\ :=\ \sum\bigl\{\lambda_{u}:\ a_{j+1}(u)=b,\ \tau(u)\leq j\bigr\}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p15.3" class="ltx_p"&gt;is capped: each member of the group lies in the level-$(j{+}1)$ cell of $b$ and in its own terminal cell, which is coarser and hence contains that whole cell; two terminal cells with a common vertex coincide, the terminal cells being a partition, so the group shares one terminal cell, stopped at a level at most $j&amp;lt;J$ and hence light, whence $\lambda_{b}\leq m_{j}/k$ by the monotonicity of the level weights. The group masses are nonnegative and total at most one, each $\lambda_{u}$ entering at most one group, so, with $M_{j}\leq\min\{n,\,|R_{j+1}|\}\leq\min\{n,\,2ke^{2m_{j}}\}$ possible groups (&lt;a href="#S2.Thmlemma1a" title="Lemma S.2.1 (Scale floor and net sizes). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.1&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I1.i3a" title="Item 3 ‣ Lemma S.2.1 (Scale floor and net sizes). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;)),&lt;/p&gt;
&lt;table id="S7.Ex12" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\,\sup_{f}\,\sum_{b}\lambda_{b}\,\langle Z,p_{b}-p_{a_{j}(b)}\rangle\leq\mathbb{E}\,\mathfrak{M}_{m_{j}/k}\Bigl(\bigl(\langle Z,p_{b}-p_{a_{j}(b)}\rangle\bigr)_{b}\Bigr)\leq C\sqrt{\bar{\alpha}}\,\min\bigl\{1,\sqrt{\ell_{n}/m_{j}}\bigr\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p15.4" class="ltx_p"&gt;by &lt;a href="#S7.Thmlemma2" title="Lemma S.7.2 (Capped order statistics). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.2&lt;/span&gt;&lt;/a&gt; with variance bound $\bar{\alpha}/m_{j}$ and cap $m_{j}/k\text{:}$ its logarithmic factor $1+[\log(M_{j}m_{j}/k)]_{+}$ is at most $\min\{5m_{j},\,\ell_{n}\}\text{,}$ being at most $1+\log 2+\log m_{j}+2m_{j}\leq 5m_{j}$ from $M_{j}m_{j}/k\leq 2m_{j}e^{2m_{j}}\text{,}$ and at most $1+\log n\leq\ell_{n}$ from $M_{j}m_{j}/k\leq n\text{.}$ Summing the dyadic levels: those with $m_{j}\leq\ell_{n}$ number at most $C\log(2+\ell_{n})$ and contribute $C\sqrt{\bar{\alpha}}$ each, while over the rest $\sqrt{\ell_{n}/m_{j}}$ is geometrically decaying from below one, and sums to a constant. The final increments $p_{u}-p_{a_{J}(u)}$ number at most $n$ and have squared norms at most $\bar{\alpha}/m_{J}\leq 2\overline{\delta}_{k}(T)\text{,}$ and their mass-weighted sum is a feasible value of $\mathfrak{M}_{1}\text{;}$ so &lt;a href="#S7.Thmlemma2" title="Lemma S.7.2 (Capped order statistics). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.2&lt;/span&gt;&lt;/a&gt; with cap $1$ and variance bound $2\overline{\delta}_{k}(T)$ bounds its expected supremum by $C\sqrt{\overline{\delta}_{k}(T)}\,\sqrt{1+\log n}\leq C\sqrt{\overline{\delta}_{k}(T)\,\ell_{n}}\text{.}$ Altogether&lt;/p&gt;
&lt;table id="S7.E9" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\,\sup_{f}\ \langle Z,\ f-g\rangle\ \leq\ C\Bigl[\sqrt{\bar{\alpha}}\,\log(2+\ell_{n})+\sqrt{\overline{\delta}_{k}(T)\,\ell_{n}}\,\Bigr].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.7.9)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S7.p16" class="ltx_para"&gt;
&lt;p id="S7.p16.1" class="ltx_p"&gt;&lt;em id="S7.p16.1.1" class="ltx_emph ltx_font_italic"&gt;The rounding residual.&lt;/em&gt; The difference $g_{0}-\bar{g}_{0}$ has squared norm at most $6\bar{\alpha}/k\text{,}$ by the constant recorded after &lt;a href="#S2.Thmlemma3a" title="Lemma S.2.3 (The heavy structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.3&lt;/span&gt;&lt;/a&gt;, and lies in the span of $\{p_{h}:h\in U\}\text{.}$ The set $U\setminus R_{0}$ consists of heavy roots, of total activation charge below $2k$ by &lt;a href="#S2.Thmlemma3a" title="Lemma S.2.3 (The heavy structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.3&lt;/span&gt;&lt;/a&gt;(3); it is therefore one of the charged parts counted in the proof of &lt;a href="#S2.Thmlemma5" title="Lemma S.2.5 (Counting bound). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.5&lt;/span&gt;&lt;/a&gt;, so at most $e^{19k}$ sets $U\text{,}$ hence at most $e^{19k}$ subspaces $V_{U}:=\operatorname{span}\{p_{h}:h\in U\}\text{,}$ occur as $f$ varies. Each has dimension $|U|\leq|R_{0}|+k\leq ek+k\leq 4k\text{,}$ since a heavy root outside $R_{0}$ carries charge at least $m_{1}=2\text{.}$ For any fixed $U\text{,}$&lt;/p&gt;
&lt;table id="S7.Ex13" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sup\bigl\{\langle Z,z\rangle:\ z\in V_{U},\ \|z\|_{2}^{2}\leq 6\bar{\alpha}/k\bigr\}\ =\ \sqrt{6\bar{\alpha}/k}\,\bigl\|P_{V_{U}}Z\bigr\|_{2},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p16.2" class="ltx_p"&gt;and $\|P_{V_{U}}Z\|_{2}$ is a $1$-Lipschitz function of $Z$ with mean at most $\sqrt{\dim V_{U}}\leq 2\sqrt{k}\text{.}$ Concentration and a union bound give, for $u\geq 0\text{,}$ $\mathbb{P}(\max_{U}\|P_{V_{U}}Z\|_{2}\geq 2\sqrt{k}+\sqrt{38k}+u)\leq e^{19k}e^{-(\sqrt{38k}+u)^{2}/2}\leq e^{-u^{2}/2}\text{,}$ so $\mathbb{E}\max_{U}\|P_{V_{U}}Z\|_{2}\leq 2\sqrt{k}+\sqrt{38k}+2\leq C\sqrt{k}$ and&lt;/p&gt;
&lt;table id="S7.E10" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\,\sup_{f}\ \langle Z,\ g_{0}-\bar{g}_{0}\rangle\ \leq\ \sqrt{6\bar{\alpha}/k}\cdot C\sqrt{k}\ =\ C\sqrt{\bar{\alpha}}\,.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.7.10)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S7.p17" class="ltx_para"&gt;
&lt;p id="S7.p17.1" class="ltx_p"&gt;&lt;em id="S7.p17.1.1" class="ltx_emph ltx_font_italic"&gt;The exit pairing.&lt;/em&gt; Condition on $Z$ and on $f\text{,}$ so that only the sampling is random, and write $X:=\langle Z,\sum_{L}(\lambda_{L}-Z_{L})q_{L}\rangle\text{.}$ The sampling variables are independent with $\mathbb{E}Z_{L}=\lambda_{L}$ and $\operatorname{Var}(Z_{L})\leq\lambda_{L}m(L)/k\text{,}$ so $X$ is centered with&lt;/p&gt;
&lt;table id="S7.Ex14" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\,X^{2}\ =\ \sum_{L}\operatorname{Var}(Z_{L})\,\langle Z,q_{L}\rangle^{2}\ \leq\ \sum_{L}\lambda_{L}\,\frac{m(L)}{k}\,\langle Z,q_{L}\rangle^{2}\ =:\ S_{f}(Z)^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p17.2" class="ltx_p"&gt;Centeredness and the Cauchy–Schwarz inequality give&lt;/p&gt;
&lt;table id="S7.Ex15" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\bigl[X\ \big|\ A\bigr]\ =\ -\frac{\mathbb{E}\bigl[X\,\mathbf{1}_{A^{c}}\bigr]}{\mathbb{P}(A)}\ \leq\ \frac{(\mathbb{E}X^{2})^{1/2}\,\mathbb{P}(A^{c})^{1/2}}{\mathbb{P}(A)}\ \leq\ 4\,S_{f}(Z),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p17.3" class="ltx_p"&gt;and some realization in $A$ is no larger than this conditional expectation. Hence the third term of &lt;a href="#S7.E8" title="In S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.8&lt;/span&gt;&lt;/a&gt; is at most $4S_{f}(Z)\text{,}$ and it remains to prove&lt;/p&gt;
&lt;table id="S7.E11" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\,\sup_{f}\ S_{f}(Z)^{2}\ \leq\ C\bar{\alpha},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.7.11)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p17.4" class="ltx_p"&gt;which gives $\mathbb{E}\sup_{f}S_{f}(Z)\leq\sqrt{\mathbb{E}\sup_{f}S_{f}(Z)^{2}}\leq C\sqrt{\bar{\alpha}}$ by Jensen’s inequality. An exit $q_{L}$ is determined by the root $a_{L}$ of its cell: its other endpoint is the root of the parent cell (&lt;a href="#S2.Thmlemma2a" title="Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.2.2&lt;/span&gt;&lt;/a&gt;(&lt;a href="#S2.I3.i3a" title="Item 3 ‣ Lemma S.2.2 (Cell structure). ‣ S.2 The Coded Cover ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;)), so at level $m$ the possible exits number at most $\min\{n,2ke^{m}\}\text{,}$ with $\|q_{L}\|_{2}^{2}\leq 2\bar{\alpha}/m$ by the parent cell’s radius. Split $S_{f}(Z)^{2}$ by levels. At a level $m\leq\ell_{n}\text{,}$ the weights $\lambda_{L}\leq m/k$ are again capped with total at most one, so &lt;a href="#S7.Thmlemma2" title="Lemma S.7.2 (Capped order statistics). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.2&lt;/span&gt;&lt;/a&gt;, applied to the squares with variance bound $2\bar{\alpha}/m$ and cap $m/k\text{,}$ bounds the expected supremum of the level’s sum by $C(2\bar{\alpha}/m)\bigl(1+[\log(2me^{m})]_{+}\bigr)\leq C\bar{\alpha}\text{,}$ since $1+\log(2me^{m})\leq 4m\text{;}$ with the prefactor $m/k$ the level contributes $C\bar{\alpha}\,m/k\text{,}$ and the dyadic sum over $m&amp;lt;k$ is at most $C\bar{\alpha}\text{.}$ At the levels $m&amp;gt;\ell_{n}\text{,}$ the prefactor obeys $m/k\leq 1$ and the weights total at most one, so the combined contribution is a feasible value of $\mathfrak{M}_{1}$ over the possible exits at these levels, at most $n(1+\log_{2}k)$ vectors of variance at most $2\bar{\alpha}/\ell_{n}\text{;}$ &lt;a href="#S7.Thmlemma2" title="Lemma S.7.2 (Capped order statistics). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.2&lt;/span&gt;&lt;/a&gt; with cap $1\text{,}$ applied to the squares, bounds its expectation by $C(\bar{\alpha}/\ell_{n})\bigl(1+\log(n(1+\log_{2}k))\bigr)\leq C\bar{\alpha}\text{,}$ since $1+\log\bigl(n(1+\log_{2}k)\bigr)\leq 2\ell_{n}\text{.}$ This proves &lt;a href="#S7.E11" title="In S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.11&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p18" class="ltx_para"&gt;
&lt;p id="S7.p18.1" class="ltx_p"&gt;Combining &lt;a href="#S7.E8" title="In S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.8&lt;/span&gt;&lt;/a&gt; with &lt;a href="#S7.E9" title="In S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equations&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.9&lt;/span&gt;&lt;/a&gt;, &lt;a href="#S7.E10" title="Equation S.7.10 ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;S.7.10&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S7.E11" title="Equation S.7.11 ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;S.7.11&lt;/span&gt;&lt;/a&gt;,&lt;/p&gt;
&lt;table id="S7.Ex16" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\,\sup_{f}\mathfrak{r}_{Z}(f)\ \leq\ C\Bigl[\sqrt{\bar{\alpha}}\,\log(2+\ell_{n})+\sqrt{\overline{\delta}_{k}(T)\,\ell_{n}}\,\Bigr]+C\sqrt{\bar{\alpha}}+4\,C\sqrt{\bar{\alpha}}\,,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p18.2" class="ltx_p"&gt;and $\sqrt{\bar{\alpha}}\leq\sqrt{\bar{\alpha}}\log(2+\ell_{n})$ absorbs the last two terms into the first.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p19" class="ltx_para"&gt;
&lt;p id="S7.p19.1" class="ltx_p"&gt;The width bound follows by recentering the local ball at a deterministic member of the cover.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.Thmlemma4" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S7.Thmlemma4.2" class="ltx_text ltx_font_bold"&gt;Lemma S.7.4&lt;/span&gt;&lt;/span&gt;&lt;span id="S7.Thmlemma4.3" class="ltx_text ltx_font_bold"&gt; (Truth-localized width).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S7.Thmlemma4.p1" class="ltx_para"&gt;
&lt;p id="S7.Thmlemma4.p1.1" class="ltx_p"&gt;&lt;span id="S7.Thmlemma4.p1.1.1" class="ltx_text ltx_font_italic"&gt;For every integer $2\leq k\leq n/C_{\star}\text{,}$ every $\mu\in\mathcal{F}_{V}(T)\text{,}$ and every $t&amp;gt;0\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S7.Ex17" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$w_{\mu}(t)\ \leq\ C\,\bigl(t+V\sqrt{\overline{\delta}_{k}(T)}\,\bigr)\sqrt{k}\ +\ C\,V\Bigl[\sqrt{k\overline{\delta}_{k}(T)}\,\log(2+\ell_{n})+\sqrt{\overline{\delta}_{k}(T)\,\ell_{n}}\,\Bigr],$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.Thmlemma4.p1.2" class="ltx_p"&gt;&lt;span id="S7.Thmlemma4.p1.2.1" class="ltx_text ltx_font_italic"&gt;with $w_{\mu}$ the localized Gaussian width defined in Section 5; this is the display (5.10) there.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S7.p20" class="ltx_para"&gt;
&lt;p id="S7.p20.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p21" class="ltx_para"&gt;
&lt;p id="S7.p21.1" class="ltx_p"&gt;Abbreviate $\overline{\delta}:=\overline{\delta}_{k}(T)\text{.}$ Amplitudes rescale: for $\theta\in\mathcal{F}_{V}(T)$ the normalized signal $\theta/V$ lies in $\mathcal{F}_{1}(T)\text{,}$ and multiplying a member of the unit-amplitude cover by $V$ gives a member of $\mathcal{D}_{k}$ at amplitude $V\text{.}$ The feasible set of &lt;a href="#S7.E5" title="In Lemma S.7.3 (Noise-compatible centers). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.5&lt;/span&gt;&lt;/a&gt; does not depend on $Z$ and is never empty, so fix $\nu_{\mu}\text{,}$ $V$ times one of its members at $\mu/V\text{:}$ then $\|\mu-\nu_{\mu}\|_{2}\leq V\sqrt{51\overline{\delta}}$ and $\nu_{\mu}$ is deterministic. For each $\theta$ with $\|\theta-\mu\|_{2}\leq t$ and each realization of $Z\text{,}$ let $\nu_{\theta}$ be $V$ times a minimizer of &lt;a href="#S7.E5" title="In Lemma S.7.3 (Noise-compatible centers). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.5&lt;/span&gt;&lt;/a&gt; at $\theta/V\text{,}$ so that $\|\theta-\nu_{\theta}\|_{2}\leq V\sqrt{51\overline{\delta}}$ and $\langle Z,\theta-\nu_{\theta}\rangle=V\,\mathfrak{r}_{Z}(\theta/V)\text{.}$ Decompose&lt;/p&gt;
&lt;table id="S7.Ex18" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\langle Z,\ \theta-\mu\rangle\ =\ \langle Z,\ \nu_{\theta}-\nu_{\mu}\rangle+\langle Z,\ \theta-\nu_{\theta}\rangle-\langle Z,\ \mu-\nu_{\mu}\rangle.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p21.2" class="ltx_p"&gt;The last term does not depend on $\theta$ and has expectation zero, $\nu_{\mu}$ being deterministic, so it drops from the expected supremum. The middle term is at most $V\sup_{f\in\mathcal{F}_{1}(T)}\mathfrak{r}_{Z}(f)\text{,}$ whose expectation &lt;a href="#S7.Thmlemma3" title="Lemma S.7.3 (Noise-compatible centers). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.3&lt;/span&gt;&lt;/a&gt; bounds by the second group of the claim. For the first term, the triangle inequality confines every center met to a deterministic ball:&lt;/p&gt;
&lt;table id="S7.Ex19" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\|\nu_{\theta}-\nu_{\mu}\|_{2}\ \leq\ \|\nu_{\theta}-\theta\|_{2}+\|\theta-\mu\|_{2}+\|\mu-\nu_{\mu}\|_{2}\ \leq\ t+2V\sqrt{51\overline{\delta}}\ =:\ \rho,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p21.3" class="ltx_p"&gt;so the first term is at most the maximum of $\langle Z,\nu-\nu_{\mu}\rangle$ over $\{\nu\in\mathcal{D}_{k}:\|\nu-\nu_{\mu}\|_{2}\leq\rho\}\text{,}$ a fixed set of at most $e^{C_{1}k}$ centered Gaussians of standard deviation at most $\rho\text{.}$ The maximum is a feasible value of $\mathfrak{M}_{1}\text{,}$ so &lt;a href="#S7.Thmlemma2" title="Lemma S.7.2 (Capped order statistics). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.2&lt;/span&gt;&lt;/a&gt; with cap $1$ bounds its expectation by $C\rho\sqrt{1+C_{1}k}\leq C(t+V\sqrt{\overline{\delta}}\,)\sqrt{k}\text{,}$ the first group of the claim.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p22" class="ltx_para"&gt;
&lt;p id="S7.p22.1" class="ltx_p"&gt;The second comparison branch of Section 5 rests on the profile remembering the height of the tree.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.Thmlemma5" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span id="S7.Thmlemma5.2" class="ltx_text ltx_font_bold"&gt;Lemma S.7.5&lt;/span&gt;&lt;/span&gt;&lt;span id="S7.Thmlemma5.3" class="ltx_text ltx_font_bold"&gt; (Height floor).&lt;/span&gt;&lt;/h6&gt;
&lt;div id="S7.Thmlemma5.p1" class="ltx_para"&gt;
&lt;p id="S7.Thmlemma5.p1.1" class="ltx_p"&gt;&lt;span id="S7.Thmlemma5.p1.1.1" class="ltx_text ltx_font_italic"&gt;For every finite rooted tree and every integer $1\leq k\leq n/C_{\star}\text{,}$&lt;/span&gt;&lt;/p&gt;
&lt;table id="S7.Ex20" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\delta_{k}(T)\ \geq\ \frac{\log 2}{8}\cdot\frac{H_{T}}{k^{2}}\,.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S7.p23" class="ltx_para"&gt;
&lt;p id="S7.p23.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Proof.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p24" class="ltx_para"&gt;
&lt;p id="S7.p24.1" class="ltx_p"&gt;Write $h:=h_{T}\text{,}$ so that $H_{T}\leq 2h\text{,}$ and fix a root-to-leaf path with $h$ edges; every ancestor of a vertex of the path lies on the path, so ancestor covering restricted to it is interval covering of its $h+1$ vertices, as on the path of &lt;a href="#S4.Thmlemma1a" title="Lemma S.4.1 (Path profile). ‣ S.4 Benchmark and Broom Profiles ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.4.1&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p25" class="ltx_para"&gt;
&lt;p id="S7.p25.1" class="ltx_p"&gt;If $h\geq 4k\text{,}$ set $q:=\lfloor h/(2k)\rfloor-1\geq 1\text{.}$ A center covers at most $q+1$ consecutive path vertices, so&lt;/p&gt;
&lt;table id="S7.Ex21" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$N^{\uparrow}_{T}(q)\ \geq\ \frac{h+1}{q+1}\ =\ \frac{h+1}{\lfloor h/(2k)\rfloor}\ \geq\ 2k,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p25.2" class="ltx_p"&gt;whence $[\log(N^{\uparrow}_{T}(q)/k)]_{+}\geq\log 2$ and the term of the discrete formula (2.3) at $q$ is at least $(q+1)\log 2\text{.}$ Since $q+1=\lfloor h/(2k)\rfloor&amp;gt;h/(2k)-1\geq h/(4k)\text{,}$&lt;/p&gt;
&lt;table id="S7.Ex22" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\delta_{k}\ \geq\ \frac{(q+1)\log 2}{k}\ \geq\ \frac{h\log 2}{4k^{2}}\ \geq\ \frac{H_{T}\log 2}{8k^{2}}\,.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S7.p26" class="ltx_para"&gt;
&lt;p id="S7.p26.1" class="ltx_p"&gt;If $h&amp;lt;4k\text{,}$ the term of (2.3) at $q=0$ is $\min\{k,[\log(n/k)]_{+}\}\geq\min\{k,2\}\geq 1\text{,}$ since $n/k\geq C_{\star}=e^{2}\text{;}$ hence $\delta_{k}\geq 1/k&amp;gt;H_{T}\log 2/(8k^{2})\text{,}$ using $H_{T}\leq 2h&amp;lt;8k$ and $\log 2&amp;lt;1\text{.}$
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p27" class="ltx_para"&gt;
&lt;p id="S7.p27.1" class="ltx_p"&gt;The blocks are in place, and it remains to assemble them along the case analysis of Section 5.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p28" class="ltx_para"&gt;
&lt;p id="S7.p28.1" class="ltx_p"&gt;&lt;em class="ltx_title_proof"&gt;Completion of Theorem&amp;nbsp;5, upper bound.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p29" class="ltx_para"&gt;
&lt;p id="S7.p29.1" class="ltx_p"&gt;The skeleton, the meeting of the two branches at $k_{0}=\ell_{n}^{1/5}\text{,}$ and the resulting bound $C(1+\log(en))^{2/5}$ are in Section 5; deferred here are the fixed-point verification behind (5.11), the height branch (5.12), and the endpoint cases.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p30" class="ltx_para"&gt;
&lt;p id="S7.p30.1" class="ltx_p"&gt;&lt;em id="S7.p30.1.1" class="ltx_emph ltx_font_italic"&gt;The interior case: the width branch &lt;span id="S7.p30.1.1.1" class="ltx_text ltx_font_upright"&gt;(5.11)&lt;/span&gt;.&lt;/em&gt; Let $2\leq k_{0}\leq K:=\lfloor n/C_{\star}\rfloor\text{,}$ so that the crossing clause fired at $k_{0}\text{:}$ $V^{2}\delta_{k_{0}}\leq A_{0}\sigma^{2}k_{0}\text{,}$ and $R^{*}_{T}\asymp\sigma^{2}k_{0}$ by the interior case of Section 3.3. Lemma 2.3 gives $\overline{\delta}_{k_{0}}\leq 2\delta_{k_{0}}\text{,}$ so&lt;/p&gt;
&lt;table id="S7.Ex23" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$V\sqrt{\overline{\delta}_{k_{0}}}\ \leq\ \sqrt{2A_{0}}\,\sigma\sqrt{k_{0}}\,,\qquad V\sqrt{k_{0}\overline{\delta}_{k_{0}}}\ \leq\ \sqrt{2A_{0}}\,\sigma\,k_{0}\,,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p30.2" class="ltx_p"&gt;and &lt;a href="#S7.Thmlemma4" title="Lemma S.7.4 (Truth-localized width). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.4&lt;/span&gt;&lt;/a&gt; at $k=k_{0}$ yields, for every $s&amp;gt;0\text{,}$&lt;/p&gt;
&lt;table id="S7.Ex24" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$w_{\mu}(s)\ \leq\ Cs\sqrt{k_{0}}\ +\ C\sigma B,\qquad B\ :=\ k_{0}\log(2+\ell_{n})+\sqrt{k_{0}\,\ell_{n}}\,,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p30.3" class="ltx_p"&gt;with one universal constant $C\text{,}$ uniformly over $\mu\in\mathcal{F}_{V}(T)\text{:}$ the term $CV\sqrt{\overline{\delta}_{k_{0}}}\,\sqrt{k_{0}}\leq C^{\prime}\sigma k_{0}$ from the first group, and both terms of the second group after the two displayed substitutions, are absorbed into $C\sigma B\text{,}$ since $k_{0}\leq B/\log 2\text{.}$ Set $t^{2}:=C_{\mathrm{loc}}\sigma^{2}B$ with $C_{\mathrm{loc}}:=64C^{2}/\log 2+8C+1\text{.}$ Then $t\geq\sigma\text{,}$ since $B\geq k_{0}\log 2\geq 2\log 2&amp;gt;1\text{;}$ and for every $s\geq t\text{,}$&lt;/p&gt;
&lt;table id="S7.Ex25" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sigma\,w_{\mu}(s)\ \leq\ C\sigma s\sqrt{k_{0}}+C\sigma^{2}B\ \leq\ \frac{s^{2}}{8}+\frac{s^{2}}{8}\ =\ \frac{s^{2}}{4}\,,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p30.4" class="ltx_p"&gt;the first term because $s\geq t\geq\sqrt{C_{\mathrm{loc}}k_{0}\log 2}\,\sigma\geq 8C\sigma\sqrt{k_{0}}\text{,}$ and the second because $C\sigma^{2}B=Ct^{2}/C_{\mathrm{loc}}\leq t^{2}/8\leq s^{2}/8\text{.}$ &lt;a href="#S7.Thmlemma1" title="Lemma S.7.1 (Localized projection). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.1&lt;/span&gt;&lt;/a&gt; applies at every $\mu$ and gives&lt;/p&gt;
&lt;table id="S7.Ex26" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{\mathrm{worst}}_{\mathrm{LSE}}(T,V,\sigma)\ \leq\ 33\,t^{2}\ =\ 33\,C_{\mathrm{loc}}\,\sigma^{2}\bigl[k_{0}\log(2+\ell_{n})+\sqrt{k_{0}\,\ell_{n}}\,\bigr];$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p30.5" class="ltx_p"&gt;dividing by $R^{*}_{T}\asymp\sigma^{2}k_{0}$ proves (5.11).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p31" class="ltx_para"&gt;
&lt;p id="S7.p31.1" class="ltx_p"&gt;&lt;em id="S7.p31.1.1" class="ltx_emph ltx_font_italic"&gt;The interior case: the height branch &lt;span id="S7.p31.1.1.1" class="ltx_text ltx_font_upright"&gt;(5.12)&lt;/span&gt;.&lt;/em&gt; Still for $2\leq k_{0}\leq K\text{,}$ &lt;a href="#S7.Thmlemma5" title="Lemma S.7.5 (Height floor). ‣ S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.5&lt;/span&gt;&lt;/a&gt; applies at $k_{0}$ and combines with the crossing:&lt;/p&gt;
&lt;table id="S7.Ex27" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{\log 2}{8}\cdot\frac{V^{2}H_{T}}{k_{0}^{2}}\ \leq\ V^{2}\delta_{k_{0}}\ \leq\ A_{0}\sigma^{2}k_{0},\qquad\text{so}\qquad V^{2}H_{T}\ \leq\ \frac{8A_{0}}{\log 2}\,\sigma^{2}k_{0}^{3}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p31.2" class="ltx_p"&gt;Both $\mu$ and its projection lie in the body, so $\|\widehat{\mu}_{\mathrm{LSE}}-\mu\|_{2}^{2}\leq\operatorname{diam}^{2}\mathcal{F}_{V}(T)=V^{2}H_{T}$ pathwise, and dividing by $R^{*}_{T}\asymp\sigma^{2}k_{0}$ proves (5.12).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p32" class="ltx_para"&gt;
&lt;p id="S7.p32.1" class="ltx_p"&gt;&lt;em id="S7.p32.1.1" class="ltx_emph ltx_font_italic"&gt;The endpoints.&lt;/em&gt; The projection onto a convex set is a contraction, so $\|\widehat{\mu}_{\mathrm{LSE}}-\mu\|_{2}=\|\Pi_{\mathcal{F}_{V}(T)}(Y)-\Pi_{\mathcal{F}_{V}(T)}(\mu)\|_{2}\leq\|Y-\mu\|_{2}$ and $R^{\mathrm{worst}}_{\mathrm{LSE}}\leq\sigma^{2}n$ always; together with the diameter,&lt;/p&gt;
&lt;table id="S7.E12" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$R^{\mathrm{worst}}_{\mathrm{LSE}}(T,V,\sigma)\ \leq\ \min\bigl\{V^{2}H_{T},\ \sigma^{2}n\bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(S.7.12)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p id="S7.p32.2" class="ltx_p"&gt;If $k_{0}=K+1$ with $n\geq C_{\star}\text{,}$ the dimension case of Section 3.3 gives $R^{*}_{T}\asymp\sigma^{2}n\text{,}$ and &lt;a href="#S7.E12" title="In S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.12&lt;/span&gt;&lt;/a&gt; bounds the ratio by a constant. If $k_{0}=1\text{,}$ the two-point bound (3.8) gives $R^{*}_{T}\geq c\min\{V^{2}H_{T},\sigma^{2}\}$ for $n\geq 2\text{,}$ and there are two subcases. When $n&amp;lt;C_{\star}\text{,}$ the right side of &lt;a href="#S7.E12" title="In S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.12&lt;/span&gt;&lt;/a&gt; is at most $C_{\star}\min\{V^{2}H_{T},\sigma^{2}\}\text{:}$ its second branch is $\sigma^{2}n\leq C_{\star}\sigma^{2}\text{,}$ and its first is unchanged. When the crossing clause fired at $k=1\text{,}$ the second case of Section 3.3 gives $V^{2}H_{T}\leq 2V^{2}h_{T}\leq(2A_{0}/\log 2)\,\sigma^{2}\text{,}$ so the right side of &lt;a href="#S7.E12" title="In S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Equation&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;S.7.12&lt;/span&gt;&lt;/a&gt; is again at most $C\min\{V^{2}H_{T},\sigma^{2}\}\text{:}$ if $V^{2}H_{T}\leq\sigma^{2}$ it equals the first branch, and otherwise it is at most $C\sigma^{2}\text{.}$ In both subcases $R^{\mathrm{worst}}_{\mathrm{LSE}}\leq C\,R^{*}_{T}\text{.}$ The three cases are exhaustive: $k_{0}=K+1$ with $n&amp;lt;C_{\star}$ means $K=0$ and $k_{0}=1\text{,}$ which the last case covers. Together with the two interior branches and the case analysis of Section 5, the upper bound of Theorem 5 is proved; with the lower bound established there, so is the theorem.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;div class="ltx_pagination ltx_role_newpage"&gt;&lt;/div&gt;
&lt;/section&gt;
&lt;section id="bib" class="ltx_bibliography"&gt;
&lt;h2 class="ltx_title ltx_title_bibliography" id="references"&gt;References&lt;/h2&gt;
&lt;ul id="bib.L1" class="ltx_biblist"&gt;
&lt;li id="bib.bib8" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Abowd &lt;span class="ltx_text ltx_bib_etal"&gt;et al.&lt;/span&gt; (2022)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;J. M. Abowd, R. Ashmead, R. Cumings-Menon, &lt;span class="ltx_text ltx_bib_etal"&gt;et al.&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;The 2020 Census disclosure avoidance system TopDown algorithm&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Harv. Data Sci. Rev.&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;Special Issue 2&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.p2.1" title="1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib31" class="ltx_bibitem ltx_bib_misc"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Aolaritei &lt;span class="ltx_text ltx_bib_etal"&gt;et al.&lt;/span&gt; (2025)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;L. Aolaritei, M. I. Jordan, R. Pathak, and A. Ulichney&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Revisiting mean estimation over $\ell_{p}$ balls: is the MLE optimal?&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;arXiv:2506.10354&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p3.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib32" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Barron and Cover (1991)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;A. R. Barron and T. M. Cover&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Minimum complexity density estimation&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;IEEE Trans. Inf. Theory&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;37&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;4&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 1034–1054&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p4.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib20" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Bellec (2018)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;P. C. Bellec&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Sharp oracle inequalities for least squares estimators in shape restricted regression&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Ann. Statist.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;46&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 745–780&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p1.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib10" class="ltx_bibitem ltx_bib_misc"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Benabbas &lt;span class="ltx_text ltx_bib_etal"&gt;et al.&lt;/span&gt; (2011)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;S. Benabbas, H. C. Lee, J. Oren, and Y. Ye&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Efficient sum-based hierarchical smoothing under $\ell_{1}$-norm&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;arXiv:1108.1751&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p1.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib6" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Birgé and Massart (2001)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;L. Birgé and P. Massart&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Gaussian model selection&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;J. Eur. Math. Soc.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;3&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;3&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 203–268&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS1.p5.1" title="1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p1.1" title="1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S3a.p37.1" title="S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§S.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S4.SS3.p5.1" title="4.3 Adaptation ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§4.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib40" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Borell (1975)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;C. Borell&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;The Brunn-Minkowski inequality in Gauss space&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Invent. Math.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;30&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 207–216&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S7.p2.1" title="S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§S.7&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib37" class="ltx_bibitem ltx_bib_book"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Boucheron &lt;span class="ltx_text ltx_bib_etal"&gt;et al.&lt;/span&gt; (2013)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;S. Boucheron, G. Lugosi, and P. Massart&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Concentration inequalities: a nonasymptotic theory of independence&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; &lt;span class="ltx_text ltx_bib_publisher"&gt;Oxford University Press&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S4.SS1.p6.1" title="4.1 Aggregation over Integer States ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§4.1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib4" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Chatterjee &lt;span class="ltx_text ltx_bib_etal"&gt;et al.&lt;/span&gt; (2015)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;S. Chatterjee, A. Guntuboyina, and B. Sen&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;On risk bounds in isotonic and other shape restricted regression problems&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Ann. Statist.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;43&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;4&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 1774–1800&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p1.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p1.1" title="1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib1" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Chatterjee and Lafferty (2018)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;S. Chatterjee and J. Lafferty&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Denoising flows on trees&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;IEEE Trans. Inf. Theory&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;64&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;3&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 1767–1783&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS1.p1.3" title="1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS1.p5.1" title="1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS1.p6.1" title="1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS1.p7.1" title="1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS2.p2.1" title="1.2 Technical Overview ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.2&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS2.p3.1" title="1.2 Technical Overview ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.2&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS3.p1.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p2.1" title="1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1a.p1.1" title="S.1 The Profile Toolkit ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§S.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1a.p26.1" title="S.1 The Profile Toolkit ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§S.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S2.SS1.p3.1" title="2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2.1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib14" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Chatterjee (2014)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;S. Chatterjee&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;A new perspective on least squares under convex constraint&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Ann. Statist.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;42&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;6&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 2340–2381&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS1.p8.1" title="1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS2.p7.1" title="1.2 Technical Overview ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.2&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS3.p3.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S5.p13.2" title="5 The Suboptimality of Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§5&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S7.p3.1" title="S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§S.7&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib41" class="ltx_bibitem ltx_bib_incollection"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Cirel’son &lt;span class="ltx_text ltx_bib_etal"&gt;et al.&lt;/span&gt; (1976)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;B. S. Cirel’son, I. A. Ibragimov, and V. N. Sudakov&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Norms of Gaussian sample functions&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Proceedings of the Third Japan-USSR Symposium on Probability Theory&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_series"&gt;Lecture Notes in Mathematics&lt;/span&gt;, Vol. &lt;span class="ltx_text ltx_bib_volume"&gt;550&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 20–41&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S7.p2.1" title="S.7 The Universal Upper Bound for Least Squares ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§S.7&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib26" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Dalalyan and Tsybakov (2008)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;A. S. Dalalyan and A. B. Tsybakov&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Aggregation by exponential weighting, sharp PAC-Bayesian bounds and sparsity&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Mach. Learn.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;72&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 39–61&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p4.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib30" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Darwiche (2003)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;A. Darwiche&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;A differential approach to inference in Bayesian networks&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;J. ACM&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;50&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;3&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 280–305&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p4.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib5" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Donoho and Johnstone (1994)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;D. L. Donoho and I. M. Johnstone&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Minimax risk over $\ell_{p}$-balls for $\ell_{q}$-error&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Probab. Theory Related Fields&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;99&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 277–303&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS1.p5.1" title="1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p1.1" title="1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib28" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Giraud (2008)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;C. Giraud&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Mixing least-squares estimators when the variance is unknown&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Bernoulli&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;14&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;4&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 1089–1107&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p4.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib9" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Graham &lt;span class="ltx_text ltx_bib_etal"&gt;et al.&lt;/span&gt; (1982)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;S. L. Graham, P. B. Kessler, and M. K. McKusick&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Gprof: a call graph execution profiler&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;SIGPLAN Not.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;17&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;6&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 120–126&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.p2.1" title="1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib24" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Guntuboyina and Sen (2018)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;A. Guntuboyina and B. Sen&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Nonparametric shape-restricted regression&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Statist. Sci.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;33&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;4&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 568–594&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p1.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib17" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Han &lt;span class="ltx_text ltx_bib_etal"&gt;et al.&lt;/span&gt; (2019)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;Q. Han, T. Wang, S. Chatterjee, and R. J. Samworth&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Isotonic regression in general dimensions&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Ann. Statist.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;47&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;5&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 2440–2471&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p1.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib7" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Hay &lt;span class="ltx_text ltx_bib_etal"&gt;et al.&lt;/span&gt; (2010)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. Hay, V. Rastogi, G. Miklau, and D. Suciu&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Boosting the accuracy of differentially private histograms through consistency&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Proc. VLDB Endow.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;3&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;1&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 1021–1032&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.p2.1" title="1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib15" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Kur &lt;span class="ltx_text ltx_bib_etal"&gt;et al.&lt;/span&gt; (2024)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;G. Kur, F. Gao, A. Guntuboyina, and B. Sen&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Convex regression in multidimensions: suboptimality of least squares estimators&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Ann. Statist.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;52&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;6&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 2791–2815&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS1.p8.1" title="1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS3.p3.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib18" class="ltx_bibitem ltx_bib_inproceedings"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Kyng &lt;span class="ltx_text ltx_bib_etal"&gt;et al.&lt;/span&gt; (2015)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;R. Kyng, A. Rao, and S. Sachdeva&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Fast, provable algorithms for isotonic regression in all $\ell_{p}$-norms&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Adv. Neural Inf. Process. Syst. 28&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt;pp. 2719–2727&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p4.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib25" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Leung and Barron (2006)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;G. Leung and A. R. Barron&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Information theory and mixing least-squares regressions&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;IEEE Trans. Inf. Theory&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;52&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;8&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 3396–3410&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p4.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S4.SS1.p4.1" title="4.1 Aggregation over Integer States ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§4.1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib21" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Lifshits and Linde (2011a)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. Lifshits and W. Linde&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Compactness properties of weighted summation operators on trees&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Studia Math.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;202&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;1&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 17–47&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p2.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib22" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Lifshits and Linde (2011b)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. Lifshits and W. Linde&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Compactness properties of weighted summation operators on trees—the critical case&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Studia Math.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;206&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;1&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 75–96&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p2.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib23" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Luss and Rosset (2017)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;R. Luss and S. Rosset&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Bounded isotonic regression&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Electron. J. Stat.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;11&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 4488–4514&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p1.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib38" class="ltx_bibitem ltx_bib_book"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Massart (2007)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;P. Massart&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Concentration inequalities and model selection&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_series"&gt;Lecture Notes in Mathematics&lt;/span&gt;, Vol. &lt;span class="ltx_text ltx_bib_volume"&gt;1896&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_publisher"&gt;Springer&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S3a.p37.1" title="S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§S.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib12" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Neykov (2023)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. Neykov&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;On the minimax rate of the Gaussian sequence model under bounded convex constraints&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;IEEE Trans. Inf. Theory&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;69&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 1244–1260&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS1.p4.1" title="1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS3.p2.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p3.1" title="1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib34" class="ltx_bibitem ltx_bib_misc"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Neykov (2026)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. Neykov&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Fast near-optimal estimation over symmetric norm balls&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;arXiv:2606.01554&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p4.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib13" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Prasadan and Neykov (2025)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;A. Prasadan and M. Neykov&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Some facts about the optimality of the LSE in the Gaussian sequence model with convex constraint&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;IEEE Trans. Inf. Theory&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;71&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;11&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 8928–8958&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p3.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib27" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Rigollet and Tsybakov (2011)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;P. Rigollet and A. B. Tsybakov&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Exponential screening and optimal rates of sparse estimation&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Ann. Statist.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;39&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 731–771&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p4.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib33" class="ltx_bibitem ltx_bib_book"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Robertson &lt;span class="ltx_text ltx_bib_etal"&gt;et al.&lt;/span&gt; (1988)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;T. Robertson, F. T. Wright, and R. L. Dykstra&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Order restricted statistical inference&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; &lt;span class="ltx_text ltx_bib_publisher"&gt;Wiley&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p4.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib35" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Stein (1981)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;C. M. Stein&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Estimation of the mean of a multivariate normal distribution&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Ann. Statist.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;9&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;6&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 1135–1151&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S4.SS1.p6.1" title="4.1 Aggregation over Integer States ‣ 4 Efficient and Adaptive Estimation ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§4.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S5a.p8.1" title="S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§S.5&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib36" class="ltx_bibitem ltx_bib_book"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Tsybakov (2009)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;A. B. Tsybakov&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Introduction to nonparametric estimation&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; &lt;span class="ltx_text ltx_bib_publisher"&gt;Springer&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S3.SS2.p6.1" title="3.2 The Packing Lower Bound ‣ 3 The Rate Formula ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§3.2&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S3a.p5.1" title="S.3 The Packing Lower Bound ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§S.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib16" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Vaškevičius and Zhivotovskiy (2023)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;T. Vaškevičius and N. Zhivotovskiy&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Suboptimality of constrained least squares and improvements via non-linear predictors&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Bernoulli&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;29&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;1&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 473–495&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p3.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib39" class="ltx_bibitem ltx_bib_book"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;von zur Gathen and Gerhard (2013)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;J. von zur Gathen and J. Gerhard&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Modern computer algebra&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_edition"&gt;3rd edition&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_publisher"&gt;Cambridge Univ. Press&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S2.SS1.p1.1" title="2.1 The Flow Polytope ‣ 2 The Flow Polytope and the Ancestor Profile ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S5a.p33.1" title="S.5 Exact Evaluation of the Aggregate ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§S.5&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib19" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Wei &lt;span class="ltx_text ltx_bib_etal"&gt;et al.&lt;/span&gt; (2019)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;Y. Wei, M. J. Wainwright, and A. Guntuboyina&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;The geometry of hypothesis testing over convex cones: generalized likelihood ratio tests and minimax radii&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Ann. Statist.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;47&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 994–1024&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p2.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib29" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Willems &lt;span class="ltx_text ltx_bib_etal"&gt;et al.&lt;/span&gt; (1995)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;F. M. J. Willems, Y. M. Shtarkov, and T. J. Tjalkens&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;The context-tree weighting method: basic properties&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;IEEE Trans. Inf. Theory&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;41&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;3&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 653–664&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p4.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib11" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Yang and Barron (1999)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;Y. Yang and A. Barron&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Information-theoretic determination of minimax rates of convergence&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Ann. Statist.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;27&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;5&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 1564–1599&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS1.p4.1" title="1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS3.p2.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib2" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Zhang (2002)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;C. Zhang&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Risk bounds in isotonic regression&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Ann. Statist.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;30&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 528–555&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS1.p5.1" title="1.1 Our Results ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS3.p1.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p1.1" title="1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;li id="bib.bib3" class="ltx_bibitem ltx_bib_article"&gt;&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Zhang (2013)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;L. Zhang&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Nearly optimal minimax estimator for high-dimensional sparse linear regression&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Ann. Statist.&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;41&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;4&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt;pp. 2149–2175&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.p3.1" title="1.3 Related Work ‣ 1 Introduction ‣ The Minimax Rate of Denoising Flows on Trees" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;/article&gt;</description></item><item><title>The Price of Order in the Logarithmic Method</title><link>https://sichen-wang.github.io/publications/price-of-order/</link><pubDate>Sun, 26 Jul 2026 00:00:00 +0000</pubDate><guid>https://sichen-wang.github.io/publications/price-of-order/</guid><description>&lt;article class="ltx_document ltx_authors_1line"&gt;
&lt;section id="S1" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="introduction"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;1 &lt;/span&gt;Introduction&lt;/h2&gt;
&lt;div id="S1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;A classical theme in dynamic data structures is to obtain dynamism by
rebuilding static structures in batches. The logarithmic method of Bentley and
Saxe keeps several static structures of different ages and merges them as updates
arrive &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib1" title="Decomposable searching problems I: static-to-dynamic transformation" class="ltx_ref"&gt;BS80&lt;/a&gt;]&lt;/cite&gt;; lower-bound and structural versions go back to
Mehlhorn and Overmars &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib2" title="Lower bounds on the efficiency of transforming static data structures into dynamic structures" class="ltx_ref"&gt;MEH81&lt;/a&gt;, &lt;a href="#bib.bib30" title="The design of dynamic data structures" class="ltx_ref"&gt;OVE83&lt;/a&gt;]&lt;/cite&gt;. This is also a natural
abstraction of write-optimized ordered storage. The LSM-tree was introduced to
make high-rate updates sequential and cheap &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib22" title="The log-structured merge-tree (LSM-tree)" class="ltx_ref"&gt;OCG+96&lt;/a&gt;]&lt;/cite&gt;; sorted-run
architectures appear in large-scale storage systems and key-value stores such as
Bigtable, Cassandra, MyRocks/RocksDB, WiscKey, and
PebblesDB &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib23" title="Bigtable: a distributed storage system for structured data" class="ltx_ref"&gt;CDG+08&lt;/a&gt;, &lt;a href="#bib.bib24" title="Cassandra: a decentralized structured storage system" class="ltx_ref"&gt;LM10&lt;/a&gt;, &lt;a href="#bib.bib27" title="MyRocks: LSM-tree database storage engine serving facebook’s social graph" class="ltx_ref"&gt;MDL20&lt;/a&gt;, &lt;a href="#bib.bib25" title="WiscKey: separating keys from values in SSD-conscious storage" class="ltx_ref"&gt;LPG+17&lt;/a&gt;, &lt;a href="#bib.bib26" title="PebblesDB: building key-value stores using fragmented log-structured merge trees" class="ltx_ref"&gt;RKC+17&lt;/a&gt;]&lt;/cite&gt;,
and in cache-oblivious write-optimized search structures &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib35" title="Cache-oblivious streaming B-trees" class="ltx_ref"&gt;BFF+07&lt;/a&gt;]&lt;/cite&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The broad area is active because write optimization creates a persistent tension
between update cost, point lookup cost, range-query cost, and space. The systems
literature formulates this tension explicitly through the RUM tradeoff, optimizes
merge policies and filter allocation for point lookups, and designs range filters
or range-query mechanisms for LSM-style stores &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib31" title="Designing access methods: the RUM conjecture" class="ltx_ref"&gt;AKM+16&lt;/a&gt;, &lt;a href="#bib.bib17" title="Monkey: optimal navigable key-value store" class="ltx_ref"&gt;DAI17&lt;/a&gt;, &lt;a href="#bib.bib18" title="Dostoevsky: better space-time trade-offs for LSM-tree based key-value stores via adaptive removal of superfluous merging" class="ltx_ref"&gt;DI18&lt;/a&gt;, &lt;a href="#bib.bib6" title="How to grow an LSM-tree? Towards bridging the gap between theory and practice" class="ltx_ref"&gt;MLI25&lt;/a&gt;, &lt;a href="#bib.bib33" title="SuRF: practical range query filtering with fast succinct tries" class="ltx_ref"&gt;ZLL+18&lt;/a&gt;, &lt;a href="#bib.bib34" title="Rosetta: a robust space-time optimized range filter for key-value stores" class="ltx_ref"&gt;LCK+20&lt;/a&gt;, &lt;a href="#bib.bib32" title="REMIX: efficient range query for LSM-trees" class="ltx_ref"&gt;ZCW+21&lt;/a&gt;]&lt;/cite&gt;.
From a theory point of view, however, these systems raise a more basic question:
what does the logarithmic method itself do to the complexity of ordered-search
queries?&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;At a fixed time, a logarithmic-method structure is not one search tree. It is a
set of independently built sorted components. A point lookup can often be
certified locally in each component, for instance by a hash table or filter. An
exact ordered query is different: predecessor, rank, and exact range queries must
know where the query key, or the interval endpoints, fall inside the relevant
components. Thus the issue is not only the number of components, but also what
kind of information the query must recover inside each component.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p4" class="ltx_para ltx_noindent"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Question.&lt;/span&gt;
For each query family $Q$, what is the optimal product of amortized write cost
and worst-case read cost for a logarithmic-method ordered set?
Equivalently, if $E$ is the total amount of data written and $\widehat{R}_{Q}$ is the
worst read cost for $Q$, we study&lt;/p&gt;
&lt;table id="S1.Ex1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$P_{Q}(n)=\inf_{\mathcal{A}}\left(\frac{E_{\mathcal{A}}(n)}{n}\right)\widehat{R}_{\mathcal{A},Q}(n),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and throughout the paper we report the unnormalized product $E\widehat{R}_{Q}$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This question is not answered by the closest existing lines of work. Classical
static-to-dynamic transformations analyze the overhead of maintaining many static
structures, but do not separate query families that all have logarithmic static
search cost &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib1" title="Decomposable searching problems I: static-to-dynamic transformation" class="ltx_ref"&gt;BS80&lt;/a&gt;, &lt;a href="#bib.bib2" title="Lower bounds on the efficiency of transforming static data structures into dynamic structures" class="ltx_ref"&gt;MEH81&lt;/a&gt;, &lt;a href="#bib.bib30" title="The design of dynamic data structures" class="ltx_ref"&gt;OVE83&lt;/a&gt;, &lt;a href="#bib.bib5" title="Competitive data-structure dynamization" class="ltx_ref"&gt;MRY+21&lt;/a&gt;]&lt;/cite&gt;.
LSM and write-optimized-storage work optimizes concrete tradeoffs for point and
range queries, but does not give a matching query-by-query lower-bound
classification under a single merge history &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib31" title="Designing access methods: the RUM conjecture" class="ltx_ref"&gt;AKM+16&lt;/a&gt;, &lt;a href="#bib.bib17" title="Monkey: optimal navigable key-value store" class="ltx_ref"&gt;DAI17&lt;/a&gt;, &lt;a href="#bib.bib18" title="Dostoevsky: better space-time trade-offs for LSM-tree based key-value stores via adaptive removal of superfluous merging" class="ltx_ref"&gt;DI18&lt;/a&gt;, &lt;a href="#bib.bib33" title="SuRF: practical range query filtering with fast succinct tries" class="ltx_ref"&gt;ZLL+18&lt;/a&gt;, &lt;a href="#bib.bib34" title="Rosetta: a robust space-time optimized range filter for key-value stores" class="ltx_ref"&gt;LCK+20&lt;/a&gt;, &lt;a href="#bib.bib32" title="REMIX: efficient range query for LSM-trees" class="ltx_ref"&gt;ZCW+21&lt;/a&gt;]&lt;/cite&gt;.
Fractional cascading explains how repeated searches across related catalogs can
be shared &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib21" title="Fractional cascading: I. A data structuring technique" class="ltx_ref"&gt;CG86&lt;/a&gt;, &lt;a href="#bib.bib37" title="Dynamic fractional cascading" class="ltx_ref"&gt;MN90&lt;/a&gt;, &lt;a href="#bib.bib4" title="A lower bound for dynamic fractional cascading" class="ltx_ref"&gt;AFS21&lt;/a&gt;]&lt;/cite&gt;, but assumes
that the cross-catalog links needed by the search are actually available. Lower
bounds in cell-probe and external-memory models study different access regimes,
where memory cells or blocks can be probed by address &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib38" title="The cell probe complexity of dynamic data structures" class="ltx_ref"&gt;FS89&lt;/a&gt;, &lt;a href="#bib.bib20" title="Lower bounds for external memory dictionaries" class="ltx_ref"&gt;BF03&lt;/a&gt;, &lt;a href="#bib.bib39" title="The cell probe complexity of dynamic range counting" class="ltx_ref"&gt;LAR12&lt;/a&gt;, &lt;a href="#bib.bib40" title="Unifying the landscape of cell-probe lower bounds" class="ltx_ref"&gt;PĂT11&lt;/a&gt;]&lt;/cite&gt;.
Our focus is the restricted but natural merge-stack regime in which components
are written by sequential merges and later read once in chronological order.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The main obstruction is easy to see in a small example. Suppose the current set
is stored in three sorted components $C_{1},C_{2},C_{3}$, scanned in that order. For
membership of a key $x$, each component only has to certify whether $x$ occurs
there. For predecessor or rank of $x$, the query must learn the local gap of $x$
inside each $C_{i}$. A search in $C_{1}$ does not reveal the gap in $C_{2}$ or $C_{3}$
unless some cross-component search shortcut has already been materialized. The
natural algorithmic objection is fractional cascading: repeated searches in many
sorted catalogs are precisely what fractional cascading was designed to remove
&lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib21" title="Fractional cascading: I. A data structuring technique" class="ltx_ref"&gt;CG86&lt;/a&gt;]&lt;/cite&gt;, and dynamic variants maintain such links under updates
&lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib37" title="Dynamic fractional cascading" class="ltx_ref"&gt;MN90&lt;/a&gt;, &lt;a href="#bib.bib4" title="A lower bound for dynamic fractional cascading" class="ltx_ref"&gt;AFS21&lt;/a&gt;]&lt;/cite&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;In a materialized one-way merge stack, however, the shortcut has the wrong time
direction. The query scans older components before younger ones. A bridge into a
younger component would have to be encountered in an older component, but the
younger component did not exist when the older one was written. Rewriting the
older component later changes its birth time and moves it behind the younger one
in the scan. Thus the components remain independent sorted catalogs for the
purpose of exact order localization.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We formalize this obstruction in a merge-stack model. An insertion-only ordered
set is stored as immutable sorted &lt;em class="ltx_emph ltx_font_italic"&gt;components&lt;/em&gt;. Updates append singleton
components and rebuild suffixes by sequential merges. Queries make one forward
pass over the live components, from old to young, and cannot return to a component
after passing it. Our main theorem is for &lt;em class="ltx_emph ltx_font_italic"&gt;abstract keys&lt;/em&gt;, which can be
compared and hashed but carry no word-RAM coordinate revealing their rank, and for
&lt;em class="ltx_emph ltx_font_italic"&gt;strongly materialized&lt;/em&gt; components, which are self-contained encodings of
their own keys rather than directories for other components. These assumptions
are the clean setting in which the missing fractional cascade is exposed. The
select query gives the forward scan even less information: it supplies only a
rank $K$, not a target key value, and the threshold key may be in a component that
has already passed under the head.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S1.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="our-results"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;1.1 &lt;/span&gt;Our Results&lt;/h3&gt;
&lt;div id="S1.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The main result is a tight, query-sensitive classification of the logarithmic
method in this model.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.Thmtheorem1" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 1.1&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Main Classification)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S1.Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;In the strongly materialized merge-stack model over abstract keys, with oblivious
merge schedules and bounded-error randomized query evaluation, the optimal
write-read product satisfies&lt;/span&gt;&lt;/p&gt;
&lt;table id="S1.Ex2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\min E\widehat{R}_{Q}=\begin{cases}\Theta(n\log^{2}n),&amp;amp;Q\text{ is locally certifiable in each component},\\[2.84526pt] \Theta(n\log^{3}n),&amp;amp;Q\text{ is a target-key order or exact range query},\\[2.84526pt] \Theta(n^{2}),&amp;amp;Q\text{ is select}.\end{cases}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Here the first line includes membership, point-emptiness, and global
minimum/maximum. The second line includes predecessor, successor, rank,
range-count, exact range-sum with unit weights, range-minimum, range-maximum, and
bounded-interval emptiness.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S1.SS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The minimum ranges over all algorithms in the model. The upper bounds are
explicit merge schedules with forward-readable static indexes. The lower bounds
are worst-case over insertion sequences and query instances.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS1.p3" class="ltx_para"&gt;
&lt;table class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle"&gt;
&lt;thead class="ltx_thead"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_justify ltx_align_top ltx_th ltx_th_column ltx_border_tt" style="padding:0.8pt 4.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:95.4pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;family&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/th&gt;
&lt;th class="ltx_td ltx_align_justify ltx_align_top ltx_th ltx_th_column ltx_border_tt" style="padding:0.8pt 4.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:130.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;examples&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/th&gt;
&lt;th class="ltx_td ltx_align_justify ltx_align_top ltx_th ltx_th_column ltx_border_tt" style="padding:0.8pt 4.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:112.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;information available before the scan&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/th&gt;
&lt;th class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top ltx_th ltx_th_column ltx_border_tt" style="padding:0.8pt 4.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:65.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;product&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody class="ltx_tbody"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top ltx_border_t" style="padding:0.8pt 4.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:95.4pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;local certificates&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top ltx_border_t" style="padding:0.8pt 4.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:130.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;membership, point-emptiness, global min/max&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top ltx_border_t" style="padding:0.8pt 4.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:112.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;a key or constant-size certificate checked component by component&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top ltx_border_t" style="padding:0.8pt 4.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:65.0pt;"&gt;$\Theta(n\log^{2}n)$&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.8pt 4.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:95.4pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;target-key order/range&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.8pt 4.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:130.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;predecessor, rank, range-count, exact range aggregates&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.8pt 4.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:112.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;key values or interval endpoints whose local gaps must be found&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top" style="padding:0.8pt 4.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:65.0pt;"&gt;$\Theta(n\log^{3}n)$&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top ltx_border_bb" style="padding:0.8pt 4.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:95.4pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;selection&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top ltx_border_bb" style="padding:0.8pt 4.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:130.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;select&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top ltx_border_bb" style="padding:0.8pt 4.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:112.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;only a rank &lt;/span&gt;$K$&lt;span class="ltx_text" style="font-size:90%;"&gt;, with no target key value&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top ltx_border_bb" style="padding:0.8pt 4.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:65.0pt;"&gt;$\Theta(n^{2})$&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S1.SS1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;a href="#S1.Thmtheorem1" title="Theorem 1.1 (Main Classification). ‣ 1.1 Our Results ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.1&lt;/span&gt;&lt;/a&gt; is not an answer-size separation. Membership, rank, and select
all have $\Theta(\log n)$-bit answers on the hard instances, and rank and select
are inverse operations. The difference is what the scan knows before it starts.
Membership names a key and equality can be checked locally. Predecessor, rank,
and range queries name key values, but exactness requires locating those values
inside each component. Select names no key at all; the answer value is unknown
while early components pass under the one-way scan.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS1.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The assumptions in &lt;a href="#S1.Thmtheorem1" title="Theorem 1.1 (Main Classification). ‣ 1.1 Our Results ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.1&lt;/span&gt;&lt;/a&gt; are also close to the boundary of the
phenomenon. Integer keys reduce the cost of searching within one component;
random access removes the no-backseek difficulty behind select; and
non-materialized cross-component directories can reintroduce fractional-cascading
information. We treat these variants after the main proof, in &lt;a href="#S7" title="7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;
and &lt;a href="#A1" title="Appendix A Cascades Beyond Materialization ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;A&lt;/span&gt;&lt;/a&gt;. They are not part of the headline model, but they help
separate which restriction is responsible for which line of the classification.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S1.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="overview"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;1.2 &lt;/span&gt;Overview&lt;/h3&gt;
&lt;div id="S1.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The proof has a simple architecture. For each query family we prove a read
barrier at a fixed state, and then combine it with an accounting lemma for all
suffix-merge histories.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For membership, the fixed-state barrier is the number of live components. Let
$\widehat{W}$ be the maximum number of live components, and let $\widetilde{D}$ be the average
number of times an item is written, including its initial write. The edit floor
and the merge-forest counting lemma give&lt;/p&gt;
&lt;table id="S1.Ex3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$E=\Omega(n\widetilde{D}),\qquad\widetilde{D}\widehat{W}=\Omega(\log^{2}n).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Some membership query must inspect all live components, so $\widehat{R}=\Omega(\widehat{W})$.
This gives $E\widehat{R}=\Omega(n\log^{2}n)$, matched by the balanced Bentley–Saxe
schedule with local hashes.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For target-key order and range queries, the read barrier is the summed static
search cost in the live components. At a state with component sizes $m_{i}$, we
prove&lt;/p&gt;
&lt;table id="S1.Ex4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widehat{R}_{\mathrm{ord}}=\Omega\!\left(\sum_{i}\log(m_{i}+1)\right).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The terms add because strong materialization forbids a read in one component from
revealing the private search position of the query key in another component. The
merge-history side then proves the size-diversity law&lt;/p&gt;
&lt;table id="S1.Ex5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$E\cdot\max_{t}\sum_{C\text{ live at }t}\log(|C|+1)=\Omega(n\log^{3}n).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;This is the only extra logarithm in the middle line of &lt;a href="#S1.Thmtheorem1" title="Theorem 1.1 (Main Classification). ‣ 1.1 Our Results ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.1&lt;/span&gt;&lt;/a&gt;. Once the
predecessor lower bound is established, direct-sum arguments transfer it to rank,
range-count, exact range-sum, range-minimum, range-maximum, and bounded-interval
emptiness.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS2.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For select, the query is target-free. Consider a boundary in the scan with $P$
stored keys before it and $U$ stored keys after it. We construct a rank query
whose answer is one of $\min\{P,U\}$ possible prefix keys, but the index of the
right key is determined only by suffix information. Since the scan cannot go
back, it must read&lt;/p&gt;
&lt;table id="S1.Ex6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Omega(\min\{P,U\})$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;words before crossing the boundary. If the read budget is small, nearly all live
keys must repeatedly sit in one huge component; immutability then forces that
component to be rebuilt many times. This yields $E=\Omega(n^{2}/\widehat{R})$ and hence
$E\widehat{R}=\Omega(n^{2})$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS2.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;a href="#S2" title="2 Preliminaries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; defines the model, costs, query families, and key assumptions.
&lt;a href="#S3" title="3 Membership ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; proves the membership line. &lt;a href="#S4" title="4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; proves the
no-cascade read floor, the size-diversity law, and the order/range line.
&lt;a href="#S5" title="5 Select ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; proves the cut lower bound and the quadratic select line.
&lt;a href="#S6" title="6 Static-to-Dynamic Lifting ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt; gives a general static-to-dynamic lifting principle for
additive queries. &lt;a href="#S7" title="7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt; records access-model variants, and
&lt;a href="#A1" title="Appendix A Cascades Beyond Materialization ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;A&lt;/span&gt;&lt;/a&gt; studies cascades beyond strong materialization.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S1.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="related-works"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;1.3 &lt;/span&gt;Related Works&lt;/h3&gt;
&lt;div id="S1.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The closest prior work explains pieces of the landscape: dynamization by merging,
write-optimized storage, fractional cascading, and lower bounds in richer memory
models. The following table summarizes why none of these directions already
implies &lt;a href="#S1.Thmtheorem1" title="Theorem 1.1 (Main Classification). ‣ 1.1 Our Results ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.1&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.SS3.p2" class="ltx_para"&gt;
&lt;table class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle"&gt;
&lt;thead class="ltx_thead"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_justify ltx_align_top ltx_th ltx_th_column ltx_border_tt" style="padding:0.7pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:91.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;line of work&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/th&gt;
&lt;th class="ltx_td ltx_align_justify ltx_align_top ltx_th ltx_th_column ltx_border_tt" style="padding:0.7pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:130.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;what it explains&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/th&gt;
&lt;th class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top ltx_th ltx_th_column ltx_border_tt" style="padding:0.7pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:164.8pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;difference from this paper&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody class="ltx_tbody"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top ltx_border_t" style="padding:0.7pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:91.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;logarithmic method&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top ltx_border_t" style="padding:0.7pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:130.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;how to maintain many rebuilt static structures&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top ltx_border_t" style="padding:0.7pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:164.8pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;no classification separating query families with similar static costs&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.7pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:91.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;LSM and write-optimized storage&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.7pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:130.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;practical read/write/space tradeoffs for sorted runs&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top" style="padding:0.7pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:164.8pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;not a matching lower-bound theorem for membership, order/range, and select under one merge history&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.7pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:91.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;fractional cascading&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.7pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:130.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;how to share repeated searches across related catalogs&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top" style="padding:0.7pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:164.8pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;the useful bridge has the wrong chronological direction in a materialized one-way merge stack&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top ltx_border_bb" style="padding:0.7pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:91.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;cell-probe and external-memory lower bounds&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top ltx_border_bb" style="padding:0.7pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:130.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;tradeoffs under random access to cells or blocks&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top ltx_border_bb" style="padding:0.7pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:164.8pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;our restriction is not cell access but the order in which materialized information can be read and rewritten&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;section id="S1.SS3.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h4 class="ltx_title ltx_title_paragraph" id="static-to-dynamic-transformations"&gt;Static-to-Dynamic Transformations.&lt;/h4&gt;
&lt;div id="S1.SS3.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Bentley and Saxe introduced the logarithmic method for decomposable searching
problems &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib1" title="Decomposable searching problems I: static-to-dynamic transformation" class="ltx_ref"&gt;BS80&lt;/a&gt;]&lt;/cite&gt;. Mehlhorn proved lower bounds for such
transformations &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib2" title="Lower bounds on the efficiency of transforming static data structures into dynamic structures" class="ltx_ref"&gt;MEH81&lt;/a&gt;]&lt;/cite&gt;, and Overmars developed a systematic theory
of dynamic structures built from static ones &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib30" title="The design of dynamic data structures" class="ltx_ref"&gt;OVE83&lt;/a&gt;]&lt;/cite&gt;. Recent
competitive dynamization studies merge policies under nonuniform inputs and
read/write ratios &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib5" title="Competitive data-structure dynamization" class="ltx_ref"&gt;MRY+21&lt;/a&gt;]&lt;/cite&gt;. These works explain the overhead of
maintaining many static structures. They do not distinguish query types whose
static problems are all logarithmic; the extra logarithm in &lt;a href="#S1.Thmtheorem1" title="Theorem 1.1 (Main Classification). ‣ 1.1 Our Results ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.1&lt;/span&gt;&lt;/a&gt; is
caused by exact order localization across materialized components.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S1.SS3.SSS0.Px2" class="ltx_paragraph"&gt;
&lt;h4 class="ltx_title ltx_title_paragraph" id="write-optimized-storage"&gt;Write-Optimized Storage.&lt;/h4&gt;
&lt;div id="S1.SS3.SSS0.Px2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The LSM-tree was introduced to make high-rate updates sequential and cheap
&lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib22" title="The log-structured merge-tree (LSM-tree)" class="ltx_ref"&gt;OCG+96&lt;/a&gt;]&lt;/cite&gt;. LSM-style sorted runs appear in large-scale storage systems and
key-value stores &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib23" title="Bigtable: a distributed storage system for structured data" class="ltx_ref"&gt;CDG+08&lt;/a&gt;, &lt;a href="#bib.bib24" title="Cassandra: a decentralized structured storage system" class="ltx_ref"&gt;LM10&lt;/a&gt;, &lt;a href="#bib.bib27" title="MyRocks: LSM-tree database storage engine serving facebook’s social graph" class="ltx_ref"&gt;MDL20&lt;/a&gt;, &lt;a href="#bib.bib25" title="WiscKey: separating keys from values in SSD-conscious storage" class="ltx_ref"&gt;LPG+17&lt;/a&gt;, &lt;a href="#bib.bib26" title="PebblesDB: building key-value stores using fragmented log-structured merge trees" class="ltx_ref"&gt;RKC+17&lt;/a&gt;]&lt;/cite&gt;.
The systems literature maps the read/update/storage tradeoff &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib31" title="Designing access methods: the RUM conjecture" class="ltx_ref"&gt;AKM+16&lt;/a&gt;]&lt;/cite&gt;,
optimizes merge policies and filter allocation for point lookups
&lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib17" title="Monkey: optimal navigable key-value store" class="ltx_ref"&gt;DAI17&lt;/a&gt;, &lt;a href="#bib.bib18" title="Dostoevsky: better space-time trade-offs for LSM-tree based key-value stores via adaptive removal of superfluous merging" class="ltx_ref"&gt;DI18&lt;/a&gt;, &lt;a href="#bib.bib6" title="How to grow an LSM-tree? Towards bridging the gap between theory and practice" class="ltx_ref"&gt;MLI25&lt;/a&gt;]&lt;/cite&gt;, and builds succinct or probabilistic
range filters and range-query mechanisms &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib33" title="SuRF: practical range query filtering with fast succinct tries" class="ltx_ref"&gt;ZLL+18&lt;/a&gt;, &lt;a href="#bib.bib34" title="Rosetta: a robust space-time optimized range filter for key-value stores" class="ltx_ref"&gt;LCK+20&lt;/a&gt;, &lt;a href="#bib.bib32" title="REMIX: efficient range query for LSM-trees" class="ltx_ref"&gt;ZCW+21&lt;/a&gt;]&lt;/cite&gt;.
This work motivates the access discipline, but it does not prove a tight
query-by-query product classification under the same merge histories.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S1.SS3.SSS0.Px3" class="ltx_paragraph"&gt;
&lt;h4 class="ltx_title ltx_title_paragraph" id="fractional-cascading"&gt;Fractional Cascading.&lt;/h4&gt;
&lt;div id="S1.SS3.SSS0.Px3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Fractional cascading removes repeated binary searches across related catalogs in
static structures &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib21" title="Fractional cascading: I. A data structuring technique" class="ltx_ref"&gt;CG86&lt;/a&gt;]&lt;/cite&gt;; dynamic fractional cascading studies
how to maintain such links under updates &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib37" title="Dynamic fractional cascading" class="ltx_ref"&gt;MN90&lt;/a&gt;, &lt;a href="#bib.bib4" title="A lower bound for dynamic fractional cascading" class="ltx_ref"&gt;AFS21&lt;/a&gt;]&lt;/cite&gt;.
Our obstruction is orthogonal. The issue is not only the cost of updating a
cascade, but whether the bridge can appear before the component it accelerates is
created. In the strongly materialized one-way model it cannot; &lt;a href="#A1" title="Appendix A Cascades Beyond Materialization ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;A&lt;/span&gt;&lt;/a&gt;
examines what changes when such cross-component data are allowed.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S1.SS3.SSS0.Px4" class="ltx_paragraph"&gt;
&lt;h4 class="ltx_title ltx_title_paragraph" id="lower-bounds-and-restricted-access"&gt;Lower Bounds and Restricted Access.&lt;/h4&gt;
&lt;div id="S1.SS3.SSS0.Px4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;External-memory dictionary lower bounds study update/query tradeoffs under random
block access &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib20" title="Lower bounds for external memory dictionaries" class="ltx_ref"&gt;BF03&lt;/a&gt;, &lt;a href="#bib.bib7" title="External-memory dictionaries with worst-case update cost" class="ltx_ref"&gt;DIN22&lt;/a&gt;]&lt;/cite&gt;. Cell-probe lower bounds
for dynamic data structures, including dynamic range counting, use a more
powerful random-access memory model &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib38" title="The cell probe complexity of dynamic data structures" class="ltx_ref"&gt;FS89&lt;/a&gt;, &lt;a href="#bib.bib39" title="The cell probe complexity of dynamic range counting" class="ltx_ref"&gt;LAR12&lt;/a&gt;, &lt;a href="#bib.bib40" title="Unifying the landscape of cell-probe lower bounds" class="ltx_ref"&gt;PĂT11&lt;/a&gt;, &lt;a href="#bib.bib41" title="Unifying the landscape of super-logarithmic dynamic cell-probe lower bounds" class="ltx_ref"&gt;KO25&lt;/a&gt;]&lt;/cite&gt;.
Our bounds are orthogonal: component encodings are static and transparent, but the
read and rewrite order is restricted. The lifting theorem in &lt;a href="#S6" title="6 Static-to-Dynamic Lifting ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;
connects our merge-stack bounds to static predecessor and range-searching lower
bounds &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib8" title="Time-space trade-offs for predecessor search" class="ltx_ref"&gt;PT06&lt;/a&gt;, &lt;a href="#bib.bib9" title="Randomization does not help searching predecessors" class="ltx_ref"&gt;PT07&lt;/a&gt;, &lt;a href="#bib.bib13" title="Lower bounds for 2-dimensional range counting" class="ltx_ref"&gt;PĂT07&lt;/a&gt;, &lt;a href="#bib.bib14" title="Adaptive and approximate orthogonal range counting" class="ltx_ref"&gt;CW13&lt;/a&gt;]&lt;/cite&gt;.
The merge-history accounting is closest in spirit to list labeling and file
maintenance &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib28" title="A sparse table implementation of priority queues" class="ltx_ref"&gt;IKR81&lt;/a&gt;, &lt;a href="#bib.bib3" title="Tight lower bounds for the online labeling problem" class="ltx_ref"&gt;BKS12&lt;/a&gt;, &lt;a href="#bib.bib19" title="Online list labeling: breaking the log2n barrier" class="ltx_ref"&gt;BCF+22&lt;/a&gt;, &lt;a href="#bib.bib29" title="Nearly optimal list labeling" class="ltx_ref"&gt;BCF+24&lt;/a&gt;]&lt;/cite&gt;; the select lower
bound is related to selection under restricted access &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib36" title="Selection and sorting with limited storage" class="ltx_ref"&gt;MP80&lt;/a&gt;, &lt;a href="#bib.bib15" title="Generalized selection and ranking: sorted matrices" class="ltx_ref"&gt;FJ84&lt;/a&gt;, &lt;a href="#bib.bib16" title="Selection from heaps, row-sorted matrices, and +XY using soft heaps" class="ltx_ref"&gt;KKZ+19&lt;/a&gt;, &lt;a href="#bib.bib42" title="A nearly optimal randomized algorithm for explorable heap selection" class="ltx_ref"&gt;BDH+23&lt;/a&gt;]&lt;/cite&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S2" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="preliminaries"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;2 &lt;/span&gt;Preliminaries&lt;/h2&gt;
&lt;div id="S2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This section fixes the model used in the main classification. The objects are
merge histories of immutable sorted components, the costs are total rewritten mass
and prefix-worst read cost, and the key assumptions isolate the absence of
cross-component order information.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S2.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="merge-histories-and-components"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;2.1 &lt;/span&gt;Merge Histories and Components&lt;/h3&gt;
&lt;div id="S2.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;A &lt;em class="ltx_emph ltx_font_italic"&gt;merge stack&lt;/em&gt; maintains a sequence of immutable sorted components
$C_{1},\dots,C_{W}$, oldest at the bottom. Each component stores a sorted block of
key-value samples together with any static index built from that block alone.
Three operations maintain it:&lt;/p&gt;
&lt;ul id="S2.I1" class="ltx_itemize"&gt;
&lt;li id="S2.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S2.I1.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;insert&lt;/em&gt;$(x,y)$ pushes a new singleton component $\{(x,y)\}$ on top;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="S2.I1.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S2.I1.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;merge&lt;/em&gt; pops a suffix $C_{i},\dots,C_{W}$ and pushes a single component
holding the union of their samples in sorted order;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="S2.I1.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S2.I1.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;query&lt;/em&gt; makes one forward pass over $C_{1},C_{2},\dots$ in stack order,
reading component data; after an $O(1)$ header it may skip a component’s body,
but it never returns to an earlier component.&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="ltx_p"&gt;Inserts and merges interleave according to a schedule of the algorithm’s choice.
The main lower bounds consider schedules that are oblivious to the key values;
this condition is part of strong materialization below.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S2.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="cost-measures"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;2.2 &lt;/span&gt;Cost Measures&lt;/h3&gt;
&lt;div id="S2.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The &lt;em class="ltx_emph ltx_font_italic"&gt;write cost&lt;/em&gt; $E$ is the total component data created or rewritten over
the execution. The read cost of a query is the data it reads, and $\widehat{R}$ is its
prefix-worst value: the maximum, over every time $t$ and every query, of the cost
of answering that query against the state after step $t$. Making $\widehat{R}$
prefix-worst keeps the read cost from being amortized away by periodic global
rebuilds, since every intermediate state must remain queryable. For a randomized
evaluator the cost of a query is its expected number of charged reads, and
$\widehat{R}$ is again prefix-worst. The complexity measure throughout is the product
$E\widehat{R}$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;A token is a machine word of $w=\Theta(\log n)$ bits, and keys and values are drawn
from universes of size $\mathrm{poly}(n)$, so a sample occupies $O(1)$ tokens and a
component of $m$ samples occupies $\Theta(m)$. We use the following notation.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS2.p3" class="ltx_para"&gt;
&lt;table class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle"&gt;
&lt;thead class="ltx_thead"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_th_row ltx_border_tt" style="padding:0.65pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;symbol&lt;/span&gt;&lt;/th&gt;
&lt;th class="ltx_td ltx_nopad_r ltx_align_left ltx_th ltx_th_column ltx_border_tt" style="padding:0.65pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;meaning&lt;/span&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody class="ltx_tbody"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t" style="padding:0.65pt 5.0pt;"&gt;$E$&lt;/th&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_left ltx_border_t" style="padding:0.65pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;total rewritten component data&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding:0.65pt 5.0pt;"&gt;$\widehat{R}_{Q}$&lt;/th&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_left" style="padding:0.65pt 5.0pt;"&gt;
&lt;span class="ltx_text" style="font-size:90%;"&gt;prefix-worst read cost for query family &lt;/span&gt;$Q$
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding:0.65pt 5.0pt;"&gt;$\widehat{W}$&lt;/th&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_left" style="padding:0.65pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;maximum number of live components over the execution&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding:0.65pt 5.0pt;"&gt;$\widetilde{D}$&lt;/th&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_left" style="padding:0.65pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;average item write depth, including the initial write&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding:0.65pt 5.0pt;"&gt;$L$&lt;/th&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_left" style="padding:0.65pt 5.0pt;"&gt;$\log_{2}n$&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb" style="padding:0.65pt 5.0pt;"&gt;$\lambda$&lt;/th&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_left ltx_border_bb" style="padding:0.65pt 5.0pt;"&gt;$\log_{2}\log_{2}n$&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S2.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="query-families"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;2.3 &lt;/span&gt;Query Families&lt;/h3&gt;
&lt;div id="S2.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Three query types drive the paper. &lt;em class="ltx_emph ltx_font_italic"&gt;Membership&lt;/em&gt; is the exact-match point
query: given $x$, return its value if $x$ is live and a default otherwise. It is
locally certifiable because equality can be settled inside each component by a
hash or perfect dictionary. &lt;em class="ltx_emph ltx_font_italic"&gt;Predecessor&lt;/em&gt; is the basic target-key order
query: given $x$, return the value of the largest live key at most $x$. Successor,
rank, and exact range queries – count, sum, minimum, maximum, and emptiness over
an interval – are target-key order or range queries of the same kind, since each
must locate a key value or endpoint in the live order. Membership and these order
queries are &lt;em class="ltx_emph ltx_font_italic"&gt;decomposable&lt;/em&gt;: an answer combines fixed per-component
contributions. &lt;em class="ltx_emph ltx_font_italic"&gt;Select&lt;/em&gt; is different. It is given a rank $K$ and returns
the $K$-th smallest live key; no target key value is supplied to the scan. Inserted
keys are distinct, and the lower bounds use distinct-key instances.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S2.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="key-models-and-materialization"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;2.4 &lt;/span&gt;Key Models and Materialization&lt;/h3&gt;
&lt;div id="S2.SS4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Keys come in two models, and the order separation depends on which one is used.
An &lt;em class="ltx_emph ltx_font_italic"&gt;abstract key&lt;/em&gt; is the model for string, tuple, or opaque record keys: it is
hashable and comparable, but carries no integer structure. We read it through an
oracle. A key has an opaque equality label and an unknown position in the total
order, and neither the label nor its hash reveals that position. A single read
returns at most one stored key handle together with $O(1)$ control words, and the
handle’s rank among those already read is learned only by comparison. The encoder
cannot manufacture an order-bearing separator it has not read, and an answer must
be a key or value decoded from the words read, not a pointer into an unread cell.
The $O(1)$ control words therefore cannot stand in for the order of a whole block.
An &lt;em class="ltx_emph ltx_font_italic"&gt;integer key&lt;/em&gt; is an integer in a $\mathrm{poly}(n)$ universe, with the
word-RAM available: a van Emde Boas tree or y-fast trie locates the predecessor
inside a component in $O(\lambda)$ reads, independent of its size, and the order
gap narrows accordingly (&lt;a href="#S7" title="7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The main theorems hold in executions realized by size-based log-structured
merging. Ordinary materialization, which constrains only a component’s contents,
is not enough: once the merge schedule may depend on the data, the partition into
components itself carries order information across them, and an unread block is no
longer free for an adversary to complete. We use the following stronger
condition.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmtheorem1" class="ltx_theorem ltx_theorem_definition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Definition 2.1&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Strong Materialization)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S2.Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;An execution is &lt;em class="ltx_emph ltx_font_italic"&gt;strongly materialized&lt;/em&gt; if it satisfies the following.&lt;/p&gt;
&lt;ul id="S2.I2" class="ltx_itemize"&gt;
&lt;li id="S2.I2.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S2.I2.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Canonical updates&lt;/em&gt;: after each insertion the active components
partition the inserted samples into contiguous blocks of consecutive
insertion times, and each insertion performs at most one merge, replacing a
suffix of the active components and the new singleton by a single component.&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="S2.I2.i2" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S2.I2.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Oblivious schedule&lt;/em&gt;: the merged suffix at each step depends only on
the step index and the current component sizes, not on the keys, values,
query answers, or any coins.&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="S2.I2.i3" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S2.I2.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Exact layout&lt;/em&gt;: a component of $m$ samples occupies a publicly fixed
length $\ell(m)\in[c_{0}m,c_{1}m]$, so component boundaries, addresses, and the
merge structure are functions of the size sequence alone.&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="S2.I2.i4" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S2.I2.i4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;Local encoding&lt;/em&gt;: a component’s tokens depend only on its own
samples, their insertion order and values, and comparisons among its own keys;
inputs that agree on every component’s internal order, labels, values, and
insertion history, and differ only in how keys of distinct components
interleave, induce identical component encodings.&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="S2.I2.i5" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S2.I2.i5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;No external state&lt;/em&gt;: no sample-dependent state persists outside the
components, the query evaluator starts from a data-independent configuration
with coins independent of the data, and every dependence on the data passes
through reads of component tokens.&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This is what an LSM run already is, a self-contained sorted file; &lt;a href="#A1" title="Appendix A Cascades Beyond Materialization ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;A&lt;/span&gt;&lt;/a&gt;
removes the condition and lets a young component share or copy order information
from older ones.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS4.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The per-component arguments use one consequence. Call an execution
&lt;em class="ltx_emph ltx_font_italic"&gt;no-cascade&lt;/em&gt; if a read in one component cannot shrink another component’s set
of candidate answers. Strong materialization supplies it: changing one block
leaves the partition, every other component’s encoding, and the layout untouched,
so a read elsewhere says nothing about that block. A non-materialized global key
order, searchable by random access, would violate this, the components then
admitting a joint search in $O(\log n)$ reads; random access alone, with the
components still materialized, does not. This locality is what &lt;a href="#A1" title="Appendix A Cascades Beyond Materialization ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;A&lt;/span&gt;&lt;/a&gt;
gives up.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.SS4.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The canonical-updates clause is without loss of generality: the merges performed
between two insertions act on nested suffixes of the stack and coalesce into their
final suffix merge, and collapsing them removes the intermediate writes and
queryable states, so neither $E$ nor $\widehat{R}$ grows. Under exact layout the write
cost is structural rather than informational: building a component of $m$ samples
costs $\Theta(m)$ tokens whatever it holds, a fact the edit floor of
&lt;a href="#S3" title="3 Membership ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; reads off directly.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S2.SS5" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="serialization-and-forward-reads"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;2.5 &lt;/span&gt;Serialization and Forward Reads&lt;/h3&gt;
&lt;div id="S2.SS5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The lower bounds are cleaner in a low-level view of the same execution. Serialize
the components in stack order into a single token string, each component a
contiguous block preceded by a length-prefix header. Edits become tail operations:
an insert pushes one block at the tail, and a merge of a stack suffix pops the most
recently pushed blocks and pushes one new block. Writing $\mathrm{LCP}$ for the
longest common prefix, the edit $s_{t-1}\to s_{t}$ costs&lt;/p&gt;
&lt;table id="S2.Ex1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{\mathrm{LIFO}}(s_{t-1},s_{t})=\bigl(|s_{t-1}|-|\mathrm{LCP}|\bigr)+\bigl(|s_{t}|-|\mathrm{LCP}|\bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;the number of tokens popped and pushed at the tail, so
$E=\sum_{t}d_{\mathrm{LIFO}}(s_{t-1},s_{t})$; we call such tail-only edits
&lt;em class="ltx_emph ltx_font_italic"&gt;LIFO&lt;/em&gt;. A query is run by a &lt;em class="ltx_emph ltx_font_italic"&gt;forward, no-backseek&lt;/em&gt; head: it starts at
position $0$ and at each step either reads the current token, at unit cost,
advancing one place, or skips forward at no cost by an amount it computes from its
finite control, the query, and the tokens read so far. It never moves backward,
working memory is free, and only reads are charged.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmtheorem2" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 2.2&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Serialization Equivalence)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S2.Thmtheorem2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For strongly materialized executions, the merge-stack model and the LIFO-token,
forward-no-backseek model agree up to constant factors in $(E,\widehat{R})$.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S2.SS5.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Serialize as above. An insert pushes a block of $\Theta(1)$ tokens at the tail,
and a merge pops exactly the most recently pushed blocks and pushes one new block,
so every edit is tail-only; the pushed token mass equals the rewritten component
data up to the matching pops, a constant factor, so $E_{\mathrm{token}}=\Theta(E)$.
The components occupy the string in stack order, which is birth order and the order
a forward head reads them, and skipping a body after its header is a legal
no-backseek pass, so $\widehat{R}_{\mathrm{token}}=\Theta(\widehat{R})$. Conversely, a
tail-only token execution whose pushed blocks are local encodings of the unions of
the popped blocks splits into contiguous blocks in birth order, since the tokens
pushed at one step are consecutive and share a birth time, and is a merge-stack
execution with the same merge structure.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS5.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;One may therefore keep the merge-stack picture throughout and read the lower-bound
proofs as statements about the token string.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S2.SS6" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="baseline-upper-bounds"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;2.6 &lt;/span&gt;Baseline Upper Bounds&lt;/h3&gt;
&lt;div id="S2.SS6.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The serial Bentley–Saxe transform &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib1" title="Decomposable searching problems I: static-to-dynamic transformation" class="ltx_ref"&gt;BS80&lt;/a&gt;]&lt;/cite&gt; supplies the upper
bounds the lower bounds will match.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.Thmtheorem3" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Proposition 2.3&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Bentley–Saxe Baseline)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S2.Thmtheorem3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;A single schedule has $E=O(n\log n)$ with at most $\lceil\log_{2}(n+1)\rceil$
active components at all times, and answers membership in $\widehat{R}=O(\log n)$,
abstract-key predecessor in $\widehat{R}=O(\log^{2}n)$, and integer predecessor in
$\widehat{R}=O(\lambda\log n)$. The corresponding products are&lt;/span&gt;&lt;/p&gt;
&lt;table id="S2.Ex2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$E\widehat{R}=O(n\log^{2}n),\qquad O(n\log^{3}n),\qquad O(n\log^{2}n\,\lambda).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S2.SS6.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Keep the components whose sizes are the set bits of the insert count, merging
equal-sized ones on each insert. A component of size $2^{k}$ is built at most
$n/2^{k}$ times, each at $\Theta(2^{k})$ tokens, so $E=O(n\log n)$, and at most
$\lceil\log_{2}(n+1)\rceil$ components are live at any time. Each component carries
a forward-readable static structure, length-prefixed so the head skips its body
after one header read. A static perfect hash answers membership in $O(1)$ reads
per component, even against an adversarial query, so $\widehat{R}=O(\log n)$. For
abstract-key predecessor, a balanced search tree laid out in search-round order,
all depth-one nodes, then all depth-two, and so on, is traversed root to leaf as a
forward scan of $O(\log m_{k})$ comparison reads in component $k$, summing to
$O(\log^{2}n)$ over the active components. For integer predecessor, a y-fast trie
answers in $O(\lambda)$ reads per component under the same round-by-round layout,
giving $\widehat{R}=O(\lambda\log n)$.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S2.SS6.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The membership and predecessor products are the first the lower bounds match
(&lt;a href="#S3" title="3 Membership ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Sections&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S4" title="4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;); select needs a different schedule and is
polynomially larger (&lt;a href="#S5" title="5 Select ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;). How the predecessor bound responds when
these conditions are relaxed, and why the relaxations are not interchangeable, is
the subject of &lt;a href="#S7" title="7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S3" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="membership"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;3 &lt;/span&gt;Membership&lt;/h2&gt;
&lt;div id="S3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The Bentley–Saxe schedule of &lt;a href="#S2" title="2 Preliminaries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; answers membership with product
$n\log^{2}n$. We show this is best possible, and in doing so establish the three
structural facts the later lower bounds reuse: a level decomposition that the
tail-only discipline forces, an edit floor on the write cost, and a counting
bound that trades depth against frontier. Together they expose the mechanism the
paper turns on, that $E\widehat{R}$ factors into a write budget and a sum of per-level
read charges. Membership is the case where a hash holds every charge at $O(1)$;
order and rank raise it.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S3.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="merge-forests"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.1 &lt;/span&gt;Merge Forests&lt;/h3&gt;
&lt;div id="S3.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Fix an execution. A live token in $s_{t}$ has a &lt;em class="ltx_emph ltx_font_italic"&gt;birth step&lt;/em&gt;, the step at
which it was last pushed, and tokens with a common birth step form a
&lt;em class="ltx_emph ltx_font_italic"&gt;level&lt;/em&gt;; by &lt;a href="#S2.Thmtheorem2" title="Lemma 2.2 (Serialization Equivalence). ‣ 2.5 Serialization and Forward Reads ‣ 2 Preliminaries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.2&lt;/span&gt;&lt;/a&gt; a level is just a component of &lt;a href="#S2" title="2 Preliminaries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;
in token-string form. Write $W(t)$ for the number of live levels at time $t$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.Thmtheorem1" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 3.1&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Level Decomposition)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S3.Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;At every time $t$ the live levels are contiguous and ordered by birth,
$s_{t}=L_{t_{1}}\cdots L_{t_{W}}$ with $t_{1}&amp;lt;\cdots&amp;lt;t_{W}$, and the edit $s_{t-1}\to s_{t}$
pops a suffix of them and pushes one new top level.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S3.SS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;A canonical update pops a suffix of the active components and pushes one merged
component (&lt;a href="#S2" title="2 Preliminaries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;). The tokens pushed at one step are consecutive at
the tail and share a birth step, so each level is contiguous and older levels lie
earlier; an edit pops a suffix of whole levels and makes the pushed tokens the
new top level.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The decomposition makes the execution a &lt;em class="ltx_emph ltx_font_italic"&gt;merge forest&lt;/em&gt;: an internal node for
each step that merges, its children the levels popped there and the singleton
inserted then, and a leaf for each insert. Leaf $j$ takes part in $d_{j}$ merges,
one for each of its internal ancestors. The rewritten sample mass is therefore&lt;/p&gt;
&lt;table id="S3.Ex1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$M:=\sum_{j}d_{j}=\sum_{P}|P|,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;$|P|$ being the number of leaves below the internal node $P$. The forest is fixed by the
schedule alone, whatever the tokens mean, and the lower bounds read off it.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The hard instances carry their entropy in the values: each inserted value is
independent and uniform over a $\mathrm{poly}(n)$ universe, so it is
$\Theta(\log n)$ bits, the content of one token.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.Thmtheorem2" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 3.2&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Incompressibility)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S3.Thmtheorem2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;On the i.i.d.-value instance, a materialized level that is the sole source for $m$
of its samples occupies $\Omega(m)$ tokens.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S3.SS1.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The state must determine those $m$ values, whose joint entropy is
$\Theta(m\log n)$ bits, or $\Theta(m)$ tokens. Materialization places them in this
level alone, so it occupies $\Omega(m)$ tokens.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.Thmtheorem3" class="ltx_theorem ltx_theorem_corollary"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Corollary 3.3&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Edit Floor)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S3.Thmtheorem3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;With &lt;em class="ltx_emph ltx_font_upright"&gt;augmented depth&lt;/em&gt; $\widetilde{D}:=(M+n)/n$, the write cost is
$E=\Omega(n\widetilde{D})$.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S3.SS1.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Under exact layout a level of $m$ samples costs $\Theta(m)$ tokens, so
$E=\Theta(n+M)=\Theta(n\widetilde{D})$. With no layout fixed, &lt;a href="#S3.Thmtheorem2" title="Lemma 3.2 (Incompressibility). ‣ 3.1 Merge Forests ‣ 3 Membership ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.2&lt;/span&gt;&lt;/a&gt; applies to
each level when it is built, the sole source for its samples at that moment, and
summing over the levels built, of total size $n+M$, gives $E\geq c(n+M)=cn\widetilde{D}$
for a constant $c\in(0,1]$.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The third fact ties depth to frontier. Its counting argument is the
online-labeling lemma of Bulánek, Koucký, and Saks &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib3" title="Tight lower bounds for the online labeling problem" class="ltx_ref"&gt;BKS12&lt;/a&gt;]&lt;/cite&gt;, recast in
merge-forest terms. Write $\widehat{W}:=\max_{t}W(t)$ for the &lt;em class="ltx_emph ltx_font_italic"&gt;frontier width&lt;/em&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.Thmtheorem4" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 3.4&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Frontier Width)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S3.Thmtheorem4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Every merge forest on $n$ leaves with augmented depth $\widetilde{D}$ and frontier width
$\widehat{W}$ has $\widetilde{D}\widehat{W}=\Omega(\log^{2}n)$.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S3.SS1.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;With a dummy root above the final frontier, a leaf in $d_{j}$ merges has augmented
depth $d_{j}+1$, of mean $\widetilde{D}$. Let $N(h,W)$ be the most leaves an ordered suffix-merge
tree of height at most $h$ can have while its live frontier never exceeds $W$. Its
root pops a suffix of $r\leq W$ children, each a completed subtree that holds a
frontier slot until the merge, together with the singleton inserted then, a
height-$0$ child holding no slot. With $N(0,W)=1$,&lt;/p&gt;
&lt;table id="S3.Ex2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$N(h,W)\ \leq\ 1+\sum_{q=1}^{W}N(h-1,q)\ \leq\ \sum_{q=0}^{W}\binom{h-1+q}{q}\ =\ \binom{h+W}{W},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;the singleton being the $q=0$ term and the last step the hockey-stick identity.
For $a\leq b$, $\log_{2}\binom{a+b}{a}\leq a\log_{2}\frac{e(a+b)}{a}=O(\sqrt{ab})$ using
$\log_{2}u\leq 2\sqrt{u}$. By Markov at least $n/2$ leaves have augmented depth at
most $2\widetilde{D}$; keeping them and suppressing empty internal nodes leaves an ordered
tree with at least $n/2$ leaves, height at most $\lceil 2\widetilde{D}\rceil$, and
frontier at most $\widehat{W}$, so&lt;/p&gt;
&lt;table id="S3.Ex3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\log_{2}\tfrac{n}{2}\ \leq\ \log_{2}\binom{\lceil 2\widetilde{D}\rceil+\widehat{W}}{\widehat{W}}\ =\ O\!\bigl(\sqrt{\widetilde{D}\widehat{W}}\bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;that is $\widetilde{D}\widehat{W}=\Omega(\log^{2}n)$.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S3.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-membership-bound"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.2 &lt;/span&gt;The Membership Bound&lt;/h3&gt;
&lt;div id="S3.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The read side needs one fact: a forward head must visit every live level.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.Thmtheorem5" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 3.5&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Sequential Access)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S3.Thmtheorem5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For an oblivious schedule, some strongly materialized realization forces
$\widehat{R}\geq\widehat{W}$ on a fresh membership query against a deterministic evaluator, and
$\widehat{R}\geq\widehat{W}/3$ against a bounded-error one.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S3.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;At a time of maximum frontier, take the realization in which every live level
straddles a fresh key $x$ matching none of its samples. Each live level must
be decided on its own, that $x$ is absent there, and under strong materialization
no other level constrains it, so a level left unread can be filled with $x$ by the
adversary, flipping the answer. A deterministic evaluator therefore reads all
$\widehat{W}$ levels, so $\widehat{R}\geq\widehat{W}$. For a bounded-error one, couple this input
with the one in which only level $i$ gains $x$: the transcripts agree until level
$i$ is read, so skipping it makes the evaluator answer both alike and err on one,
and the two error probabilities sum to at least the probability of skipping level
$i$. Bounded error keeps that sum below $\tfrac{2}{3}$, so level $i$ is read with
probability at least $\tfrac{1}{3}$ and $\widehat{R}\geq\widehat{W}/3$. A length header does not
escape the charge, that read being the one counted.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.Thmtheorem6" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 3.6&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Tight Membership Bound)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S3.Thmtheorem6.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Strongly materialized membership has $E\widehat{R}=\Theta(n\log^{2}n)$, attained at
$(E,\widehat{R})=(\Theta(n\log n),\Theta(\log n))$ by hashing on the Bentley–Saxe
schedule.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S3.SS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The upper bound is &lt;a href="#S2.Thmtheorem3" title="Proposition 2.3 (Bentley–Saxe Baseline). ‣ 2.6 Baseline Upper Bounds ‣ 2 Preliminaries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt;. For the lower bound, &lt;a href="#S3.Thmtheorem5" title="Lemma 3.5 (Sequential Access). ‣ 3.2 The Membership Bound ‣ 3 Membership ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.5&lt;/span&gt;&lt;/a&gt;
gives $\widehat{R}\geq\widehat{W}$, &lt;a href="#S3.Thmtheorem3" title="Corollary 3.3 (Edit Floor). ‣ 3.1 Merge Forests ‣ 3 Membership ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Corollary&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt; gives $E=\Omega(n\widetilde{D})$, and
&lt;a href="#S3.Thmtheorem4" title="Lemma 3.4 (Frontier Width). ‣ 3.1 Merge Forests ‣ 3 Membership ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.4&lt;/span&gt;&lt;/a&gt; gives $\widetilde{D}\widehat{W}=\Omega(\log^{2}n)$, so
$E\widehat{R}=\Omega(n\widetilde{D}\widehat{W})=\Omega(n\log^{2}n)$.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Nothing in the lower bound used what membership computes, only that every live
level must be decided, so $n\log^{2}n$ is a floor for the whole model, reached by
membership. It is robust to randomization through &lt;a href="#S3.Thmtheorem5" title="Lemma 3.5 (Sequential Access). ‣ 3.2 The Membership Bound ‣ 3 Membership ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.5&lt;/span&gt;&lt;/a&gt;, and it
constrains the tradeoff and not just the product: $\widehat{R}=O(\log n)$ forces
$\widehat{W}=O(\log n)$, hence $\widetilde{D}=\Omega(\log n)$ and $E=\Omega(n\log n)$. Membership
is the hashable extreme, each level settled by one probe. The rest of the paper
keeps this write budget and asks whether the read side can stay at $O(1)$ per
level; once the query needs order, it cannot.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S4" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="order-queries"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;4 &lt;/span&gt;Order Queries&lt;/h2&gt;
&lt;div id="S4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This section proves the middle line of &lt;a href="#S1.Thmtheorem1" title="Theorem 1.1 (Main Classification). ‣ 1.1 Our Results ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.1&lt;/span&gt;&lt;/a&gt;. The proof has three
steps. First, strong materialization and one-way access rule out the
cross-component shortcut that fractional cascading would need. Second, once the
components cannot share searches, a fixed state with component sizes $m_{i}$ forces
$\Omega(\sum_{i}\log(m_{i}+1))$ reads for a hard predecessor query. Third, every
cheap suffix-merge history exposes some state where this summed log-size is
large, giving the product lower bound $\Omega(n\log^{3}n)$. The final subsection
transfers predecessor to rank and exact range queries.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S4.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="no-cascading-across-components"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;4.1 &lt;/span&gt;No Cascading Across Components&lt;/h3&gt;
&lt;div id="S4.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Membership spends $O(1)$ per level because a hash names where the answer sits.
Order has no such shortcut and cannot build one by linking levels. Call a
&lt;em class="ltx_emph ltx_font_italic"&gt;forward bridge&lt;/em&gt; from a level $L_{i}$ to a younger level $L_{j}$ any data stored
in $L_{i}$ that lets the head, once it has read $L_{i}$, reach the query’s predecessor
in $L_{j}$ within $O(1)$ further reads.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem1" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 4.1&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Causal-Bridge Obstruction)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S4.Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Under forward, no-backseek access with LIFO edits, no forward bridge can be
consulted when it would help.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Levels are read oldest first (&lt;a href="#S3.Thmtheorem1" title="Lemma 3.1 (Level Decomposition). ‣ 3.1 Merge Forests ‣ 3 Membership ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt;). A bridge that speeds up a
younger level $L_{j}$ must be read before $L_{j}$, hence stored in an older level
$L_{i}$; but its content depends on $L_{j}$, fixed only when $L_{j}$ is built, so its
carrier must be younger than $L_{j}$. The two demands collide: when $L_{i}$ was built
$L_{j}$ did not yet exist, and on adversarial independent keys no guess survives.
Rebuilding $L_{i}$ after $L_{j}$ only pushes its birth past $L_{j}$, moving it behind in
read order, and a younger level pointing into an older one is reached only once
the older target has been passed.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This is the obstruction behind Afshani’s dynamic fractional-cascading lower
bound &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib4" title="A lower bound for dynamic fractional cascading" class="ltx_ref"&gt;AFS21&lt;/a&gt;]&lt;/cite&gt;, sharpened from a tax to an impossibility: the bridge a
cascade needs would have to be written before its target exists. The other route,
a young level carrying a directory into the older ones, is closed not by access
but by strong materialization, each component encoding only its own samples
(&lt;a href="#S2" title="2 Preliminaries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;); &lt;a href="#A1" title="Appendix A Cascades Beyond Materialization ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;A&lt;/span&gt;&lt;/a&gt; drops that assumption. What remains is the
cost of searching one level alone.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Within a level a hash still names one specific key, while the predecessor is
another, fixed by the level’s order, that the hash of $x$ does not reach. Locating
it is a comparison search, and on a level of $m$ keys an adversarial query forces
$\Omega(\log m)$ reads, made precise against a hard gap distribution in
&lt;a href="#S4.Thmtheorem2" title="Lemma 4.2 (Zero-Side Ordered Gap). ‣ 4.2 Per-State Search Lower Bound ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S4.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="per-state-search-lower-bound"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;4.2 &lt;/span&gt;Per-State Search Lower Bound&lt;/h3&gt;
&lt;div id="S4.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Fix a time and write $\Phi(t)=\sum_{\text{active }L}\log_{2}|L|$ for the summed
log-size of the live levels. Since the per-level searches do not combine
(&lt;a href="#S4.Thmtheorem1" title="Lemma 4.1 (Causal-Bridge Obstruction). ‣ 4.1 No Cascading Across Components ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.1&lt;/span&gt;&lt;/a&gt;), the read cost is their sum. This sum is not forced at
every state: with the live levels in disjoint key ranges a single header settles
all but one. What does hold is that each size skeleton, the live levels’ sizes alone, admits
an adversarial key assignment making the sum necessary, which under an oblivious
schedule is all the lower bound needs.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem2" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 4.2&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Zero-Side Ordered Gap)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S4.Thmtheorem2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Fix stored keys $k_{1}&amp;lt;\cdots&amp;lt;k_{m}$ and handles $b&amp;lt;x$. For $0\leq j\leq m$ let $Z_{j}$
place $k_{1},\dots,k_{j}&amp;lt;b&amp;lt;x&amp;lt;k_{j+1},\dots,k_{m}$, and for $0\leq j&amp;lt;m$ let $H_{j}$ place
$k_{1},\dots,k_{j}&amp;lt;b&amp;lt;k_{j+1}&amp;lt;x&amp;lt;k_{j+2},\dots,k_{m}$, so the predecessor of $x$ is $b$ on
$Z_{j}$ and $k_{j+1}$ on $H_{j}$. Any randomized comparison tree reads $\Omega(\log(m+1))$ keys in
expectation on $Z_{J}$, $J$ uniform, if it uses the known internal order of the
$k_{r}$, learns the order of an unread key only by reading it, and errs with
probability at most $\tfrac{1}{3}$ over $\{Z_{j},H_{j}\}$.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Take a deterministic tree first. A read key has three relevant outcomes,
$k_{r}&amp;lt;b$, $b&amp;lt;k_{r}&amp;lt;x$, and $x&amp;lt;k_{r}$. Let $E_{0}$ count the zero instances not answered
$b$, $E_{1}$ the hot instances answered $b$, and $\Lambda$ the distinct $b$-leaves
reached by correctly answered zero instances. The zero instances reaching one leaf
form an interval: if $Z_{a}$ and $Z_{c}$ ($a&amp;lt;c$) share a $b$-leaf then no $k_{r}$ with
$a&amp;lt;r\leq c$ was read, being above $x$ in $Z_{a}$ and below $b$ in $Z_{c}$, so every
$H_{h}$ with $a\leq h&amp;lt;c$ follows the same transcript and is wrongly answered $b$. A
leaf covering $z$ zero instances thus forces $z-1$ hot errors, whence
$\Lambda\geq(m+1)-E_{0}-E_{1}$. Average error at most $\tfrac{5}{12}$ over the uniform
mixture of the $2m+1$ instances gives $E_{0}+E_{1}\leq\tfrac{5}{12}(2m+1)$ and
$\Lambda\geq(m+1)/6$. With one correct zero instance per leaf, at depths
$d_{1},\dots,d_{\Lambda}$, the ternary Kraft inequality $\sum_{\ell}3^{-d_{\ell}}\leq 1$
forces mean depth $\geq\log_{3}\Lambda$, so&lt;/p&gt;
&lt;table id="S4.Ex1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}_{J}[\text{reads on }Z_{J}]\ \geq\ \tfrac{\Lambda}{m+1}\log_{3}\Lambda\ =\ \Omega(\log(m+1)).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;For a randomized tree the coin-fixed error averages at most $\tfrac{1}{3}$, so by
Markov a $\tfrac{1}{5}$ fraction of the fixings have error at most $\tfrac{5}{12}$, and
averaging over them keeps $\Omega(\log(m+1))$.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem3" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 4.3&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Anchor-and-Zones Floor)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S4.Thmtheorem3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Fix a public size vector $(m_{1},\dots,m_{W})$ of an oblivious schedule and an
evaluator of error at most $\tfrac{1}{3}$. Some strongly materialized state with these
sizes admits a query $x$ on which the evaluator has
$\widehat{R}\geq c\sum_{i=1}^{W}\log_{2}(m_{i}+1)$, for an absolute $c&amp;gt;0$.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We average over a distribution of states, so some realization meets the
expectation, and obliviousness makes it carry the prescribed sizes. Take level $1$
as anchor: fix its internal order, draw the query gap uniformly among the $m_{1}$
gaps with a stored lower endpoint, and put $x$ there with $b$ that endpoint.
Locating $b$ is a randomized predecessor search among equally likely gaps, one
ternary split per read, so a bounded-error evaluator spends $\Omega(\log(m_{1}+1))$
reads, and an $O(1)$ header holds only constantly many handles and cannot help.
For $i\geq 2$ fix three private zones, a low slab below every anchor key, a high
slab above $x$, and a hot subzone inside $(b,x)$, all ordered publicly by level
index. Draw $J_{i}$ uniform in $\{0,\dots,m_{i}\}$; the zero placement puts
$k_{i,1},\dots,k_{i,J_{i}}$ in the low slab and the rest in the high slab, and the
hot alternative, when $J_{i}&amp;lt;m_{i}$, moves $k_{i,J_{i}+1}$ into the hot subzone. Expose
all outside information for free, $b$ included. Reading $k_{i,r}$ then reveals only
its zone, comparisons within the level giving the known index order and
comparisons across levels only the public zone order, so nothing finer about
$J_{i}$ is learned without reading level $i$. The task is &lt;a href="#S4.Thmtheorem2" title="Lemma 4.2 (Zero-Side Ordered Gap). ‣ 4.2 Per-State Search Lower Bound ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt; with
$m=m_{i}$ and inherits its error guarantee, costing $\Omega(\log(m_{i}+1))$. Summing
over the anchor and the levels gives the bound.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS2.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The floor is existential over the states realizing a skeleton, not a property of
every state; specialized to one read per level it is the randomized membership
floor $\widehat{R}\geq\widehat{W}/3$ of &lt;a href="#S3.Thmtheorem6" title="Theorem 3.6 (Tight Membership Bound). ‣ 3.2 The Membership Bound ‣ 3 Membership ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3.6&lt;/span&gt;&lt;/a&gt;. On the hard realization
$\widehat{R}\geq c\sum_{k}\log_{2}(m_{k}+1)\geq c\max\{\widehat{W},\Phi(t)\}$, and the separation turns
on whether a schedule can hold $\Phi$ down throughout while editing for only
$O(n\log n)$. It cannot.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S4.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="merge-history-size-diversity"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;4.3 &lt;/span&gt;Merge-History Size Diversity&lt;/h3&gt;
&lt;div id="S4.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;A logarithm above membership needs $\Phi(t)=\Omega(\log^{2}n)$ at some moment, and
no schedule holds $\Phi$ at the membership scale $O(\log n)$ throughout. The
size-diversity law prices the time-averaged potential from below by the edit
budget. It is an entropy-prefix argument on the merge forest, budget-free, the
budget entering only through the augmented depth $\widetilde{D}$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Add a dummy root above the final frontier, with $S_{v_{0}}=n$. For an internal node
$v$ write $S_{v}$ for the leaves below it, $q_{v}=S_{v}/n$, and $z_{v}=\log_{2}S_{v}$; its
children in birth order have sizes $s_{1},\dots,s_{r}$, weights $p_{i}=s_{i}/S_{v}$, entropy
$h_{v}=\sum_{i}p_{i}\log_{2}(1/p_{i})$, and &lt;em class="ltx_emph ltx_font_italic"&gt;ordered prefix load&lt;/em&gt;
$a_{v}=\sum_{j}p_{j}\sum_{i&amp;lt;j}\log_{2}s_{i}$. A merge coalesces an active suffix, so
$r\leq\widehat{W}+1$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem4" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 4.4&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Four Identities)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S4.Thmtheorem4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For every merge forest, exactly and with no budget hypothesis,&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathrm{(I)}\ \tfrac{1}{n}\!\int_{0}^{n}\!\Phi=\sum_{v}q_{v}a_{v},\quad\mathrm{(II)}\ \sum_{v}q_{v}h_{v}=L,\quad\mathrm{(III)}\ \sum_{v}q_{v}h_{v}z_{v}\geq\tfrac{1}{2}L^{2},\quad\mathrm{(IV)}\ \sum_{v}q_{v}=\widetilde{D}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS3.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For (I), read the integral as a sum over the intervals between insertions; it is
the lifetime identity $\int_{0}^{n}\Phi=\sum_{L}\tau_{L}\log_{2}|L|$, where $\tau_{L}$, the
inserts during $L$’s life, equals the mass of $L$’s younger siblings at its
parent, since a LIFO merge carries off exactly the levels younger than $L$. As
$S_{v}a_{v}=\sum_{i}(\sum_{j&amp;gt;i}s_{j})\log_{2}s_{i}=\sum_{i}\tau_{v_{i}}\log_{2}s_{i}$, summing over
$v$ and dividing by $n$ gives (I). For (II) and (III), sample a leaf uniformly and
let $Z_{0}=L&amp;gt;Z_{1}&amp;gt;\cdots\geq 0$ be the log-sizes along its root-to-leaf path, with
$X_{k}=Z_{k}-Z_{k+1}$ and $\sum_{k}X_{k}=L$. At a node $v$ on the path
$\mathbb{E}[X_{k}\mid v]=h_{v}$ and $\Pr[v\text{ on path}]=q_{v}$, giving (II); and
$\sum_{k}Z_{k}X_{k}=\tfrac{1}{2}(\sum_{k}X_{k})^{2}+\tfrac{1}{2}\sum_{k}X_{k}^{2}\geq\tfrac{1}{2}L^{2}$ with
$\mathbb{E}[Z_{k}X_{k}\mid v]=z_{v}h_{v}$, giving (III). For (IV),
$\sum_{v}q_{v}=\tfrac{1}{n}\sum_{\text{leaves}}(d_{j}+1)=\widetilde{D}$, since each leaf has
$d_{j}+1$ internal ancestors.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Identity (III) is the engine: entropy weighted by current log-size unavoidably
reaches $\Omega(L^{2})$, exactly. Turning it into a bound on (I) is a local
computation.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem5" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 4.5&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Local Prefix Bound)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S4.Thmtheorem5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Fix $\varepsilon\in(0,\tfrac{1}{4})$, $\gamma=\varepsilon^{2}$, $c_{0}=L^{-7}$, and write
$\mu=G^{-1}$ for $G(m)=(m+1)\log_{2}(m+1)-m\log_{2}m$. Uniformly over internal nodes
with $z_{v}\geq\varepsilon L$, $h_{v}\geq c_{0}$, and $r\leq n^{\gamma}+1$,&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$a_{v}\ \geq\ (1-\kappa)\,z_{v}\,\mu(h_{v}),\qquad\kappa\leq\varepsilon+o(1).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS3.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Put $\theta=(\log_{2}r+9\log_{2}L)/(\varepsilon L)$, so $\theta=\varepsilon+o(1)$
under the hypotheses. Call a child &lt;em class="ltx_emph ltx_font_italic"&gt;good&lt;/em&gt; if $p_{i}\geq 2^{-\theta z_{v}}$, so
$\log_{2}s_{i}=z_{v}+\log_{2}p_{i}\geq(1-\theta)z_{v}$. A bad child has
$p_{i}&amp;lt;2^{-\theta\varepsilon L}=(rL^{9})^{-1}$, so the bad mass is at most $L^{-9}$,
and renormalizing onto the good children shifts the entropy by $O(L^{-8})$ and
hence $\mu$ by a factor $1-o(1)$: since $(\ln\mu)^{\prime}=O(1+1/h)$ and $h_{v}\geq c_{0}$, the
shift in $\ln\mu$ is $O((1+L^{7})L^{-8})=O(L^{-1})$. The maximum-entropy bound, that
a law on $\{0,1,2,\dots\}$ of entropy $h$ has mean at least $\mu(h)$, applied to a
child drawn by $p_{j}$, gives at least $(1-o(1))\mu(h_{v})$ expected earlier good
children; each adds $\geq(1-\theta)z_{v}$ to $a_{v}$, so
$a_{v}\geq(1-\theta-o(1))z_{v}\mu(h_{v})$.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem6" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 4.6&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Size-Diversity Law)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S4.Thmtheorem6.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Every LIFO merge forest with $\widehat{W}\leq n^{\gamma}$ and $\widetilde{D}\leq L^{6}$ satisfies&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.Ex4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tfrac{1}{n}\!\int_{0}^{n}\!\Phi(t)\,dt\ \geq\ (1-\varepsilon-o(1))\,\widetilde{D}\,L\,\mu\!\Bigl(\tfrac{\beta L}{\widetilde{D}}\Bigr),\qquad\beta=\tfrac{1}{2}-\varepsilon-o(1),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;so $\max_{t}\Phi(t)$ is at least the same value.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS3.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Discard from (III) the nodes with $z_{v}&amp;lt;\varepsilon L$, contributing at most
$\varepsilon L\sum_{v}q_{v}h_{v}=\varepsilon L^{2}$ by (II), and those with $h_{v}&amp;lt;c_{0}$,
contributing at most $c_{0}L\widetilde{D}=o(L^{2})$ by (IV). The survivors have
$z_{v}\geq\varepsilon L$, $h_{v}\geq c_{0}$, $r\leq\widehat{W}+1\leq n^{\gamma}+1$, and carry
$\sum^{\mathrm{s}}q_{v}h_{v}z_{v}\geq\beta L^{2}$. Write $Y_{v}=q_{v}h_{v}z_{v}/L^{2}$, so
$m_{Y}:=\sum^{\mathrm{s}}Y_{v}\geq\beta$ and
$\sum^{\mathrm{s}}Y_{v}/h_{v}=L^{-2}\sum^{\mathrm{s}}q_{v}z_{v}\leq\widetilde{D}/L$ by (IV). Set
$\varphi(u)=u\,\mu(1/u)$, convex and decreasing, and note
$q_{v}z_{v}\mu(h_{v})=L^{2}Y_{v}\varphi(1/h_{v})$. Identity (I) and the local prefix bound
give&lt;/p&gt;
&lt;table id="S4.Ex5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tfrac{1}{nL^{2}}\!\int\!\Phi\ \geq\ (1-\kappa)\,m_{Y}\,\mathbb{E}[\varphi(1/h)],$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;the expectation under $Y/m_{Y}$. Jensen and then the monotonicity of $\varphi$ at
$\mathbb{E}[1/h]\leq\widetilde{D}/(Lm_{Y})$ give&lt;/p&gt;
&lt;table id="S4.Ex6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$m_{Y}\,\mathbb{E}[\varphi(1/h)]\ \geq\ m_{Y}\,\varphi\!\Bigl(\tfrac{\widetilde{D}}{Lm_{Y}}\Bigr)\ =\ \tfrac{\widetilde{D}}{L}\,\mu\!\Bigl(\tfrac{m_{Y}L}{\widetilde{D}}\Bigr)\ \geq\ \tfrac{\widetilde{D}}{L}\,\mu\!\Bigl(\tfrac{\beta L}{\widetilde{D}}\Bigr),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;using $m_{Y}\geq\beta$ and $\mu$ increasing. Multiply by $L^{2}$.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS3.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The frontier cap is necessary for the law, since the never-merge schedule has
$\Phi\equiv 0$, but it does not constrain the predecessor bound: the assembly below
routes wide-frontier executions through the read floors instead. The cap aside,
the law is the right general form rather than a relaxation, asymptotically tight
along the lazy base-$q$ counter, so the uniform reading $\max_{t}\Phi\geq c\log^{2}n$
for all schedules is false, that family sending $\max_{t}\Phi/\log^{2}n\to 0$ as $q$
grows. Since $\Phi$ depends only on the forest, the bound holds for every
realization of a randomized algorithm.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem7" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 4.7&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Calculus Floor)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S4.Thmtheorem7.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;$\min_{h&amp;gt;0}\mu(h)/h^{2}=\tfrac{1}{4}$&lt;span class="ltx_text ltx_font_italic"&gt;, attained only at $h=2$; equivalently
$G(m)\leq 2\sqrt{m}$ with equality iff $m=1$. Hence
$\widetilde{D}^{2}\,\mu(\beta L/\widetilde{D})\geq(\beta^{2}/4)L^{2}$.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS3.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Substituting $m=\mu(h)$, the claim $\mu(h)\geq h^{2}/4$ reads $G(m)\leq 2\sqrt{m}$. Let
$F(m)=2\sqrt{m}-G(m)$, so $F(0^{+})=F(1)=0$ and $F^{\prime}(m)=m^{-1/2}-\log_{2}(1+1/m)$, of the
sign of $1-u(m)$ for $u(m)=\sqrt{m}\,\log_{2}(1+1/m)$. Here $u$ is unimodal, with
$u^{\prime}(m)=0$ at a single point since $(1+1/m)^{m+1}$ decreases strictly to $e$, and
with $u\to 0$ at both ends and $u(1)=1$ it exceeds $1$ on exactly one interval
$(m_{1},1)$. So $F$ rises on $(0,m_{1})$, returns to $F(1)=0$, then rises, giving
$F\geq 0$ with equality only at $m\in\{0,1\}$. The lone interior contact $m=1$ gives
$h=G(1)=2$ and $\mu(2)=1$, so the minimum is $\tfrac{1}{4}$; substituting
$h=\beta L/\widetilde{D}$ gives the last inequality.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S4.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-predecessor-bound"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;4.4 &lt;/span&gt;The Predecessor Bound&lt;/h3&gt;
&lt;div id="S4.Thmtheorem8" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 4.8&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Tight Predecessor Bound)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S4.Thmtheorem8.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Every strongly materialized algorithm with a bounded-error evaluator, under no
hypothesis on the frontier $\widehat{W}$ or the budget $M$, has predecessor
$E\widehat{R}=\Omega(n\log^{3}n)$, which binary Bentley–Saxe attains. Predecessor is
$\Theta(n\log^{3}n)$, one clean logarithm above membership.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The upper bound is &lt;a href="#S2.Thmtheorem3" title="Proposition 2.3 (Bentley–Saxe Baseline). ‣ 2.6 Baseline Upper Bounds ‣ 2 Preliminaries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt;. Fix the algorithm; its oblivious schedule
fixes the size trajectory and $E$ independently of the keys. Fix
$\varepsilon=10^{-2}$, $\gamma=\varepsilon^{2}$, $\widetilde{D}=(M+n)/n$, and split on the
schedule.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;(i) $\widehat{W}&amp;gt;n^{\gamma}$.&lt;/em&gt; &lt;a href="#S4.Thmtheorem3" title="Lemma 4.3 (Anchor-and-Zones Floor). ‣ 4.2 Per-State Search Lower Bound ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.3&lt;/span&gt;&lt;/a&gt; at a maximum-frontier skeleton
gives $\widehat{R}=\Omega(\widehat{W})&amp;gt;\Omega(n^{\gamma})$, and $E\geq n$, so
$E\widehat{R}=\Omega(n^{1+\gamma})\gg n\log^{3}n$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;(ii) $\widehat{W}\leq n^{\gamma}$, $\widetilde{D}&amp;gt;L^{6}$.&lt;/em&gt; The edit floor gives
$E=\Omega(n\widetilde{D})&amp;gt;\Omega(nL^{6})$ and &lt;a href="#S4.Thmtheorem3" title="Lemma 4.3 (Anchor-and-Zones Floor). ‣ 4.2 Per-State Search Lower Bound ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.3&lt;/span&gt;&lt;/a&gt; at the final skeleton,
where $\sum_{k}\log_{2}(m_{k}+1)\geq\log_{2}(n+1)$, gives $\widehat{R}=\Omega(L)$, so
$E\widehat{R}=\Omega(nL^{7})\gg n\log^{3}n$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS4.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;em class="ltx_emph ltx_font_italic"&gt;(iii) $\widehat{W}\leq n^{\gamma}$, $\widetilde{D}\leq L^{6}$.&lt;/em&gt; The size-diversity law gives a
time $t^{\star}$ with $\Phi(t^{\star})\geq(1-\varepsilon-o(1))\widetilde{D}L\,\mu(\beta L/\widetilde{D})$;
&lt;a href="#S4.Thmtheorem3" title="Lemma 4.3 (Anchor-and-Zones Floor). ‣ 4.2 Per-State Search Lower Bound ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.3&lt;/span&gt;&lt;/a&gt; there gives $\widehat{R}=\Omega(\Phi(t^{\star}))$, the edit floor
gives $E=\Omega(n\widetilde{D})$, and the calculus floor closes it:&lt;/p&gt;
&lt;table id="S4.Ex7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$E\widehat{R}\ \geq\ \Omega\bigl(nL\cdot\widetilde{D}^{2}\mu(\beta L/\widetilde{D})\bigr)\ \geq\ \Omega\bigl(\tfrac{\beta^{2}}{4}\,nL^{3}\bigr)=\Omega(nL^{3}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The cases are exhaustive. Obliviousness makes the size trajectory the same on
every input, so the skeleton each case invokes occurs along the execution, and
&lt;a href="#S4.Thmtheorem3" title="Lemma 4.3 (Anchor-and-Zones Floor). ‣ 4.2 Per-State Search Lower Bound ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.3&lt;/span&gt;&lt;/a&gt; exhibits a hard realization there; the product is the
algorithm’s worst case over inputs, in expectation over its coins.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS4.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The bound $\widehat{R}\geq\widehat{W}$ alone yields only $n\log^{2}n$, one logarithm short;
the extra logarithm needs $\widehat{R}=\Omega(\Phi)$ at a high-$\Phi$ time, which the
size-diversity law supplies. Predecessor pays for size diversity, not merely
frontier width: membership is priced by $\widehat{W}$, order by $\Phi$.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S4.SS5" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="extensions-to-rank-and-range-queries"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;4.5 &lt;/span&gt;Extensions to Rank and Range Queries&lt;/h3&gt;
&lt;div id="S4.SS5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Predecessor is one order query among many. Whether a decomposable query pays the
extra logarithm is read off the combiner, from how much of a single block’s
contribution can reach the global answer, and for natural exact queries this takes
one of two sizes. It is $O(1)$ when an $O(1)$-read witness settles a block’s
contribution, as for membership, point-emptiness, and the global minimum or
maximum. It is $\Theta(\log m)$ when the contribution turns on $q$’s position
among a block’s $m$ sorted keys, as for predecessor, successor, rank, range-count,
range-sum, range-minimum, range-maximum, and bounded-interval emptiness. The bridge
to a read floor in the second case is a per-level direct sum, supplied for
predecessor and successor by &lt;a href="#S4.Thmtheorem3" title="Lemma 4.3 (Anchor-and-Zones Floor). ‣ 4.2 Per-State Search Lower Bound ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.3&lt;/span&gt;&lt;/a&gt; and for the rest by the two
lemmas below.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS5.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Call $Q$ &lt;em class="ltx_emph ltx_font_italic"&gt;additive&lt;/em&gt; if $Q(S,q)=\sum_{k}\varphi(L_{k},q)$ in an abelian group,
each contribution $\varphi(B,q)$ a function of $q$’s position in $B$; rank,
range-count, and unit-weight range-sum qualify. Let $g_{Q}(m)$ be the worst-case
reads to compute $\varphi(B,q)$ on one static block of $m$ samples under a hard
distribution $\mathcal{D}_{m}$, and call the family $\{\mathcal{D}_{m}\}$
&lt;em class="ltx_emph ltx_font_italic"&gt;embeddable&lt;/em&gt; when every active size vector is realized by independent private
blocks and one shared query whose marginal at level $i$ is $\mathcal{D}_{m_{i}}$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem9" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 4.9&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Additive Direct Sum)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S4.Thmtheorem9.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For an additive $Q$ with an embeddable hard family of per-level complexity $g_{Q}$
under an oblivious schedule, the hard realization at time $t$ forces
$\widehat{R}_{Q}\geq\Omega\bigl(\sum_{k}g_{Q}(m_{k})\bigr)$, deterministically and, with $g_{Q}$
the randomized static complexity, against bounded-error evaluators.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS5.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Draw the embedded product instance and fix a level $i$. Run the evaluator from
$B_{i}$’s draw alone, charging its reads inside $L_{i}$ and answering each read outside
$L_{i}$ for free from a block drawn on independent coins from its law given $q$,
which strong materialization and no-cascade make independent of $B_{i}$. The
evaluator returns $Q(S,q)$, and subtracting the $\sum_{j\neq i}\varphi(L_{j},q)$ just
sampled leaves $\varphi(L_{i},q)$ by the group inverse. This is a single-block
evaluator for $\mathcal{D}_{m_{i}}$ whose outside answers are advice independent of
$B_{i}$, so it cannot read $L_{i}$ below the static floor $g_{Q}(m_{i})$. The blocks are
disjoint, so the reads sum.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS5.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For abstract keys $g_{Q}(m)=\Theta(\log(m+1))$: computing $q$’s position in a block
is the comparison search of &lt;a href="#S4.Thmtheorem2" title="Lemma 4.2 (Zero-Side Ordered Gap). ‣ 4.2 Per-State Search Lower Bound ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt;, and a balanced tree matches it.
The lemma then gives $\widehat{R}_{Q}\geq c\sum_{k}\log_{2}(m_{k}+1)$ for rank, range-count, and
unit-weight range-sum, the floor predecessor pays; &lt;a href="#S6" title="6 Static-to-Dynamic Lifting ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt; reuses it
with the integer and two-dimensional complexities.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem10" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 4.10&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Idempotent Direct Sum)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S4.Thmtheorem10.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Fix a public size vector of an oblivious schedule and a bounded-error evaluator.
For bounded-interval emptiness, range-minimum, and range-maximum, each with a
fixed empty-interval default, some strongly materialized state with these sizes admits an interval $I$, empty
in every level, on which the evaluator has $\widehat{R}_{Q}\geq c\sum_{i}\log_{2}(m_{i}+1)$, for
an absolute $c&amp;gt;0$.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS5.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Give each level $i$ a low slab below $I$, a high slab above $I$, and a hot
subinterval inside $I$, the zones disjoint and ordered publicly by level index.
Draw $J_{i}$ uniform in $\{0,\dots,m_{i}\}$, placing the first $J_{i}$ keys of level $i$
in its low slab and the rest in its high slab, so $I$ holds no key and $Q$ returns
its default; the hot alternative, when $J_{i}&amp;lt;m_{i}$, moves $k_{i,J_{i}+1}$ into the hot
subinterval, making $I$ nonempty and changing the answer while every other
encoding stays fixed. Expose every level but $i$ in its empty state for free;
deciding the global answer is then deciding whether level $i$ leaves $I$ empty,
the task of &lt;a href="#S4.Thmtheorem2" title="Lemma 4.2 (Zero-Side Ordered Gap). ‣ 4.2 Per-State Search Lower Bound ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.2&lt;/span&gt;&lt;/a&gt; with $m=m_{i}$ and the endpoints of $I$ as the two
handles, at $\Omega(\log(m_{i}+1))$ reads. By no-cascade, reads elsewhere do not help,
the per-level costs sum, and some all-empty realization meets the bound.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem11" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 4.11&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Order/Range Dichotomy)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S4.Thmtheorem11.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;A decomposable query has $E\widehat{R}_{Q}=\Theta(n\log^{2}n)$ when an $O(1)$-read per-level
certificate settles it and some unread live level can change its answer, as with
membership, point-emptiness, and the global extrema. When instead a level’s
contribution turns on $q$’s position among its keys, as for predecessor and
successor, the additive rank, range-count, and range-sum, and the idempotent
range-minimum, range-maximum, and bounded-interval emptiness, the cost is
$E\widehat{R}_{Q}=\Theta(n\log^{3}n)$, with no hypothesis on frontier or budget.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S4.SS5.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;On the cheap side an $O(1)$-read witness per level answers $Q$ in
$\widehat{R}=O(W)=O(\log n)$, hence $E\widehat{R}=O(n\log^{2}n)$, matched below by the
membership floor of &lt;a href="#S3" title="3 Membership ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;, whose argument needs only that an unread
live level can flip the answer. On the order-localizing side the direct sums give
$\widehat{R}_{Q}\geq c\sum_{k}\log_{2}(m_{k}+1)\geq c\max\{\widehat{W},\Phi(t)\}$ on the hard skeleton,
predecessor’s own floor: &lt;a href="#S4.Thmtheorem3" title="Lemma 4.3 (Anchor-and-Zones Floor). ‣ 4.2 Per-State Search Lower Bound ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.3&lt;/span&gt;&lt;/a&gt; for predecessor and, reversing the
order, successor; &lt;a href="#S4.Thmtheorem9" title="Lemma 4.9 (Additive Direct Sum). ‣ 4.5 Extensions to Rank and Range Queries ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.9&lt;/span&gt;&lt;/a&gt; for rank, range-count, and unit-weight
range-sum; and &lt;a href="#S4.Thmtheorem10" title="Lemma 4.10 (Idempotent Direct Sum). ‣ 4.5 Extensions to Rank and Range Queries ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.10&lt;/span&gt;&lt;/a&gt; for the idempotent range queries, where an
empty query interval keeps every level pivotal. The three-case assembly of
&lt;a href="#S4.Thmtheorem8" title="Theorem 4.8 (Tight Predecessor Bound). ‣ 4.4 The Predecessor Bound ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.8&lt;/span&gt;&lt;/a&gt; then gives $\Omega(n\log^{3}n)$, attained by binary
Bentley–Saxe carrying the matching static structure, a balanced tree with subtree
counts, prefix sums, or subtree extrema, at $O(\log m_{k})$ reads per level.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS5.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The line is hashing against within-level order localization: membership and
point-emptiness fall to a hash and the global extrema to one stored value per
level, all staying at the membership scale, while predecessor, successor, rank,
and the range queries turn on $q$’s position in each block and pay the logarithm.
Total count is cheaper still, fixed by the public size sequence at $\Theta(n)$ and
lying outside the trichotomy. What the logarithm buys is exactness of the order. The idempotent range queries
carry no group inverse, yet an empty interval makes
every level pivotal, a single hidden key overturning the empty default
(&lt;a href="#S4.Thmtheorem10" title="Lemma 4.10 (Idempotent Direct Sum). ‣ 4.5 Extensions to Rank and Range Queries ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.10&lt;/span&gt;&lt;/a&gt;). The logarithm is specific to abstract keys, and integer
keys shrink it (&lt;a href="#S7" title="7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.Thmtheorem12" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Remark 4.12&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S4.Thmtheorem12.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Approximation refunds the logarithm. A constant additive error $\pm\varepsilon n$
in rank or range-count, or a constant-precision quantile, separates only $O(1)$
buckets and returns the query to $\Theta(n\log^{2}n)$; a multiplicative error keeps
the $\Theta(\log n)$ scales and does not.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S5" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="select"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;5 &lt;/span&gt;Select&lt;/h2&gt;
&lt;div id="S5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Select proves the third line of &lt;a href="#S1.Thmtheorem1" title="Theorem 1.1 (Main Classification). ‣ 1.1 Our Results ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.1&lt;/span&gt;&lt;/a&gt;. Rank is a key-to-count query: the
query names a key, and each component contributes a count. Select is the inverse,
count-to-key query: the query names only a rank $K$. In a one-way scan the key
that will become the answer is not known while the early components are being
read, and those components cannot be revisited once later components reveal the
threshold. The proof first turns this target-free difficulty into a cut lower
bound, and then shows that any structure with small read cost must repeatedly
rebuild a large component.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S5.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-cut-lower-bound"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.1 &lt;/span&gt;The Cut Lower Bound&lt;/h3&gt;
&lt;div id="S5.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Comparisons among keys already read are free, so the lower bound is on token reads
and the adversary attacks the unread keys. Two lemmas carry it: a bound on what a
single read can learn, and a cut floor built from it.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.Thmtheorem1" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 5.1&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Layout Channel)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S5.Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Fix the query $q$, its coins $\rho$, and the data-independent initial
configuration $\sigma_{0}$. Condition on the public layout $G$, the size sequence
together with the boundaries and addresses it determines. Let $X$ be the
stored keys and values. For one run of the forward head let $T$ be its number of
charged reads and $\Pi$ its transcript, the words it reads together with its
working memory. Then&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.Ex1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$I(X;\Pi\mid G,q,\rho,\sigma_{0})\ \leq\ b\,\mathbb{E}[T\mid G,q,\rho,\sigma_{0}]\ =\ O\bigl(\mathbb{E}[T]\log n\bigr),\qquad b=\Theta(\log n).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S5.SS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Assume $\mathbb{E}[T]&amp;lt;\infty$, the bound being vacuous otherwise, and condition
throughout on $G,q,\rho,\sigma_{0}$. Record the $k$-th read as $V_{k}=(A_{k},Y_{k})$ when
$T\geq k$ and $V_{k}=\bot$ otherwise, where $A_{k}$ is the address read and $Y_{k}$ the
returned word together with the rank of its handle among those already read. A
query reads at most the $O(n)$ live tokens, so that rank fits in $O(\log n)$ bits
and $Y_{k}$ carries $b=\Theta(\log n)$ bits. The head is deterministic given the
conditioning and the reads so far, so $\{T\geq k\}$ is a function of
$V_{1},\dots,V_{k-1}$, and on that event so is $A_{k}$, by &lt;a href="#S2.Thmtheorem1" title="Definition 2.1 (Strong Materialization). ‣ 2.4 Key Models and Materialization ‣ 2 Preliminaries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Definition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.1&lt;/span&gt;&lt;/a&gt;; hence
$I(X;A_{k}\mid V_{&amp;lt;k})=0$ and&lt;/p&gt;
&lt;table id="S5.Ex2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$I(X;V_{k}\mid V_{&amp;lt;k})\ \leq\ H(Y_{k}\mid V_{&amp;lt;k},A_{k})\ \leq\ b.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Since $V_{k}=\bot$ when $T&amp;lt;k$, chain rule over $k\leq K$ gives
$I(X;V_{1},\dots,V_{K})\leq b\,\mathbb{E}[\min\{T,K\}]$, and $K\to\infty$ gives
$I(X;V^{\infty})\leq b\,\mathbb{E}[T]$. The transcript $\Pi$ is a function of the
conditioning and $V^{\infty}$ by the no-external-state clause, so data processing
closes it.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.SS1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For a randomized evaluator the coins $\rho$ are independent of the data, so the
bound holds with $\Pi$ replaced by $(\Pi,\rho)$ and averaged over $\rho$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.Thmtheorem2" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 5.2&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Cut Floor)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S5.Thmtheorem2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;At a boundary between two active levels holding $P$ samples before it and $U$
after, with $r=\min\{P,U\}$, some input family with the fixed rank $K=r$ forces
every bounded-error forward evaluator to read $\Omega(r)$ words before the head
crosses the boundary. Hence $\widehat{R}(t)\geq c\min\{P,U\}$ for an absolute $c&amp;gt;0$.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S5.SS1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Place $r$ disjoint rank slabs $S_{1}&amp;lt;\cdots&amp;lt;S_{r}$ in the prefix, separated by fixed
guards, each slab a public range of $Q=\mathrm{poly}(n)$ candidate positions. Draw
$a_{i}$ uniformly and independently from $S_{i}$ and let $Z_{i}$ name which candidate it
is, so the $a_{i}$ carry $\Theta(\log n)$ independent bits while their order is fixed
by the slabs; put the remaining $P-r$ prefix keys in a guard above $S_{r}$. The
suffix encodes an index $j$: place $r-j$ of its keys in a guard below $S_{1}$ and the
rest in a guard above every slab. Then exactly $r-j$ suffix keys and the $j-1$
slab keys $a_{1},\dots,a_{j-1}$ lie below $a_{j}$, so $a_{j}$ is the $r$-th smallest of
the union, while the prefix and the rank $K=r$ are the same for every $j$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS1.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Draw $J$ uniform on $\{1,\dots,r\}$, independent of $Z=(Z_{1},\dots,Z_{r})$, and let
$\Pi$ be the transcript and coins at the crossing. The prefix is read before the
crossing and does not depend on $J$, so $(Z,\Pi)$ is independent of $J$, while the
suffix determines $J$ and carries nothing about $Z$. A correct answer is $a_{J}$,
which the head must decode from $\Pi$ and $J$ since it cannot return to the prefix;
so by Fano $I(Z_{j};\Pi\mid J=j)=\Omega(\log Q)$, equal to $I(Z_{j};\Pi)$ by that
independence. As the $Z_{i}$ are independent,
$I(Z;\Pi)\geq\sum_{i}I(Z_{i};\Pi)=\Omega(r\log n)$. Since $Z$ is a function of $X$ and
$\Pi$ records the $T$ prefix reads, &lt;a href="#S5.Thmtheorem1" title="Lemma 5.1 (Layout Channel). ‣ 5.1 The Cut Lower Bound ‣ 5 Select ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.1&lt;/span&gt;&lt;/a&gt; gives
$\Omega(r\log n)\leq I(X;\Pi)\leq O(\mathbb{E}[T]\log n)$, whence $\mathbb{E}[T]=\Omega(r)$ and $\widehat{R}(t)\geq\mathbb{E}[T]=\Omega(r)$.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.SS1.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The guards keep the suffix clear of $Z$: its keys sit in fixed slabs, never at a
data-dependent value such as $a_{1}-1$, so reading them reveals only $j$. The floor
rests on a single boundary rather than a sum over levels, but that is enough: a
low read cost forces almost all the live mass into one level, and building such a
level again and again is the write cost select cannot escape.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S5.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="the-quadratic-product-bound"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.2 &lt;/span&gt;The Quadratic Product Bound&lt;/h3&gt;
&lt;div id="S5.Thmtheorem3" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 5.3&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Quadratic Select Bound)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S5.Thmtheorem3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Strongly materialized select has $\min E\widehat{R}=\Theta(n^{2})$, with no hypothesis on
the frontier or the budget, and the lower bound holds against bounded-error query
randomization.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S5.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Write $R=\widehat{R}$ and $s=R/c$ with $c$ the constant of &lt;a href="#S5.Thmtheorem2" title="Lemma 5.2 (Cut Floor). ‣ 5.1 The Cut Lower Bound ‣ 5 Select ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5.2&lt;/span&gt;&lt;/a&gt;. The live
mass at time $t$ is $t$, and at every boundary $\min\{P,U\}\leq R/c=s$, so each
boundary mass is $\leq s$ or $\geq t-s$ and the level spanning $(s,t-s)$ has size
$\geq t-2s$. Suppose $R&amp;lt;cn/8$, so $s&amp;lt;n/8$ and this level exceeds $n/4$ throughout
$t\in[n/2,n]$. Take times $t_{0}&amp;lt;\cdots&amp;lt;t_{K}$ spaced by $\Delta=\lceil 2s\rceil+1$
across $[n/2,n]$, so $K=\Omega(n/(R+1))$, and let $B_{i}$ be such a level at $t_{i}$.
Being materialized, $B_{i}$ is static after birth, so $|B_{i}|\leq t_{i}$, while
$|B_{i+1}|\geq t_{i+1}-2s&amp;gt;t_{i}\geq|B_{i}|$; the $B_{i}$ are therefore distinct components,
each costing $\Omega(n)$ tokens. Hence $E=\Omega(n^{2}/(R+1))$, and as $R\geq 1$,
$E\widehat{R}=\Omega(n^{2})$. If instead $R\geq cn/8$, then $E\geq n$ gives
$E\widehat{R}\geq nR=\Omega(n^{2})$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For the upper bound, keep one large level together with a suffix of at most $s$
singletons, merging the whole stack into a fresh large level every $s$ inserts.
Rebuilding the large level at sizes $s,2s,\dots,n$ costs $E=\Theta(n^{2}/s)$. The large
level is a sorted array at the bottom of the stack, so the head jumps by a computed
offset to its rank window $[K-s,K]$, reads those $O(s)$ keys and the $\leq s$
singletons above it, and selects the global $K$-th among these candidates; the
suffix shifts the answer’s rank in the large level by at most $s$, so the window
holds it, and $\widehat{R}=O(s)$. The product is $\Theta(n^{2})$ at every $s$.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.SS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The three query classes now stand in a line, governed by what the query hands the
forward head:&lt;/p&gt;
&lt;table id="S5.Ex3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\underbrace{\Theta(n\log^{2}n)}_{\text{hashable witness}}\ &amp;lt;\ \underbrace{\Theta(n\log^{3}n)}_{\text{known key value}}\ \ll\ \underbrace{\Theta(n^{2})}_{\text{rank, no value}}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The first gap is one logarithm, order against hashing; the second is a polynomial. Rank and select are inverse operations, value to count and
count to value, and select’s answer is itself only $O(\log n)$ bits, yet the two
lie polynomially apart: the gap is made by the access discipline, not by the
information in the answer. Select gives the head no value to aim at, and that is
what carries it past predecessor. The cost is a property of the forward head, not of
the key model, since the lower bound forces its reads by completing cells the head
has not visited and never inspects a key’s representation; it therefore persists
for integer keys, where the word-RAM that narrows the order gap (&lt;a href="#S7" title="7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;)
still leaves select at $\Theta(n^{2})$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.Thmtheorem4" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Remark 5.4&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S5.Thmtheorem4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Constant-precision approximate select returns to $\Theta(n\log^{2}n)$: $O(1)$
samples at evenly spaced ranks per level form a forward quantile sketch that needs
no refinement of the exact threshold. Exactness is again what the cost buys.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.Thmtheorem5" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Remark 5.5&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S5.Thmtheorem5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;A cross-level rank catalog would answer select in $O(1)$ reads, but maintaining one
under LIFO appears to cost $\Omega(n^{2})$ edits, which would carry the $\Theta(n^{2})$
past strong materialization, as &lt;a href="#A1" title="Appendix A Cascades Beyond Materialization ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;A&lt;/span&gt;&lt;/a&gt; carries the predecessor bound. We
do not pursue this here.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S6" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="static-to-dynamic-lifting"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;6 &lt;/span&gt;Static-to-Dynamic Lifting&lt;/h2&gt;
&lt;div id="S6.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Every query that pays the order logarithm lands at the same $n\log^{3}n$, and a
single reduction explains why. Each pays, per level, the static cost of locating
the query there; the model forbids sharing those costs across levels, so the read
cost is their sum. For an additive query this turns the dynamization optimum into
the edit budget times a sum of static per-level complexities, a dynamic lower bound
read off a static one. The logarithm of order is then no artifact of maintenance
but the faithful lift of a static search cost.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Recall the additive queries of &lt;a href="#S4" title="4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;: $Q(S,q)=\sum_{k}\varphi(L_{k},q)$ in
an abelian group, with per-level static complexity $g_{Q}(m)$, the reads to compute
one block’s contribution $\varphi(B,q)$, and embeddable hard families that plant an
independent
instance in every level (&lt;a href="#S4.Thmtheorem9" title="Lemma 4.9 (Additive Direct Sum). ‣ 4.5 Extensions to Rank and Range Queries ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.9&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.Thmtheorem1" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 6.1&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Static-to-Dynamic Lifting)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S6.Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $Q$ be additive with an embeddable hard family and per-level static complexity
$g_{Q}$: a forward-readable static structure attains $O(g_{Q}(m))$ reads on a block of
$m$ samples, and the hard family forces $\Omega(g_{Q}(m))$. Suppose $g_{Q}$ is
nondecreasing with $g_{Q}(1)\geq 1$ and of linear rate $g_{Q}(2^{k})\geq\zeta_{Q}k$ for some
$\zeta_{Q}\in(0,1]$, and $\Sigma_{Q}:=\sum_{k=0}^{L}g_{Q}(2^{k})=\Theta(\zeta_{Q}L^{2})$. Then
every strongly materialized algorithm with a bounded-error evaluator has
$E\widehat{R}_{Q}=\Omega(nL\,\Sigma_{Q})$, which binary Bentley–Saxe attains, so
$\min E\widehat{R}_{Q}=\Theta(nL\,\Sigma_{Q})$.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S6.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For the upper bound, the schedule of &lt;a href="#S2.Thmtheorem3" title="Proposition 2.3 (Bentley–Saxe Baseline). ‣ 2.6 Baseline Upper Bounds ‣ 2 Preliminaries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt; carries that static
structure at each level, a balanced search tree with subtree aggregates for the
additive queries. Then $E=O(nL)$, and the active sizes being distinct powers of
two, $\widehat{R}=\sum_{\text{active}}g_{Q}(m_{k})\leq\Sigma_{Q}$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For the lower bound, &lt;a href="#S4.Thmtheorem9" title="Lemma 4.9 (Additive Direct Sum). ‣ 4.5 Extensions to Rank and Range Queries ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.9&lt;/span&gt;&lt;/a&gt; gives
$\widehat{R}_{Q}(t)=\Omega(\sum_{k}g_{Q}(m_{k}))$; the linear rate and the floor $g_{Q}(1)\geq 1$
make $g_{Q}(m)=\Omega(\zeta_{Q}\log_{2}(m+1))$, so
$\widehat{R}_{Q}(t)=\Omega(\zeta_{Q}\sum_{k}\log_{2}(m_{k}+1))$. Since $\sum_{k}\log_{2}(m_{k}+1)$ is at
least $\max\{W(t),\Phi(t)\}$ at all times and at least $\log_{2}(n+1)$ at the final
skeleton, this is the read floor of &lt;a href="#S4.Thmtheorem8" title="Theorem 4.8 (Tight Predecessor Bound). ‣ 4.4 The Predecessor Bound ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.8&lt;/span&gt;&lt;/a&gt; scaled by $\zeta_{Q}$. Its
three-case assembly then applies: the wide-frontier and deep cases exceed
$nL\,\Sigma_{Q}$, while the size-diversity case multiplies $E=\Omega(n\widetilde{D})$ by
$\widehat{R}_{Q}=\Omega(\zeta_{Q}\Phi(t^{\star}))$ and closes with the calculus floor, giving
$E\widehat{R}_{Q}=\Omega(\zeta_{Q}nL^{3})$. By $\Sigma_{Q}=\Theta(\zeta_{Q}L^{2})$ this is
$\Omega(nL\,\Sigma_{Q})$.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S6.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The middle row of the dichotomy is now one line: abstract-key rank, range-count,
and range-sum have $g_{Q}(m)=\Theta(\log(m+1))$, hence $\zeta_{Q}=\Theta(1)$,
$\Sigma_{Q}=\Theta(L^{2})$, and $E\widehat{R}_{Q}=\Theta(nL^{3})$. Beyond recovering the additive
row of &lt;a href="#S4.Thmtheorem11" title="Theorem 4.11 (Order/Range Dichotomy). ‣ 4.5 Extensions to Rank and Range Queries ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.11&lt;/span&gt;&lt;/a&gt;, the lift names the structure of the cost. The read
bound is a sum of per-level static search complexities, one term per live level,
because maintenance does not inflate a single level and cascading cannot amortize
across them. That this sum cannot stay below $L^{2}$ is the size-diversity of
&lt;a href="#S4" title="4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;: that section forces the sum up to $L^{2}$, and this one explains why
the cost is that sum to begin with. The two are the lower-bound face and the
structural face of the same $n\log^{3}n$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.Thmtheorem2" class="ltx_theorem ltx_theorem_remark"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Remark 6.2&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_italic"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S6.Thmtheorem2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Because $g_{Q}$ is a static complexity, the lift inherits its robustness. Integer keys
shrink the per-level cost and carry rank, range-count, and range-sum to
$\Theta(n\log^{2}n\,\lambda)$, while in two dimensions the separation survives the
word-RAM, with range-counting lifting to $\Theta(n\log^{3}n/\lambda)$ and no van Emde
Boas collapse. Both are taken up in &lt;a href="#S7" title="7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;; the integer bounds there are
deterministic and Las Vegas cell-probe bounds, and a bounded-error version would
need a randomized static one. Integer predecessor, not an additive
query, stays open between $1$ and $\lambda$.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S7" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="access-model-variants"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;7 &lt;/span&gt;Access-Model Variants&lt;/h2&gt;
&lt;div id="S7.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The classification of &lt;a href="#S1.Thmtheorem1" title="Theorem 1.1 (Main Classification). ‣ 1.1 Our Results ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;1.1&lt;/span&gt;&lt;/a&gt; is stated for abstract keys, strong
materialization, and one-way scans. This section records what happens when one
restriction at a time is relaxed. These variants are not needed for the main
lower bounds; their role is to identify which assumption supports which
separation. Integer keys reduce the cost of searching inside one component,
random access removes the no-backseek obstruction for select, and
non-materialized cascade data can remove the abstract-key predecessor gap only
when it can be placed in the right scan direction.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S7.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="integer-keys"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;7.1 &lt;/span&gt;Integer Keys&lt;/h3&gt;
&lt;div id="S7.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The order logarithm is a property of abstract keys. An integer key in a
$\mathrm{poly}(n)$ universe is searchable by the word-RAM: a y-fast
trie &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib10" title="Log-logarithmic worst-case range queries are possible in space ⁢Θ(N)" class="ltx_ref"&gt;WIL83&lt;/a&gt;]&lt;/cite&gt; finds a run’s predecessor in $O(\lambda)$ reads and a
fusion tree &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib11" title="Surpassing the information theoretic bound with fusion trees" class="ltx_ref"&gt;FW93&lt;/a&gt;]&lt;/cite&gt; in $O(\log_{w}m)$, both forward-readable under
the round-by-round layout of &lt;a href="#S2.Thmtheorem3" title="Proposition 2.3 (Bentley–Saxe Baseline). ‣ 2.6 Baseline Upper Bounds ‣ 2 Preliminaries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;2.3&lt;/span&gt;&lt;/a&gt;. Predecessor then costs
$O(n\log^{2}n\,\lambda)$, its gap over membership shrinking from $\log n$ to
$\lambda$, the way radix sort undercuts the comparison-sorting bound without
refuting it.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.SS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The collapse is not uniform, and the reason is what makes abstract keys hard. An
additive query reads a contribution from every run, so each must still be searched,
now at integer cost: a rank among $m$ integers is a predecessor search of static
complexity $g_{Q}(m)=\Theta(\max\{1,\min\{\log_{w}m,\lambda\}\})$, the y-fast or fusion layout
above, matched from below by Pătraşcu and
Thorup &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib8" title="Time-space trade-offs for predecessor search" class="ltx_ref"&gt;PT06&lt;/a&gt;, &lt;a href="#bib.bib9" title="Randomization does not help searching predecessors" class="ltx_ref"&gt;PT07&lt;/a&gt;]&lt;/cite&gt;, deterministic and Las Vegas
alike. Its binary sum is $\Sigma_{Q}=\Theta(L\lambda)$, so &lt;a href="#S6.Thmtheorem1" title="Theorem 6.1 (Static-to-Dynamic Lifting). ‣ 6 Static-to-Dynamic Lifting ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Theorem&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;6.1&lt;/span&gt;&lt;/a&gt; places
rank, range-count, and range-sum at $\Theta(n\log^{2}n\,\lambda)$, exactly
$\Theta(\lambda)$ above membership.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.SS1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Predecessor behaves differently, because it is settled by one run and the rest need
only be ruled out. Ruling run $i$ out asks whether its keys meet the open interval
between the running best and the query, a range-emptiness test the word-RAM answers
in $O(1)$ &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib12" title="Optimal static range reporting in one dimension" class="ltx_ref"&gt;ABR01&lt;/a&gt;]&lt;/cite&gt; but abstract keys answer only by localizing the query
inside the run, the $\Omega(\log m)$ step behind the separation. The per-run floor
the additive queries enjoy has no integer counterpart here, so the exact integer
cost of predecessor stays open between $\Theta(n\log^{2}n)$ and
$\Theta(n\log^{2}n\,\lambda)$: a lower bound would need a per-run test that stays
$\Omega(\lambda)$-hard under a shared query, and the natural one, whether a run
holds the global predecessor, is the range-emptiness integers trivialize. The key
models part exactly here.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.SS1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The collapse is one-dimensional. Two-dimensional range-counting has no van Emde
Boas speedup, its cell-probe complexity $\Omega(\log m/\lambda)$ at linear
space &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib13" title="Lower bounds for 2-dimensional range counting" class="ltx_ref"&gt;PĂT07&lt;/a&gt;]&lt;/cite&gt; matched by a range tree &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib14" title="Adaptive and approximate orthogonal range counting" class="ltx_ref"&gt;CW13&lt;/a&gt;]&lt;/cite&gt;, so
lifting $g_{Q}(m)=\Theta(\max\{1,\log m/\lambda\})$ gives $\Theta(n\log^{3}n/\lambda)$, above
membership by $\Theta(\log n/\log\log n)$. The separation is no artifact of
unstructured keys; it survives the word-RAM as soon as the queries are
two-dimensional, the regime of multi-attribute range search.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S7.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="random-access"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;7.2 &lt;/span&gt;Random Access&lt;/h3&gt;
&lt;div id="S7.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Select’s polynomial cost is the signature of the no-backseek head, and it vanishes
the moment the head may return. The obstacle of &lt;a href="#S5" title="5 Select ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; was an answer
threshold fixed by all runs jointly, unknown while the early runs are read and out
of reach once they are passed. Random access dissolves it: selecting the $K$-th
smallest among $W$ sorted runs is classical, $O(W+\sum_{i}\log(k_{i}+1))$ comparisons
with $k_{i}$ run $i$’s share of the $K$ smallest &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib15" title="Generalized selection and ranking: sorted matrices" class="ltx_ref"&gt;FJ84&lt;/a&gt;, &lt;a href="#bib.bib16" title="Selection from heaps, row-sorted matrices, and +XY using soft heaps" class="ltx_ref"&gt;KKZ+19&lt;/a&gt;]&lt;/cite&gt;,
which is $O(\log^{2}n)$ at a diverse frontier. Random access brings select to
$O(n\log^{3}n)$, the value-query scale, with the exact optimum open.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;It does no more. Predecessor stays at $n\log^{3}n$ under random access, since every
run must still be searched and no run bridges another; what random access removes
is not the per-run search but the forward head’s inability to revisit an internal
threshold. The polynomial gap was never in the answer, only $O(\log n)$ bits, but
in that head. Integer keys touch only the order gap and random access only select’s,
each isolating the restriction its cost depends on.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S7.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="deque-edits"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;7.3 &lt;/span&gt;Deque Edits&lt;/h3&gt;
&lt;div id="S7.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Two restrictions guard the cascade together: a merge stack writes only at the tail,
behind the forward head, and its runs are strongly materialized, so no run holds
order information about another. Relax both, writing at the head’s entrance and
letting a young run carry a bridge into an older one, and the separation falls.
Model the relaxation by &lt;em class="ltx_emph ltx_font_italic"&gt;deque&lt;/em&gt; edits, popping and pushing at both ends of the
token string while keeping the same forward, no-backseek head, so a component may be
placed at position $0$, ahead of all the head will read; dropping materialization
lets a young component store forward handles into the older ones, charged to itself
and leaving them unedited.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.Thmtheorem1" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 7.1&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Deque Collapse)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S7.Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Under deque edits with non-materialized runs, abstract-key predecessor admits
$E=O(n\log n)$ and $\widehat{R}=O(\log n)$, so $E\widehat{R}=O(n\log^{2}n)$ and the order
separation does not survive.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S7.SS3.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;A useful bridge from $U$ to $V$ needs $U$ read before $V$ and $V$ born before $U$
(&lt;a href="#S4.Thmtheorem1" title="Lemma 4.1 (Causal-Bridge Obstruction). ‣ 4.1 No Cascading Across Components ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.1&lt;/span&gt;&lt;/a&gt;), and tail-only editing forces birth order to follow read
order and kills it. Deque editing breaks the coupling: lay the active components
youngest first, $C_{1},\dots,C_{W}$ read from the entrance with sizes increasing, so
$C_{i}$ is read before $C_{i+1}$ while $C_{i+1}$ is the older of the two, the very
order a cascade needs.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.SS3.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Run the Bentley–Saxe counter mirrored at the entrance: each insert pushes a
singleton at the front and, while the two front components share a size, pops both,
merges, and pushes one new front component. A component of $m_{i}$ keys stores its
block as a forward-readable balanced tree together with a sparse cascade into the
next-older $C_{i+1}$, cutting $C_{i+1}$’s order into $O(m_{i})$ intervals of span
$O(m_{i+1}/m_{i})$ and keeping, per gap, its own predecessor and a forward handle to
the precomputed subtree root for that interval, a node already inside $C_{i+1}$’s
own tree once $C_{i+1}$ is serialized. Each older component is serialized once with
its roots in place, so a younger one adds only its $O(m_{i})$ handles and never edits
it; hence $|C_{i}|=O(m_{i})$, and a size-$2^{k}$ component is built $O(n/2^{k})$ times at
$O(2^{k})$ tokens, giving $E=O(n\log n)$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.SS3.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;A query searches $C_{1}$ in $O(\log m_{1})$ reads, then at each step follows the stored
handle into a span-$O(1+m_{i+1}/m_{i})$ interval of $C_{i+1}$, searches its
precomputed subtree, updates the best candidate, and moves on without a backseek.
The reads telescope,&lt;/p&gt;
&lt;table id="S7.Ex1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widehat{R}=O\Bigl(W+\log m_{1}+\sum_{i\geq 2}\log\tfrac{m_{i}}{m_{i-1}}\Bigr)=O(W+\log m_{W})=O(\log n).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S7.SS3.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The collapse is one of orientation, not of two-endedness. A queue, pushing at the
tail and popping at the head, still builds its components at the scan’s exit and
does not collapse; what predecessor pays for under tail-only editing is exactly
that new connectivity must be written behind the forward scan. The gap sits at the
missing cascade, and the cascade the deque builds is non-materialized, a young run
pointing into an older one, so the collapse leaves the materialized model and the
tail-only one together. This is why random access alone, the runs still
materialized, does not collapse predecessor. The matching $\Omega(n\log^{2}n)$ would
follow from a membership floor under deque edits, a minor open point since the
universal floor of &lt;a href="#S3" title="3 Membership ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; uses the tail-only frontier-width bound; the
collapse out of the $n\log^{3}n$ class is unconditional. Afshani’s dynamic
fractional-cascading lower bound &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib4" title="A lower bound for dynamic fractional cascading" class="ltx_ref"&gt;AFS21&lt;/a&gt;]&lt;/cite&gt; forces either fully dynamic
updates or worst-case update time, while the construction here is insertion-only
with amortized rebuilding, and escapes both.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S7.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="lsm-read-amplification"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;7.4 &lt;/span&gt;LSM Read Amplification&lt;/h3&gt;
&lt;div id="S7.SS4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The read gap reaches past edit histories to the runs in place at query time, though
only under a hypothesis. A run can hold its median and successor in an $O(1)$ header
and certify a query’s predecessor between them in two reads, so overlap by itself
does not force $\Omega(\log m)$. What forces it is a query distribution that, after
all outside information is exposed, still leaves $\Omega(\log m_{i})$ of conditional
gap entropy in each overlapped run, exactly the hard family of &lt;a href="#S4.Thmtheorem3" title="Lemma 4.3 (Anchor-and-Zones Floor). ‣ 4.2 Per-State Search Lower Bound ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.3&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.Thmtheorem2" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Proposition 7.2&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Range Read Amplification)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="S7.Thmtheorem2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $R_{1},\dots,R_{W}$ be active sorted runs, pairwise no-cascade and carrying no
cross-run order catalog. Under a query distribution leaving $\Omega(\log m_{i})$
conditional gap entropy in each run it crosses, an exact range or order query has
read cost $\Omega(\sum_{i\,\text{crossed}}\log m_{i})$, while a point query is settled
in $O(1)$ reads per run.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="S7.SS4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The runs being mutually no-cascade, a read in one cannot shrink another’s candidate
set, so the per-run argument of &lt;a href="#S4.Thmtheorem3" title="Lemma 4.3 (Anchor-and-Zones Floor). ‣ 4.2 Per-State Search Lower Bound ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Lemma&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;4.3&lt;/span&gt;&lt;/a&gt; applies to each crossed run
on its own: the hypothesis leaves $\Omega(\log m_{i})$ gap entropy there, and
localizing the endpoint costs $\Omega(\log m_{i})$ reads. Carrying no cross-run
catalog, the runs do not share the cost, so it sums. A point query is hashable,
settled per run by a filter in $O(1)$.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S7.SS4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The bound is on the runs in place, however built or read, so it holds
in any leveled sorted-run store. In a random-access store the per-run filters let a
point query skip the runs that miss it, leaving $O(1)$; a range or order query has
no such escape and localizes in every run it spans,
$\Theta(\log_{T}n)$ at size-ratio $T$, each localization irreducible by
&lt;a href="#S7.Thmtheorem2" title="Proposition 7.2 (Range Read Amplification). ‣ 7.4 LSM Read Amplification ‣ 7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Proposition&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;7.2&lt;/span&gt;&lt;/a&gt;. This
range-over-point read amplification closes only two ways: a word-RAM integer index,
which serves one dimension but not string keys or multi-attribute ranges, where the
two-dimensional separation persists; or a cross-run order catalog, which appears to
need $\Omega(n^{2})$ edits to maintain under append-only merging (&lt;a href="#S5" title="5 Select ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Section&lt;/span&gt; &lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;).
For write-optimized, string-keyed, multi-attribute engines in the insertion-only
regime the model captures, the range read amplification is intrinsic, not an
implementation artifact &lt;cite class="ltx_cite ltx_citemacro_cite"&gt;[&lt;a href="#bib.bib22" title="The log-structured merge-tree (LSM-tree)" class="ltx_ref"&gt;OCG+96&lt;/a&gt;, &lt;a href="#bib.bib17" title="Monkey: optimal navigable key-value store" class="ltx_ref"&gt;DAI17&lt;/a&gt;, &lt;a href="#bib.bib18" title="Dostoevsky: better space-time trade-offs for LSM-tree based key-value stores via adaptive removal of superfluous merging" class="ltx_ref"&gt;DI18&lt;/a&gt;]&lt;/cite&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S7.SS5" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="intermediate-queries"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;7.5 &lt;/span&gt;Intermediate Queries&lt;/h3&gt;
&lt;div id="S7.SS5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Order at $n\log^{3}n$ and select at $n^{2}$ are the two ends of one scale, set by how
much the query reveals about its answer’s value. A $w$-windowed select, the $K$-th
smallest under the promise that the answer lies in a bracket of at most $w$ live
keys, interpolates between them: at $w=O(1)$ the bracket pins the value and the
query is an order query, at $w=N$ the promise is empty and it is select. The cut
floor restricted to the bracket gives $\widehat{R}\geq c\min\{w,P,U\}$, only the $\leq w$
keys inside it carrying the ambiguity. The matching write tradeoff across the
interior is open, and we leave it.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="bib" class="ltx_bibliography"&gt;
&lt;h2 class="ltx_title ltx_title_bibliography" id="references"&gt;References&lt;/h2&gt;
&lt;ul id="bib.L1" class="ltx_biblist"&gt;
&lt;li id="bib.bib4" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[AFS21]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;P. Afshani&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2021)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;A lower bound for dynamic fractional cascading&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;SODA&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 2229–2248&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;arXiv:2011.00503&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1137/1.9781611976465.133" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A1.Thmtheorem5.p1" title="Remark A.5. ‣ Appendix A Cascades Beyond Materialization ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Remark A.5&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS3.SSS0.Px3.p1" title="Fractional Cascading. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p5" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p6" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S4.SS1.p3" title="4.1 No Cascading Across Components ‣ 4 Order Queries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§4.1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S7.SS3.p5" title="7.3 Deque Edits ‣ 7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§7.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib12" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[ABR01]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;S. Alstrup, G. S. Brodal, and T. Rauhe&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2001)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Optimal static range reporting in one dimension&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;STOC&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 476–482&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/380752.380842" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S7.SS1.p3" title="7.1 Integer Keys ‣ 7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§7.1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib31" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[AKM+16]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. Athanassoulis, M. S. Kester, L. M. Maas, R. Stoica, S. Idreos, A. Ailamaki, and M. Callaghan&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2016)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Designing access methods: the RUM conjecture&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;EDBT&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 461–466&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.5441/002/edbt.2016.42" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px2.p1" title="Write-Optimized Storage. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p2" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p5" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib29" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[BCF+24]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. A. Bender, A. Conway, M. Farach-Colton, H. Komlós, M. Koucký, W. Kuszmaul, and M. Saks&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2024)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Nearly optimal list labeling&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;FOCS&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 2253–2274&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;arXiv:2405.00807&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1109/FOCS61266.2024.00132" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px4.p1" title="Lower Bounds and Restricted Access. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib19" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[BCF+22]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. A. Bender, A. Conway, M. Farach-Colton, H. Komlós, W. Kuszmaul, and N. Wein&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2022)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Online list labeling: breaking the $\log^{2}n$ barrier&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;FOCS&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 980–990&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;arXiv:2203.02763&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1109/FOCS54457.2022.00096" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A1.p12" title="Appendix A Cascades Beyond Materialization ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix A&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS3.SSS0.Px4.p1" title="Lower Bounds and Restricted Access. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib35" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[BFF+07]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. A. Bender, M. Farach-Colton, J. T. Fineman, Y. R. Fogel, B. C. Kuszmaul, and J. Nelson&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2007)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Cache-oblivious streaming B-trees&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;SPAA&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 81–92&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/1248377.1248393" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A1.Thmtheorem5.p1" title="Remark A.5. ‣ Appendix A Cascades Beyond Materialization ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Remark A.5&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p1" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib1" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[BS80]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;J. L. Bentley and J. B. Saxe&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1980)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Decomposable searching problems I: static-to-dynamic transformation&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Journal of Algorithms&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;1&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;4&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 301–358&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1016/0196-6774%2880%2990015-2" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px1.p1" title="Static-to-Dynamic Transformations. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p1" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p5" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S2.SS6.p1" title="2.6 Baseline Upper Bounds ‣ 2 Preliminaries ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2.6&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib42" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[BDH+23]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;S. Borst, D. Dadush, S. Huiberts, and D. Kashaev&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2023)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;A nearly optimal randomized algorithm for explorable heap selection&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;IPCO&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_series"&gt;Lecture Notes in Computer Science&lt;/span&gt;, Vol. &lt;span class="ltx_text ltx_bib_volume"&gt;13904&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 29–43&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;arXiv:2210.05982&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1007/978-3-031-32726-1%5F3" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px4.p1" title="Lower Bounds and Restricted Access. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib20" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[BF03]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;G. S. Brodal and R. Fagerberg&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2003)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Lower bounds for external memory dictionaries&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;SODA&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 546–554&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.5555/644108.644201" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px4.p1" title="Lower Bounds and Restricted Access. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p5" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib3" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[BKS12]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;J. Bulánek, M. Koucký, and M. Saks&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2012)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Tight lower bounds for the online labeling problem&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;STOC&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 1185–1198&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;arXiv:1112.5636&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/2213977.2214083" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A1.p10" title="Appendix A Cascades Beyond Materialization ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix A&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.SS3.SSS0.Px4.p1" title="Lower Bounds and Restricted Access. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S3.SS1.p7" title="3.1 Merge Forests ‣ 3 Membership ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§3.1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib14" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[CW13]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;T. M. Chan and B. T. Wilkinson&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2013)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Adaptive and approximate orthogonal range counting&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;SODA&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 241–251&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1137/1.9781611973105.18" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px4.p1" title="Lower Bounds and Restricted Access. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S7.SS1.p4" title="7.1 Integer Keys ‣ 7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§7.1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib23" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[CDG+08]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;F. Chang, J. Dean, S. Ghemawat, W. C. Hsieh, D. A. Wallach, M. Burrows, T. Chandra, A. Fikes, and R. E. Gruber&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2008)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Bigtable: a distributed storage system for structured data&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;ACM Transactions on Computer Systems&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;26&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 1–26&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/1365815.1365816" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px2.p1" title="Write-Optimized Storage. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p1" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib21" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[CG86]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;B. Chazelle and L. J. Guibas&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1986)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Fractional cascading: I. A data structuring technique&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Algorithmica&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;1&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 133–162&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1007/BF01840440" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px3.p1" title="Fractional Cascading. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p5" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p6" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib7" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[DIN22]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;R. Das, J. Iacono, and Y. Nekrich&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2022)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;External-memory dictionaries with worst-case update cost&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;ISAAC&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_series"&gt;LIPIcs&lt;/span&gt;, Vol. &lt;span class="ltx_text ltx_bib_volume"&gt;248&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 21:1–21:13&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;arXiv:2211.06044&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.4230/LIPIcs.ISAAC.2022.21" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px4.p1" title="Lower Bounds and Restricted Access. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib17" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[DAI17]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;N. Dayan, M. Athanassoulis, and S. Idreos&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2017)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Monkey: optimal navigable key-value store&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;SIGMOD&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 79–94&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/3035918.3064054" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px2.p1" title="Write-Optimized Storage. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p2" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p5" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S7.SS4.p3" title="7.4 LSM Read Amplification ‣ 7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§7.4&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib18" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[DI18]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;N. Dayan and S. Idreos&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2018)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Dostoevsky: better space-time trade-offs for LSM-tree based key-value stores via adaptive removal of superfluous merging&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;SIGMOD&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/3183713.3196927" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px2.p1" title="Write-Optimized Storage. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p2" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p5" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S7.SS4.p3" title="7.4 LSM Read Amplification ‣ 7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§7.4&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib15" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[FJ84]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;G. N. Frederickson and D. B. Johnson&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1984)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Generalized selection and ranking: sorted matrices&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;SIAM Journal on Computing&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;13&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;1&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 14–30&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1137/0213002" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px4.p1" title="Lower Bounds and Restricted Access. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S7.SS2.p1" title="7.2 Random Access ‣ 7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§7.2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib38" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[FS89]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. L. Fredman and M. E. Saks&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1989)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;The cell probe complexity of dynamic data structures&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;STOC&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 345–354&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/73007.73040" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px4.p1" title="Lower Bounds and Restricted Access. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p5" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib11" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[FW93]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. L. Fredman and D. E. Willard&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1993)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Surpassing the information theoretic bound with fusion trees&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Journal of Computer and System Sciences&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;47&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;3&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 424–436&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1016/0022-0000%2893%2990040-4" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S7.SS1.p1" title="7.1 Integer Keys ‣ 7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§7.1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib28" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[IKR81]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;A. Itai, A. G. Konheim, and M. Rodeh&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1981)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;A sparse table implementation of priority queues&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;ICALP&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_series"&gt;Lecture Notes in Computer Science&lt;/span&gt;, Vol. &lt;span class="ltx_text ltx_bib_volume"&gt;115&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 417–431&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1007/3-540-10843-2%5F34" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px4.p1" title="Lower Bounds and Restricted Access. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib16" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[KKZ+19]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;H. Kaplan, L. Kozma, O. Zamir, and U. Zwick&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2019)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Selection from heaps, row-sorted matrices, and $X+Y$ using soft heaps&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;SOSA&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_series"&gt;OASIcs&lt;/span&gt;, Vol. &lt;span class="ltx_text ltx_bib_volume"&gt;69&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 5:1–5:21&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.4230/OASIcs.SOSA.2019.5" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px4.p1" title="Lower Bounds and Restricted Access. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S7.SS2.p1" title="7.2 Random Access ‣ 7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§7.2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib41" class="ltx_bibitem ltx_bib_misc"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[KO25]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;Y. K. Ko&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2025)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Unifying the landscape of super-logarithmic dynamic cell-probe lower bounds&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;arXiv:2510.17717; ECCC TR25-156&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px4.p1" title="Lower Bounds and Restricted Access. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib24" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[LM10]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;A. Lakshman and P. Malik&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2010)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Cassandra: a decentralized structured storage system&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;ACM SIGOPS Operating Systems Review&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;44&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 35–40&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/1773912.1773922" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px2.p1" title="Write-Optimized Storage. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p1" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib39" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[LAR12]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;K. G. Larsen&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2012)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;The cell probe complexity of dynamic range counting&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;STOC&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 85–94&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;arXiv:1105.5933&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/2213977.2213987" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px4.p1" title="Lower Bounds and Restricted Access. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p5" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib25" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[LPG+17]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;L. Lu, T. S. Pillai, H. Gopalakrishnan, A. C. Arpaci-Dusseau, and R. H. Arpaci-Dusseau&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2017)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;WiscKey: separating keys from values in SSD-conscious storage&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;ACM Transactions on Storage&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;13&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;1&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 1–28&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/3033273" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px2.p1" title="Write-Optimized Storage. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p1" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib34" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[LCK+20]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;S. Luo, S. Chatterjee, R. Ketsetsidis, N. Dayan, W. Qin, and S. Idreos&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2020)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Rosetta: a robust space-time optimized range filter for key-value stores&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;SIGMOD&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 2071–2086&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/3318464.3389731" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px2.p1" title="Write-Optimized Storage. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p2" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p5" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib5" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[MRY+21]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;C. Mathieu, R. Rajaraman, N. E. Young, and A. Yousefi&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2021)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Competitive data-structure dynamization&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;SODA&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 2269–2287&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;arXiv:2011.02615&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1137/1.9781611976465.135" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px1.p1" title="Static-to-Dynamic Transformations. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p5" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib27" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[MDL20]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;Y. Matsunobu, S. Dong, and H. Lee&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2020)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;MyRocks: LSM-tree database storage engine serving facebook’s social graph&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Proceedings of the VLDB Endowment&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;13&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;12&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 3217–3230&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.14778/3415478.3415546" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px2.p1" title="Write-Optimized Storage. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p1" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib37" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[MN90]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;K. Mehlhorn and S. Näher&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1990)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Dynamic fractional cascading&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Algorithmica&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;5&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 215–241&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1007/BF01840386" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px3.p1" title="Fractional Cascading. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p5" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p6" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib2" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[MEH81]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;K. Mehlhorn&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1981)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Lower bounds on the efficiency of transforming static data structures into dynamic structures&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Mathematical Systems Theory&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;15&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;1&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 1–16&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1007/BF01786969" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px1.p1" title="Static-to-Dynamic Transformations. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p1" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p5" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib6" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[MLI25]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;D. Mo, S. Luo, and S. Idreos&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2025)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;How to grow an LSM-tree? Towards bridging the gap between theory and practice&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Proceedings of the ACM on Management of Data&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;3&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;3&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 173:1–173:25&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;arXiv:2504.17178&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/3725310" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px2.p1" title="Write-Optimized Storage. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p2" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib36" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[MP80]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;J. I. Munro and M. S. Paterson&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1980)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Selection and sorting with limited storage&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Theoretical Computer Science&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;12&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;3&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 315–323&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1016/0304-3975%2880%2990061-4" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px4.p1" title="Lower Bounds and Restricted Access. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib22" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[OCG+96]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;P. O’Neil, E. Cheng, D. Gawlick, and E. O’Neil&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1996)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;The log-structured merge-tree (LSM-tree)&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Acta Informatica&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;33&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;4&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 351–385&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1007/s002360050048" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px2.p1" title="Write-Optimized Storage. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p1" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S7.SS4.p3" title="7.4 LSM Read Amplification ‣ 7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§7.4&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib30" class="ltx_bibitem ltx_bib_book"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[OVE83]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. H. Overmars&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1983)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;The design of dynamic data structures&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_series"&gt;Lecture Notes in Computer Science&lt;/span&gt;, Vol. &lt;span class="ltx_text ltx_bib_volume"&gt;156&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_publisher"&gt;Springer&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1007/BFb0014927" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px1.p1" title="Static-to-Dynamic Transformations. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p1" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p5" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib8" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[PT06]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. Pătraşcu and M. Thorup&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2006)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Time-space trade-offs for predecessor search&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;STOC&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 232–240&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;arXiv:cs/0603043&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/1132516.1132551" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px4.p1" title="Lower Bounds and Restricted Access. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S7.SS1.p2" title="7.1 Integer Keys ‣ 7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§7.1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib9" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[PT07]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. Pătraşcu and M. Thorup&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2007)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Randomization does not help searching predecessors&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;SODA&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 555–564&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.5555/1283383.1283443" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px4.p1" title="Lower Bounds and Restricted Access. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S7.SS1.p2" title="7.1 Integer Keys ‣ 7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§7.1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib13" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[PĂT07]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. Pătraşcu&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2007)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Lower bounds for 2-dimensional range counting&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;STOC&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 40–46&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/1250790.1250797" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px4.p1" title="Lower Bounds and Restricted Access. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S7.SS1.p4" title="7.1 Integer Keys ‣ 7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§7.1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib40" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[PĂT11]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;M. Pătraşcu&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2011)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Unifying the landscape of cell-probe lower bounds&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;SIAM Journal on Computing&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;40&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;3&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 827–847&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1137/09075336X" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px4.p1" title="Lower Bounds and Restricted Access. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p5" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib26" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[RKC+17]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;P. Raju, R. Kadekodi, V. Chidambaram, and I. Abraham&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2017)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;PebblesDB: building key-value stores using fragmented log-structured merge trees&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;SOSP&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 497–514&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/3132747.3132765" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px2.p1" title="Write-Optimized Storage. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p1" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib10" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[WIL83]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;D. E. Willard&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (1983)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Log-logarithmic worst-case range queries are possible in space $\Theta(N)$&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Information Processing Letters&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;17&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 81–84&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1016/0020-0190%2883%2990075-3" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S7.SS1.p1" title="7.1 Integer Keys ‣ 7 Access-Model Variants ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§7.1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib33" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[ZLL+18]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;H. Zhang, H. Lim, V. Leis, D. G. Andersen, M. Kaminsky, K. Keeton, and A. Pavlo&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2018)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;SuRF: practical range query filtering with fast succinct tries&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;SIGMOD&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 323–336&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/3183713.3196931" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px2.p1" title="Write-Optimized Storage. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p2" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p5" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib32" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_abbrv ltx_role_refnum ltx_tag_bibitem"&gt;[ZCW+21]&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_author"&gt;W. Zhong, C. Chen, X. Wu, and S. Jiang&lt;/span&gt;&lt;span class="ltx_text ltx_bib_year"&gt; (2021)&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;REMIX: efficient range query for LSM-trees&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;USENIX FAST&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 51–64&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Note: &lt;span class="ltx_text ltx_bib_note"&gt;arXiv:2010.12734&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.SS3.SSS0.Px2.p1" title="Write-Optimized Storage. ‣ 1.3 Related Works ‣ 1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1.3&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p2" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p5" title="1 Introduction ‣ The Price of Order in the Logarithmic Method" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;</description></item><item><title>Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies</title><link>https://sichen-wang.github.io/publications/depth-over-fidelity/</link><pubDate>Thu, 09 Jul 2026 00:00:00 +0000</pubDate><guid>https://sichen-wang.github.io/publications/depth-over-fidelity/</guid><description>&lt;article class="ltx_document ltx_pruned_first"&gt;
&lt;div id="p2" class="ltx_para"&gt;
&lt;br class="ltx_break"&gt;
&lt;/div&gt;
&lt;section id="S1" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="introduction"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;1 &lt;/span&gt;Introduction&lt;/h2&gt;
&lt;div id="S1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Many contemporary machine learning workflows involve stochastic black-box optimization, where the objective is accessible only through noisy function evaluations. This regime arises in policy search with stochastic rollouts, simulation-based design and control, hardware-in-the-loop tuning, and hyperparameter optimization where training and validation induce intrinsic randomness.
In such problems, the dominant constraint is often a strict cap on the number of oracle queries, i.e., a fixed-budget protocol.
Consequently, evaluations spent on repeated measurement to denoise directly reduce the number of distinct candidates explored and the number of adaptive updates performed.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Among black-box optimizers, rank-based evolution strategies (ES), in particular
CMA-ES &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Hansen and Ostermeier, &lt;a href="#bib.bib1" title="Completely derandomized self-adaptation in evolution strategies" class="ltx_ref"&gt;2001&lt;/a&gt;)&lt;/cite&gt;, are appealing because they require only relative comparisons of candidates and
inherit invariance that make them robust across problem scalings. However, their reliance on intra-generation ranking makes them especially sensitive to evaluation noise: if the objective values of a sampled population are
perturbed, the induced permutation of ranks changes, resulting misled updates using misranked “elites.” In other words, noisy evaluations turn into selection noise that directly perturbs the update direction.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;A large body of work on noisy evolutionary optimization advocates allocating additional intra-generation evaluations, such as uniform $k$-fold resampling and aggregation, sequential sampling / racing, and uncertainty-handling
variants of CMA-ES, to stabilize ranks before updating
&lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Jin and Branke, &lt;a href="#bib.bib4" title="Evolutionary optimization in uncertain environments – a survey" class="ltx_ref"&gt;2005&lt;/a&gt;; Rakshit&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt;, &lt;a href="#bib.bib5" title="Noisy evolutionary optimization algorithms - a comprehensive survey" class="ltx_ref"&gt;2017&lt;/a&gt;; Beyer and Sendhoff, &lt;a href="#bib.bib31" title="Evolutionary algorithms in the presence of noise: to sample or not to sample" class="ltx_ref"&gt;2007&lt;/a&gt;; Hansen&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt;, &lt;a href="#bib.bib2" title="A method for handling uncertainty in evolutionary optimization with an application to feedback control of combustion" class="ltx_ref"&gt;2009&lt;/a&gt;; Groves and Branke, &lt;a href="#bib.bib33" title="Sequential sampling for noisy optimisation with CMA-ES" class="ltx_ref"&gt;2018&lt;/a&gt;; Birattari&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt;, &lt;a href="#bib.bib15" title="A racing algorithm for configuring metaheuristics" class="ltx_ref"&gt;2002&lt;/a&gt;)&lt;/cite&gt;.
These approaches typically prioritize per-generation fidelity:
approximate the noiseless ordering as closely as possible before applying the standard rank-based update.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;However, under a fixed-budget protocol, fidelity comes with cost: evaluating each candidate multiple times reduces the number of generations inversely. This matters because the strength of CMA-ES comes from iterated distribution learning (mean, covariance, step-size adaptation) accumulated through many generations. In particular, update is mostly sensitive to the elite threshold due to truncation selection, where the borderline candidates have nearly indistinguishable objective values and achieving reliable selection via repeated evaluations can be more costly.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This paper argues for a complementary principle for fixed-budget noisy ES:
when ranking uncertainty is high, it can be more sample-efficient to keep the per-generation evaluation cost low, thereby preserving optimization depth, and to incorporate uncertainty directly into the selection weights. Concretely, we introduce &lt;em class="ltx_emph ltx_font_italic"&gt;probabilistic elite membership&lt;/em&gt; (PEM): rather than applying hard rank weights from
a single noisy ranking, we target the conditional expected rank weights given the sampled candidates. PEM can be viewed as a Rao–Blackwellization of the standard noisy rank-based update, which preserves the conditional mean update while reducing conditional update dispersion.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Computing PEM exactly would require extensive reevaluations per candidate, risking depth collapse. We therefore propose &lt;em class="ltx_emph ltx_font_italic"&gt;residual-bootstrapped&lt;/em&gt; PEM (RB-PEM), a practical estimator that uses only a
&lt;em class="ltx_emph ltx_font_italic"&gt;capped, additive&lt;/em&gt; reevaluation overhead per generation. Each generation evaluates every candidate once and uses a small targeted reevaluation set to calibrate the local noise model, then extracts standardized noise residuals and inserts them into a pooled residual bank that is reused
across generations. With this amortized residual pool, we can simulate many bootstrap rankings at essentially zero
evaluation cost &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Efron and Tibshirani, &lt;a href="#bib.bib18" title="An introduction to the bootstrap" class="ltx_ref"&gt;1993&lt;/a&gt;)&lt;/cite&gt; and estimate expected weights accurately while keeping per-generation cost close to one evaluation per candidate. Since pooling residuals can fail under distributional mismatch, we decompose the pool-to-target mismatch into four falsifiable online-measurable components and use them as runtime diagnostics.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Depth-over-fidelity is not universally optimal: when rankings are already reliable, smoothing can weaken selection
pressure and any additional reevaluation becomes overhead. We therefore introduce a low-cost &lt;em class="ltx_emph ltx_font_italic"&gt;probe-and-switch&lt;/em&gt;
mechanism using a small probing budget to dynamically choose between standard CMA-ES and RB-PEM.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p8" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Our main contributions are:&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S1.p9" class="ltx_para"&gt;
&lt;ul id="S1.I1" class="ltx_itemize"&gt;
&lt;li id="S1.I1.i1" class="ltx_item" style="list-style-type:none;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S1.I1.i1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We identify and formalize a &lt;em class="ltx_emph ltx_font_italic"&gt;depth–fidelity&lt;/em&gt; tradeoff for noisy rank-based
evolution strategies under strict evaluation budgets, clarifying when evaluation-stage uncertainty reduction can be
sample-inefficient.&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="S1.I1.i2" class="ltx_item" style="list-style-type:none;padding-top:1.0pt;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S1.I1.i2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We introduce Probabilistic elite membership (PEM) as a principled selection-stage
target, which can be viewed as a Rao–Blackwell variance reduction.&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="S1.I1.i3" class="ltx_item" style="list-style-type:none;padding-top:1.0pt;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S1.I1.i3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We design residual-bootstrapped PEM (RB-PEM) with capped per-generation overhead and an amortized residual pool, and provide theory and runtime checks that quantify and
diagnose residual pool mismatch.&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="S1.I1.i4" class="ltx_item" style="list-style-type:none;padding-top:1.0pt;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S1.I1.i4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We propose the adaptive rule probe-and-switch to prevent negative transfer by reverting to standard
CMA-ES in low-misranking regimes.&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li id="S1.I1.i5" class="ltx_item" style="list-style-type:none;padding-top:1.0pt;"&gt;
&lt;span class="ltx_tag ltx_tag_item"&gt;•&lt;/span&gt;
&lt;div id="S1.I1.i5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Across the COCO bbob-noisy suite and diverse external tasks (RL policy search and noisy hyperparameter optimization), RB-PEM consistently improves fixed-budget performance in high-misranking regimes, substantiating the thesis that integrating uncertainty at the selection stage can be more sample-efficient than reducing it at the evaluation stage.&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div id="S1.p10" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Section &lt;a href="#S3" title="3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; formalizes the fixed-budget protocol, noisy ranking, and the depth–fidelity tension.
Section &lt;a href="#S4" title="4 Method: PEM, Residual Bootstrapping, and Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; presents PEM, residual bootstrapping, and probe-and-switch; Section &lt;a href="#S5" title="5 Theory ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; provides a
theoretical explanation based on conditional update dispersion; and Section &lt;a href="#S6" title="6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt; evaluates the
resulting algorithms under strict budgets.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S2" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="related-work"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;2 &lt;/span&gt;Related Work&lt;/h2&gt;
&lt;div id="S2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Noise handling in ES.&lt;/span&gt;
Most noisy-ES methods modify how candidates are observed before applying a deterministic rank rule. Uniform resampling, racing, and sequential sampling spend extra evaluations to stabilize ranks &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Beyer and Sendhoff, &lt;a href="#bib.bib31" title="Evolutionary algorithms in the presence of noise: to sample or not to sample" class="ltx_ref"&gt;2007&lt;/a&gt;; Branke and Schmidt, &lt;a href="#bib.bib60" title="Sequential sampling in noisy environments" class="ltx_ref"&gt;2004&lt;/a&gt;; Groves and Branke, &lt;a href="#bib.bib33" title="Sequential sampling for noisy optimisation with CMA-ES" class="ltx_ref"&gt;2018&lt;/a&gt;; Birattari&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt;, &lt;a href="#bib.bib15" title="A racing algorithm for configuring metaheuristics" class="ltx_ref"&gt;2002&lt;/a&gt;)&lt;/cite&gt;; UH-CMA-ES and RA-CMA-ES adapt reevaluations during the run &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Hansen&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt;, &lt;a href="#bib.bib2" title="A method for handling uncertainty in evolutionary optimization with an application to feedback control of combustion" class="ltx_ref"&gt;2009&lt;/a&gt;; Uchida&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt;, &lt;a href="#bib.bib46" title="CMA-ES with adaptive reevaluation for multiplicative noise" class="ltx_ref"&gt;2024&lt;/a&gt;)&lt;/cite&gt;; PSA-CMA-ES increases population size &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Nishida and Akimoto, &lt;a href="#bib.bib47" title="PSA-CMA-ES: CMA-ES with population size adaptation" class="ltx_ref"&gt;2018&lt;/a&gt;)&lt;/cite&gt;; and LRA-CMA-ES preserves generation count by attenuating CMA-ES learning rates to maintain signal-to-noise ratio &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Nomura&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt;, &lt;a href="#bib.bib48" title="CMA-ES with learning rate adaptation" class="ltx_ref"&gt;2025&lt;/a&gt;)&lt;/cite&gt;, which in our experiments can reduce the effective mean learning rate to about $0.04$.
Surrogate-assisted ES and DTS-CMA-ES use learned objective/posterior models, including GP surrogates and expected recombination weights &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Bajer&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt;, &lt;a href="#bib.bib50" title="Gaussian process surrogate models for the CMA evolution strategy" class="ltx_ref"&gt;2019&lt;/a&gt;; Krause, &lt;a href="#bib.bib49" title="Recombination weight based selection in the DTS-CMA-ES" class="ltx_ref"&gt;2022&lt;/a&gt;)&lt;/cite&gt;. Noisy BO similarly integrates uncertainty through global GP models and Monte-Carlo acquisitions such as LogEI/qNEI &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Balandat&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt;, &lt;a href="#bib.bib51" title="BoTorch: a framework for efficient monte-carlo bayesian optimization" class="ltx_ref"&gt;2020&lt;/a&gt;; Ament&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt;, &lt;a href="#bib.bib52" title="Unexpected improvements to expected improvement for bayesian optimization" class="ltx_ref"&gt;2023&lt;/a&gt;; Frazier, &lt;a href="#bib.bib53" title="A tutorial on bayesian optimization" class="ltx_ref"&gt;2018&lt;/a&gt;)&lt;/cite&gt;; RB-PEM instead avoids global surrogate and acts directly on the rank-based ES update.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Ranking and selection, and our position.&lt;/span&gt;
R&amp;amp;S also allocates noisy samples to compare alternatives &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Kim and Nelson, &lt;a href="#bib.bib54" title="Recent advances in ranking and selection" class="ltx_ref"&gt;2007&lt;/a&gt;; Hong&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt;, &lt;a href="#bib.bib57" title="Review on ranking and selection: a new perspective" class="ltx_ref"&gt;2021&lt;/a&gt;, &lt;a href="#bib.bib58" title="Solving large-scale fixed-budget ranking and selection problems" class="ltx_ref"&gt;2022&lt;/a&gt;)&lt;/cite&gt;, with fixed-confidence, fixed-budget, and procedure-selection variants &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Branke&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt;, &lt;a href="#bib.bib55" title="Selecting a selection procedure" class="ltx_ref"&gt;2007&lt;/a&gt;; Frazier, &lt;a href="#bib.bib56" title="A fully sequential elimination procedure for indifference-zone ranking and selection with tight bounds on probability of correct selection" class="ltx_ref"&gt;2014&lt;/a&gt;; Pearce and Branke, &lt;a href="#bib.bib59" title="Efficient expected improvement estimation for continuous multiple ranking and selection" class="ltx_ref"&gt;2017&lt;/a&gt;)&lt;/cite&gt;. R&amp;amp;S targets correct selection within a fixed alternative set, while CMA-ES uses populations as adaptive distribution-learning steps. RB-PEM is complementary to observation-stage noise handling: it intervenes at selection by replacing hard ranks with probabilistic weights. To our knowledge, this stage has remained unaddressed in the noisy single-objective ES literature.
For top-$\mu$ truncation, $w_{i}^{\star}=\Pr(r_{i}\leq\mu\mid x_{1:\lambda})/\mu$, i.e., normalized elite-set membership; the conditional expected rank $\mathbb{E}[r_{i}\mid x_{1:\lambda}]$ is a different scalar and would discard the rank-weight map. For logarithmic CMA-ES weights, PEM estimates $\mathbb{E}[w(r_{i})\mid x_{1:\lambda}]$ directly, so internal reorderings among top-ranked candidates are included.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S3" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="preliminaries"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;3 &lt;/span&gt;Preliminaries&lt;/h2&gt;
&lt;section id="S3.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="optimization-under-noisy-evaluations"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.1 &lt;/span&gt;Optimization under Noisy Evaluations&lt;/h3&gt;
&lt;div id="S3.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We study fixed-budget stochastic black-box optimization. The goal is to minimize an unknown objective&lt;/p&gt;
&lt;table id="S3.E1" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\min_{x\in\mathbb{R}^{d}}f(x),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(1)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where $f:\mathbb{R}^{d}\to\mathbb{R}$ may be nonconvex and is accessed only through noisy function evaluations. More explicitly, each &lt;em class="ltx_emph ltx_font_italic"&gt;oracle&lt;/em&gt; call at a point $x\in\mathbb{R}^{d}$ returns a random scalar&lt;/p&gt;
&lt;table id="S3.E2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$y(x)\;=\;f(x)+\varepsilon(x),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(2)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where $\mathbb{E}[\varepsilon(x)]=0$ and $\mathrm{Var}(\varepsilon(x))=\sigma^{2}(x)&amp;lt;\infty$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We will mostly assume that repeated calls at the same point $x$ yield i.i.d. samples, and all oracle calls are conditionally independent given their query locations.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S3.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="fixed-budget-protocol"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.2 &lt;/span&gt;Fixed-Budget Protocol&lt;/h3&gt;
&lt;div id="S3.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Fix a positive integer $B$ as an evaluation budget. An algorithm produces a sequence of query
locations $(x_{1},\dots,x_{B})$ adaptively, where each $x_{t}$ is a measurable function of history
$\{(x_{s},y_{s})\}_{s=1}^{t-1}$ and internal randomness. After querying $x_{t}$ it observes
$y_{t}\sim y(x_{t})$ and consumes one unit of budget. The algorithm must terminate once the $B$-th evaluation is
consumed and a recommendation $\hat{x}_{B}$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For population-based evolution strategies, it is convenient to group oracle calls by “generation”.
At generation $t$ the algorithm proposes $\lambda$ candidates $(x_{t,1},\dots,x_{t,\lambda})$ and may allocate
$K_{t,i}\geq 1$ evaluations to candidate $i$, producing samples
$y_{t,i}^{(1)},\dots,y_{t,i}^{(K_{t,i})}$ with $y_{t,i}^{(j)}\sim y(x_{t,i})$ i.i.d.
The total number of oracle calls is&lt;/p&gt;
&lt;table id="S3.E3" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sum_{t}\sum_{i=1}^{\lambda}K_{t,i}\;\leq\;B,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(3)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;i.e., any resampling, re-evaluation, probing, or aggregation step is counted within the same budget.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The &lt;em class="ltx_emph ltx_font_italic"&gt;simple regret&lt;/em&gt; of a returned recommendation is&lt;/p&gt;
&lt;table id="S3.E4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$r_{B}\;=\;f(\hat{x}_{B})-f^{\star},\qquad f^{\star}\;=\;\inf_{x\in\mathbb{R}^{d}}f(x),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(4)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and we can measure fixed-budget performance by the expected simple regret $\mathbb{E}[r_{B}]$ under the joint randomness of oracle noise and sampling randomization of the algorithm.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S3.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="noisy-evaluation-and-misranking"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.3 &lt;/span&gt;Noisy Evaluation and Misranking&lt;/h3&gt;
&lt;div id="S3.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We follow the standard CMA-ES sampling and ranking formalism specified in Appendix &lt;a href="#A1" title="Appendix A CMA-ES Specification ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;A&lt;/span&gt;&lt;/a&gt; which
summarizes the definitions and mean-update relations (&lt;a href="#A1.E27" title="In Appendix A CMA-ES Specification ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;27&lt;/span&gt;&lt;/a&gt;)–(&lt;a href="#A1.E34" title="In Appendix A CMA-ES Specification ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;34&lt;/span&gt;&lt;/a&gt;) used throughout. Under the noisy oracle (Section &lt;a href="#S3.SS1" title="3.1 Optimization under Noisy Evaluations ‣ 3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.1&lt;/span&gt;&lt;/a&gt;), an algorithm does not observe $f(x_{t,i})$ directly.
Instead, each evaluation returns&lt;/p&gt;
&lt;table id="S3.E5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$y_{t,i}\;=\;f(x_{t,i})+\varepsilon_{t,i},\qquad\mathbb{E}[\varepsilon_{t,i}\mid x_{t,i}]=0,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(5)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;with i.i.d. noise across repeated calls at the same $x_{t,i}$.
The ranking is therefore induced by the noisy values $y_{t,i}$:
let $\hat{\pi}_{t}\in S_{\lambda}$ satisfy&lt;/p&gt;
&lt;table id="S3.E6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$y_{t,\hat{\pi}_{t}(1)}\leq y_{t,\hat{\pi}_{t}(2)}\leq\cdots\leq y_{t,\hat{\pi}_{t}(\lambda)}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(6)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Accordingly, the rank-weighted step used by the algorithm becomes the random quantity&lt;/p&gt;
&lt;table id="S3.E7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\hat{z}_{w,t}\;:=\;\sum_{j=1}^{\lambda}w(j)\,z_{t,\hat{\pi}_{t}(j)},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(7)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and the resulting mean update is&lt;/p&gt;
&lt;table id="S3.E8" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$m_{t+1}\;=\;m_{t}+\eta_{m}\sigma_{t}A_{t}\hat{z}_{w,t}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(8)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S3.SS3.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We call an iteration &lt;em class="ltx_emph ltx_font_italic"&gt;misranked&lt;/em&gt; if the noisy ordering differs from the true ordering, i.e.,
$\hat{\pi}_{t}\neq\pi_{t}^{\star}$ where $\pi_{t}^{\star}$ is defined by sorting $f(x_{t,i})$.
Equivalently, a misranking occurs whenever there exists a pair $(i,j)$ such that&lt;/p&gt;
&lt;table id="S3.E9" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$f(x_{t,i})\leq f(x_{t,j})\quad\text{but}\quad y_{t,i}&amp;gt;y_{t,j}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(9)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Our analysis quantifies how such misrankings bias the rank-based update $\hat{z}_{w,t}$ relative to the
noiseless step $z_{w,t}$ in (&lt;a href="#A1.E32" title="In Appendix A CMA-ES Specification ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;32&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S3.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="mainstream-noise-handling-under-fixed-budgets-fidelity-over-depth"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.4 &lt;/span&gt;Mainstream Noise Handling under Fixed Budgets: Fidelity over Depth&lt;/h3&gt;
&lt;div id="S3.SS4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;In response to misranking in rank-based evolution strategies, common approaches replace each single noisy value $y_{t,i}$ with an &lt;em class="ltx_emph ltx_font_italic"&gt;aggregated estimate&lt;/em&gt;&lt;/p&gt;
&lt;table id="S3.E10" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\bar{y}_{t,i}:=\mathrm{Agg}\!\bigl(y_{t,i}^{(1)},\ldots,y_{t,i}^{(K_{t,i})}\bigr),\qquad K_{t,i}\geq 1,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(10)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and then rank candidates by $\bar{y}_{t,i}$ instead of $y_{t,i}$. Here $\mathrm{Agg}$ may be the sample mean/median/trimmed mean, and $K_{t,i}$ may be fixed (uniform resampling) or adaptively
chosen (uncertainty handling/sequential sampling). Let the &lt;em class="ltx_emph ltx_font_italic"&gt;per-generation evaluation cost&lt;/em&gt; be&lt;/p&gt;
&lt;table id="S3.E11" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$C_{t}\;:=\;\sum_{i=1}^{\lambda}K_{t,i}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(11)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Under the fixed budget $B$ (Section &lt;a href="#S3.SS2" title="3.2 Fixed-Budget Protocol ‣ 3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.2&lt;/span&gt;&lt;/a&gt;), the number of completed distribution updates (&lt;em class="ltx_emph ltx_font_italic"&gt;depth&lt;/em&gt;) is&lt;/p&gt;
&lt;table id="S3.E12" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$T(B)\;:=\;\max\Bigl\{T\in\mathbb{N}:\ \sum_{t=0}^{T-1}C_{t}\leq B\Bigr\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(12)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S3.SS4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;If every candidate is evaluated exactly $k$ times (and aggregated), then $K_{t,i}\equiv k$, hence $C_{t}=k\lambda$,
and the budget constraint immediately implies&lt;/p&gt;
&lt;table id="S3.E13" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$T\;\leq\;\Bigl\lfloor\frac{B}{k\lambda}\Bigr\rfloor\;\approx\;\frac{B}{k\lambda}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(13)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;This bound is just budget accounting: each completed generation consumes $k\lambda$ oracle calls, so at most
$\lfloor B/(k\lambda)\rfloor$ generations can be executed.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Uniform resampling improves &lt;em class="ltx_emph ltx_font_italic"&gt;fidelity&lt;/em&gt; because aggregation reduces effective noise.
For intuition, suppose $\varepsilon(x)$ is conditionally sub-Gaussian with proxy variance $\sigma^{2}(x)$,
and $\mathrm{Agg}$ is the sample mean over $k$ i.i.d. samples, so
$\bar{y}_{t,i}=f(x_{t,i})+\bar{\varepsilon}_{t,i}$ with $\bar{\varepsilon}_{t,i}$ sub-Gaussian of scale
$\sigma(x_{t,i})/\sqrt{k}$. For a pair $(i,j)$ with true gap
$\Delta_{t,ij}:=f(x_{t,j})-f(x_{t,i})&amp;gt;0$, we have&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A6.EGx1"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S3.Ex1"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S3.E14"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\displaystyle\Pr\left(\bar{y}_{t,i}&amp;gt;\bar{y}_{t,j}\mid x_{t,i},x_{t,j}\right)=\Pr\left(\bar{\varepsilon}_{t,i}-\bar{\varepsilon}_{t,j}&amp;gt;\Delta_{t,ij}\right) \displaystyle\leq \displaystyle\exp\left(-\frac{k\,\Delta_{t,ij}^{2}}{2\bigl(\sigma^{2}(x_{t,i})+\sigma^{2}(x_{t,j})\bigr)}\right).$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;(14)&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;Thus, increasing $k$ can reduce pairwise misranking exponentially in $k$, &lt;em class="ltx_emph ltx_font_italic"&gt;but only through the squared gap
$\Delta_{t,ij}^{2}$&lt;/em&gt;. To push the above probability below a target $\delta$, it requires that&lt;/p&gt;
&lt;table id="S3.E15" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$k\;=\;\Omega\!\left(\frac{\sigma^{2}(x_{t,i})+\sigma^{2}(x_{t,j})}{\Delta_{t,ij}^{2}}\,\log\!\frac{1}{\delta}\right).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(15)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The bottleneck is that the most consequential comparisons for rank-$\mu$ updates are those near the truncation
boundary ($r\approx\mu$), where gaps are typically small. As the population concentrates, these gaps can
shrink and make $k$ required for a fixed fidelity target potentially large by (&lt;a href="#S3.E15" title="In 3.4 Mainstream Noise Handling under Fixed Budgets: Fidelity over Depth ‣ 3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;15&lt;/span&gt;&lt;/a&gt;). The above intuition indicates that robust aggregators can mitigate heavy tails and outliers, but they still require multiple oracle calls per candidate to reduce ranking uncertainty.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S3.SS5" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="depth-over-fidelity-a-fixed-budget-principle"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;3.5 &lt;/span&gt;Depth over Fidelity: A Fixed-Budget Principle&lt;/h3&gt;
&lt;div id="S3.SS5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Sections &lt;a href="#S3.SS3" title="3.3 Noisy Evaluation and Misranking ‣ 3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S3.SS4" title="3.4 Mainstream Noise Handling under Fixed Budgets: Fidelity over Depth ‣ 3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.4&lt;/span&gt;&lt;/a&gt; reckon that the mainstream noise handling literature largely takes a &lt;em class="ltx_emph ltx_font_italic"&gt;fidelity-over-depth&lt;/em&gt; stance:
spend additional intra-generation evaluations (resampling) to make the induced ordering close to the noiseless one,
then apply the usual rank-based update. The key question in fixed-budget optimization is thus: &lt;em class="ltx_emph ltx_font_italic"&gt;how much progress per resampling is gained by increasing fidelity?&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS5.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Extra evaluations reduce misranking probability, but the returns can be sharply diminishing. Indeed, by equation (&lt;a href="#S3.E13" title="In 3.4 Mainstream Noise Handling under Fixed Budgets: Fidelity over Depth ‣ 3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;13&lt;/span&gt;&lt;/a&gt;) and (&lt;a href="#S3.E15" title="In 3.4 Mainstream Noise Handling under Fixed Budgets: Fidelity over Depth ‣ 3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;15&lt;/span&gt;&lt;/a&gt;), the comparisons that matter most for rank-$\mu$ updates are those near the elite threshold ($r\approx\mu$), where $\Delta_{t,ij}$ is typically small, since as the population concentrates these gaps shrink. Thus, the $k$ needed for a fixed fidelity target can grow, collapsing depth through $T\propto 1/k$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS5.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This exposes a fixed-budget tension: fidelity-first schemes can spend substantial budget resolving near threshold to approximate a deterministic top-$\mu$ decision, but the resulting loss in depth removes opportunities for
iterated adaptation (mean/covariance/step-size) that require many generations to accumulate. Under strict budgets, this can be a losing trade: resolving near threshold by driving misranking probability down may require a large multiplicative increase in evaluations per candidate, which collapses the optimization trajectory length.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S3.SS5.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This motivates a paradigm shift: instead of denoise-then-rank, we aim to integrate uncertainty at the
selection stage while keeping generations cheap. Concretely, if we have a &lt;em class="ltx_emph ltx_font_italic"&gt;residual bootstrapping&lt;/em&gt; approach that uses one base
evaluation per candidate plus a small (capped) number $K_{t}$ of targeted extra calls, yielding by (&lt;a href="#S3.E11" title="In 3.4 Mainstream Noise Handling under Fixed Budgets: Fidelity over Depth ‣ 3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;)&lt;/p&gt;
&lt;table id="S3.E16" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$C_{t}=\lambda+K_{t},\qquad K_{t}\leq K_{\max}\ll\lambda,$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(16)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;then the depth scales as&lt;/p&gt;
&lt;table id="S3.E17" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$T\approx\frac{B}{\lambda+\mathbb{E}[K_{t}]}\approx\frac{B}{\lambda}\quad\text{when }\mathbb{E}[K_{t}]\ll\lambda.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(17)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S3.SS5.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;In practice, instead of denoising each $y_{t,i}$ until the ordering is reliable, we propagate uncertainty through
selection by replacing hard elite membership with probabilistic weights
$w_{i}^{\star}=\mathbb{E}[w(r_{i})\mid x_{1:\lambda}]$, and we allocate extra evaluations only when they have high marginal value near the threshold, maintaining $C_{t}=\lambda+K_{t}$ with $\mathbb{E}[K_{t}]\ll\lambda$. Sections &lt;a href="#S4" title="4 Method: PEM, Residual Bootstrapping, and Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; and &lt;a href="#S5" title="5 Theory ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; develop an implementable mechanism and show how this depth-preserving treatment of uncertainty
translates into better fixed-budget performance.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S4" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="method-pem-residual-bootstrapping-and-probe-and-switch"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;4 &lt;/span&gt;Method: PEM, Residual Bootstrapping, and Probe-and-Switch&lt;/h2&gt;
&lt;div id="S4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Following the depth-over-fidelity spirit, our method implements &lt;em class="ltx_emph ltx_font_italic"&gt;selection-stage uncertainty integration&lt;/em&gt;: keep the baseline per-generation cost close to one evaluation per candidate, and spend a small capped number of additional evaluations to estimate how ranking noise should be integrated into the rank-weighted update. Concretely, we (i) define a principal target update via &lt;em class="ltx_emph ltx_font_italic"&gt;probabilistic elite membership&lt;/em&gt; (PEM), (ii) estimate PEM by &lt;em class="ltx_emph ltx_font_italic"&gt;residual bootstrapping&lt;/em&gt; with per-generation cost $C_{t}=\lambda+K_{t}$ and $K_{t}\leq K_{\max}\ll\lambda$, and (iii) avoid unnecessary overhead in low-misranking regimes following a &lt;em class="ltx_emph ltx_font_italic"&gt;probe-and-switch&lt;/em&gt; rule.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S4.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="probabilistic-elite-membership-pem"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;4.1 &lt;/span&gt;Probabilistic Elite Membership (PEM)&lt;/h3&gt;
&lt;div id="S4.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For a generation $t$ and the sampled candidates $x_{t,1:\lambda}$, noisy values $y_{t,1:\lambda}$ induce random ranks
$r_{t,i}=\operatorname{rank}_{i}(y_{t,1:\lambda})$  (&lt;a href="#A1.E29" title="In Appendix A CMA-ES Specification ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;29&lt;/span&gt;&lt;/a&gt;).
Standard rank-based CMA-ES updates use deterministic weights $w(r_{t,i})$, therefore the update direction is random even
conditional on $x_{t,1:\lambda}$ (Section &lt;a href="#S3.SS3" title="3.3 Noisy Evaluation and Misranking ‣ 3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We define the PEM of candidate $i$ as the conditional expectation of its rank weight given
candidates:&lt;/p&gt;
&lt;table id="S4.E18" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$w_{t,i}^{\star}\;:=\;\mathbb{E}\!\left[w(r_{t,i})\mid x_{t,1:\lambda}\right].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(18)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;For the canonical top-$\mu$ truncation weights $w(r)=\frac{1}{\mu}\mathbf{1}\{r\leq\mu\}$, this has the probabilistic
interpretation&lt;/p&gt;
&lt;table id="S4.Ex2" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$w_{t,i}^{\star}\;=\;\frac{1}{\mu}\Pr\!\left(r_{t,i}\leq\mu\,\middle|\,x_{t,1:\lambda}\right),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;i.e., candidates near the truncation receive fractional membership proportional to their probability of being selected. More generally, with $w_{k}:=w(k)$, $\delta_{k}:=w_{k}-w_{k+1}$, and $p_{t,i,k}:=\Pr(r_{t,i}\leq k\mid x_{t,1:\lambda})$,&lt;/p&gt;
&lt;table id="S4.E19" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$w_{t,i}^{\star}=w_{\lambda}+\sum_{k=1}^{\lambda-1}\delta_{k}\,p_{t,i,k}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(19)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Thus PEM is a weighted superposition of top-$k$ membership probabilities; for logarithmic weights, the largest adjacent drops occur at the very top of the ranking rather than only at the truncation boundary.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Let the one-step mean increment under a single noisy ranking be
$\Delta m_{t}(y):=\eta_{m}\sum_{i=1}^{\lambda}w(r_{t,i})(x_{t,i}-m_{t})$, so that (&lt;a href="#A1.E30" title="In Appendix A CMA-ES Specification ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;30&lt;/span&gt;&lt;/a&gt;) becomes
$m_{t+1}=m_{t}+\Delta m_{t}(y)$.
PEM replaces the stochastic weights $w(r_{t,i})$ by $w_{t,i}^{\star}$:&lt;/p&gt;
&lt;table id="S4.E20" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Delta m_{\text{PEM},t}\;:=\;\eta_{m}\sum_{i=1}^{\lambda}w_{t,i}^{\star}(x_{t,i}-m_{t}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(20)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;This update is deterministic for given $x_{t,1:\lambda}$ and integrates over ranking uncertainty.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmlemma1" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 1&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmlemma1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;For the standard rank-based mean increment $\Delta m_{t}(y)$ defined above,&lt;/span&gt;&lt;/p&gt;
&lt;table id="S4.E21" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\!\left[\Delta m_{t}(y)\mid x_{t,1:\lambda}\right]\;=\;\Delta m_{\mathrm{PEM},t}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(21)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof sketch.&lt;/h6&gt;
&lt;div id="S4.SS1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Conditioning on $x_{t,1:\lambda}$ makes $(x_{t,i}-m_{t})$ deterministic; then taking conditional expectations linearly replaces $w(r_{t,i})$ by $\mathbb{E}[w(r_{t,i})\mid x_{t,1:\lambda}]=w_{t,i}^{\star}$.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S4.SS1.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;CMA-ES state updates depend on $y_{t,1:\lambda}$ only through rank-weighted statistics ((&lt;a href="#A1.E32" title="In Appendix A CMA-ES Specification ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;32&lt;/span&gt;&lt;/a&gt;)–(&lt;a href="#A1.E34" title="In Appendix A CMA-ES Specification ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;34&lt;/span&gt;&lt;/a&gt;)). In our implementation, PEM is applied by replacing each occurrence of $w(r_{t,i})$ with an estimate of $w_{t,i}^{\star}$.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S4.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="residual-bootstrapped-pem-rb-pem"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;4.2 &lt;/span&gt;Residual Bootstrapped PEM (RB-PEM)&lt;/h3&gt;
&lt;div id="S4.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Computing PEM $w_{t,i}^{\star}$ exactly would require extensive reevaluations per candidate, risking depth collapse (&lt;a href="#S3.E13" title="In 3.4 Mainstream Noise Handling under Fixed Budgets: Fidelity over Depth ‣ 3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;13&lt;/span&gt;&lt;/a&gt;). Residual bootstrapping estimates
$w_{t,i}^{\star}$ with a capped reevaluation budget per generation as (&lt;a href="#S3.E16" title="In 3.5 Depth over Fidelity: A Fixed-Budget Principle ‣ 3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;16&lt;/span&gt;&lt;/a&gt;), in which $K_{t}\leq K_{\max}\ll\lambda$ counts only additional reevaluations used to calibrate the bootstrap noise model. As shown by (&lt;a href="#S3.E17" title="In 3.5 Depth over Fidelity: A Fixed-Budget Principle ‣ 3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;17&lt;/span&gt;&lt;/a&gt;), this keeps the depth close to $B/\lambda$ whenever $\mathbb{E}[K_{t}]\ll\lambda$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;In Bayesian context, $w_{t,i}^{\star}$ is a posterior expectation of a rank weight under the local evaluation-noise law. A parametric Bayesian alternative would sample latent values from a fitted likelihood/posterior, rank them, and average $w(\cdot)$ over those ranks. RB-PEM uses the same Monte Carlo structure, but draws synthetic values from a nonparametric residual pool. This avoids specifying a likelihood for non-Gaussian, heteroscedastic, or state-dependent noise, amortizes noise information across generations, and uses the same bootstrap rankings for any choice of $w$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S4.SS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;In practice, residual bootstrapping combines two complementary design principles aligned with the fixed-budget protocol, see Appendix &lt;a href="#A2" title="Appendix B Residual Bootstrapping Implementation Details ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;B&lt;/span&gt;&lt;/a&gt; for details of implementation. Note that residual bootstrapping could have statistical risk of &lt;em class="ltx_emph ltx_font_italic"&gt;residual-pool mismatch&lt;/em&gt; due to finite pool size, nonstationary drift, covariate-dependent shape changes, or misspecified center/scale standardization. A convenient way to quantify mismatch is the Wasserstein-1 distance $W_{1}(\widehat{D}_{t},D_{t})$ between the pool and a target distribution $D_{t}$. Detailed diagnostics and mismatch decompositions are deferred to Appendix &lt;a href="#A3" title="Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;C&lt;/span&gt;&lt;/a&gt;. Empirical
tests can be found in Appendix &lt;a href="#A6" title="Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;F&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S4.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="probe-and-switch"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;4.3 &lt;/span&gt;Probe-and-Switch&lt;/h3&gt;
&lt;div id="S4.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Residual bootstrapping is designed for &lt;em class="ltx_emph ltx_font_italic"&gt;high-misranking&lt;/em&gt; regimes. When the ranking is already stable, smoothing can weaken selection pressure and the reevaluation budget $K_{t}$ becomes overhead. We therefore use a low-cost probe to decide whether to run RB-PEM or to run standard CMA-ES. See Appendix &lt;a href="#A4" title="Appendix D Decision-Theoretic Analysis for Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;D&lt;/span&gt;&lt;/a&gt; for details.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S5" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="theory"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;5 &lt;/span&gt;Theory&lt;/h2&gt;
&lt;div id="S5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This section sets a theoretical foundation for our method, which clearly shows the following:
(i) &lt;span class="ltx_text ltx_font_smallcaps"&gt;PEM&lt;/span&gt; can be viewed as a &lt;em class="ltx_emph ltx_font_italic"&gt;Rao–Blackwellization&lt;/em&gt; &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Lehmann and Casella (&lt;a href="#bib.bib65" title="Theory of point estimation" class="ltx_ref"&gt;1998&lt;/a&gt;); Casella and Berger (&lt;a href="#bib.bib64" title="Statistical inference" class="ltx_ref"&gt;2002&lt;/a&gt;)&lt;/cite&gt; of the standard noisy rank-based update; (ii) under &lt;em class="ltx_emph ltx_font_italic"&gt;local curvature&lt;/em&gt;, conditional update dispersion incurs an inevitable expected objective loss; (iii) RB-PEM is effective whenever the residual pool distribution is close (in $W_{1}$) to the local standardized noise distribution and &lt;em class="ltx_emph ltx_font_italic"&gt;near ties&lt;/em&gt; are rare.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="S5.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="pem-as-the-conditional-mean-update"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.1 &lt;/span&gt;PEM as the Conditional Mean Update&lt;/h3&gt;
&lt;div id="S5.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Lemma &lt;a href="#Thmlemma1" title="Lemma 1. ‣ 4.1 Probabilistic Elite Membership (PEM) ‣ 4 Method: PEM, Residual Bootstrapping, and Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; already states the key identity:
$\Delta m_{\mathrm{PEM}}=\mathbb{E}[\Delta m(y)\mid x_{1:\lambda}]$.
This identity can be simply viewed as a Rao–Blackwellization with respect to evaluation noise:
conditioning on the candidate set integrates out ranking randomness without changing the conditional mean update.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmlemma2" class="ltx_theorem ltx_theorem_lemma"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Lemma 2&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmlemma2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $\Delta m(y)\in\mathbb{R}^{d}$ be any square-integrable random update and let $\mathcal{G}:=\sigma(x_{1:\lambda})$ be the $\sigma$-field generated by the sampled candidates.
Then among all $\mathcal{G}$-measurable (candidate-deterministic) vectors $a(x_{1:\lambda})$,&lt;/span&gt;&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A6.EGx2"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S5.Ex3"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="S5.E22"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\displaystyle\Delta m_{\mathrm{PEM}}=\mathbb{E}[\Delta m(y)\mid\mathcal{G}] \displaystyle= \displaystyle\arg\min_{a\in\mathcal{G}\text{-measurable}}\mathbb{E}\!\left[\|\Delta m(y)-a\|^{2}\mid\mathcal{G}\right].$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;(22)&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S5.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="update-dispersion-induces-curvature-loss"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.2 &lt;/span&gt;Update Dispersion Induces Curvature Loss&lt;/h3&gt;
&lt;div id="S5.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The next result quantifies how evaluation noise manifests itself as &lt;em class="ltx_emph ltx_font_italic"&gt;curvature loss&lt;/em&gt;: even when the conditional mean update is unchanged, a dispersed (random) update incurs extra expected objective value in a locally curved region.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmtheorem1" class="ltx_theorem ltx_theorem_theorem"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theorem 1&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmtheorem1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $X=m+\Delta m(y)$ and $\bar{X}=\mathbb{E}[X\mid x_{1:\lambda}]=m+\Delta m_{\mathrm{PEM}}$.
Then under Assumption &lt;a href="#Thmassumption1" title="Assumption 1 (Localized strong convexity with localization). ‣ C.2 From Distribution Mismatch to PEM ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; (Appendix &lt;a href="#A3" title="Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;C&lt;/span&gt;&lt;/a&gt;),&lt;/span&gt;&lt;/p&gt;
&lt;table id="S5.E23" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}\left[f(X)\mid x_{1:\lambda}\right]\geq f(\bar{X})+\frac{\alpha}{2}\,\mathbb{E}\!\left[\|X-\bar{X}\|^{2}\mid x_{1:\lambda}\right].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(23)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="S5.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Theorem &lt;a href="#Thmtheorem1" title="Theorem 1. ‣ 5.2 Update Dispersion Induces Curvature Loss ‣ 5 Theory ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; shows that,
under the strong-convexity Assumption &lt;a href="#Thmassumption1" title="Assumption 1 (Localized strong convexity with localization). ‣ C.2 From Distribution Mismatch to PEM ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;, dispersion incurs a Jensen gap (see the proof in Appendix &lt;a href="#A5" title="Appendix E Additional Theory Details ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;E&lt;/span&gt;&lt;/a&gt;). Note that for $\alpha=0$ (mere convexity), Theorem &lt;a href="#Thmtheorem1" title="Theorem 1. ‣ 5.2 Update Dispersion Induces Curvature Loss ‣ 5 Theory ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; reduces to the conditional Jensen inequality
$\mathbb{E}[f(X)\mid x_{1:\lambda}]\geq f(\bar{X})$. Equation (&lt;a href="#S5.E23" title="In Theorem 1. ‣ 5.2 Update Dispersion Induces Curvature Loss ‣ 5 Theory ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;23&lt;/span&gt;&lt;/a&gt;) says that even if a noisy rank-based strategy has the same conditional mean update as PEM, its conditional dispersion still creates an inevitable &lt;em class="ltx_emph ltx_font_italic"&gt;expected objective penalty&lt;/em&gt;.
This turns “ranking noise” into an explicit per-generation loss term proportional to $\mathbb{E}[\|X-\bar{X}\|^{2}\mid x_{1:\lambda}]$.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S5.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="fixed-budget-prediction-per-evaluation-dispersion-matters"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.3 &lt;/span&gt;Fixed-Budget Prediction: Per-Evaluation Dispersion Matters&lt;/h3&gt;
&lt;div id="S5.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We now translate Theorem &lt;a href="#Thmtheorem1" title="Theorem 1. ‣ 5.2 Update Dispersion Induces Curvature Loss ‣ 5 Theory ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; into a fixed-budget comparison. The key point is that, under the fixed-budget protocol, dispersion per evaluation outweighs dispersion per generation. Theorem &lt;a href="#Thmtheorem1" title="Theorem 1. ‣ 5.2 Update Dispersion Induces Curvature Loss ‣ 5 Theory ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; shows that, on a region where $f$ is locally $\alpha$-strongly convex,
conditional update dispersion produces a local expected objective penalty of at least
$\frac{\alpha}{2}\mathbb{E}[\|X-\bar{X}\|^{2}\mid x_{1:\lambda}]$ in that generation.
Proposition &lt;a href="#Thmproposition1" title="Proposition 1. ‣ C.1 Fixed-Budget Condition (“Money Plot” Prediction) ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; in Appendix &lt;a href="#A3" title="Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;C&lt;/span&gt;&lt;/a&gt; shows that any additional reevaluation overhead reduces depth $T$ under a fixed budget.
Consequently, in strictly fixed-budget regimes, the relevant efficiency notion is how much conditional dispersion is reduced &lt;em class="ltx_emph ltx_font_italic"&gt;per additional oracle call&lt;/em&gt;.
Our approach targets dispersion reduction by integrating ranking uncertainty at the selection stage via PEM,
while keeping the reevaluation overhead $K_{t}$ capped and reusable.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S5.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="residual-bootstrapping-approximation-of-pem"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.4 &lt;/span&gt;Residual Bootstrapping Approximation of PEM&lt;/h3&gt;
&lt;div id="S5.SS4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Residual bootstrapping approximates $w_{i}^{\star}=\mathbb{E}[w(r_{i})\mid x_{1:\lambda}]$ by simulating many pseudo-rankings from a fitted noise model.
This subsection makes explicit when this approximation is accurate.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S5.SS4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Let $w:\{1,\ldots,\lambda\}\to\mathbb{R}$ be the deterministic rank-weight map, and define
$\|w\|_{\infty}:=\max_{k}|w(k)|$ and $\Delta_{w}:=\max_{k}|w(k+1)-w(k)|$.
For a fixed candidate set $\{x_{1:\lambda}\}$, define the “true” expected rank weight under $D_{t}$ similarly with (&lt;a href="#S4.E18" title="In 4.1 Probabilistic Elite Membership (PEM) ‣ 4 Method: PEM, Residual Bootstrapping, and Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;18&lt;/span&gt;&lt;/a&gt;) as&lt;/p&gt;
&lt;table id="S5.Ex4" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$w_{i}^{\star} = \mathbb{E}\!\left[w\!\left(\operatorname{rank}_{i}(y_{1:\lambda})\right)\middle|x_{1:\lambda}\right],$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and define the analogous bootstrap expectation&lt;/p&gt;
&lt;table id="S5.Ex5" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\widetilde{w}_{i} = \mathbb{E}\!\left[w\!\left(\operatorname{rank}_{i}(\tilde{y}_{1:\lambda})\right)\middle|x_{1:\lambda}\right],\quad\tilde{y}_{i}:=f(x_{i})+s(x_{i})\,\hat{\varepsilon}_{i}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="S5.SS4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The key difficulty is that ranks are discontinuous functions of the noise vector.
In Appendix &lt;a href="#A3" title="Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;C&lt;/span&gt;&lt;/a&gt;, under reasonable assumptions (Assumption &lt;a href="#Thmassumption2" title="Assumption 2 (Standing noise factorization). ‣ C.2 From Distribution Mismatch to PEM ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; and &lt;a href="#Thmassumption3" title="Assumption 3 (Anti-concentration of pairwise gaps). ‣ C.2 From Distribution Mismatch to PEM ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;), Proposition &lt;a href="#Thmproposition2" title="Proposition 2. ‣ C.2 From Distribution Mismatch to PEM ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; reduces RB-PEM inaccuracy to the Wasserstein mismatch $W_{1}(\widehat{D}_{t},D_{t})$. Then Proposition &lt;a href="#Thmproposition3" title="Proposition 3. ‣ C.3 Adaptive Residual Pool Concentration ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; shows how this mismatch decomposes into a finite-pool term plus three bias terms. Combined with Proposition &lt;a href="#Thmproposition4" title="Proposition 4. ‣ C.4 A Drift-Aware Mismatch Decomposition (Four Observable Terms) ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;, this yields a concrete checkable route from residual-pool mismatch to expected-weight error. Together with Theorem &lt;a href="#Thmtheorem1" title="Theorem 1. ‣ 5.2 Update Dispersion Induces Curvature Loss ‣ 5 Theory ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;, this supports the depth-over-fidelity mechanism: under fixed budgets, a small additive overhead $K_{t}$ is worthwhile precisely when it reduces conditional update dispersion enough to offset its cost.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S5.SS5" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="decision-theory-for-probe-and-switch"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;5.5 &lt;/span&gt;Decision Theory for Probe-and-Switch&lt;/h3&gt;
&lt;div id="S5.SS5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Define the conditional advantage of RB-PEM over CMA-ES given probe value $p$ as&lt;/p&gt;
&lt;table id="S5.E24" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Delta(p)\;\triangleq\;\mathbb{E}[L_{0}-L_{1}\mid P=p].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(24)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Thus, $\Delta(p)&amp;gt;0$ means RB-PEM has lower conditional expected loss. Proposition &lt;a href="#Thmproposition5" title="Proposition 5. ‣ Appendix D Decision-Theoretic Analysis for Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; of Appendix &lt;a href="#A4" title="Appendix D Decision-Theoretic Analysis for Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;D&lt;/span&gt;&lt;/a&gt; indicates that wherever $\Delta(p)$ has sign alternating provides a potential switch threshold.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S6" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="experiments"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;6 &lt;/span&gt;Experiments&lt;/h2&gt;
&lt;section id="S6.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="experimental-setup"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;6.1 &lt;/span&gt;Experimental Setup&lt;/h3&gt;
&lt;div id="S6.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;All comparisons follow the fixed $B$ budget accounting of (&lt;a href="#S3.E3" title="In 3.2 Fixed-Budget Protocol ‣ 3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;).
Performance is measured by the simple regret (&lt;a href="#S3.E4" title="In 3.2 Fixed-Budget Protocol ‣ 3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;) of the final
recommendation $\hat{x}_{B}$.
We report $\log_{10}(f(\hat{x}_{B})-f^{\star})$ throughout, where smaller values indicate better performance.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Our primary benchmark is the &lt;span class="ltx_text ltx_font_typewriter"&gt;bbob-noisy&lt;/span&gt; suite from COCO, comprising 30 functions
$\times$ 15 instances $\times$ 3 dimensions ($d\in\{10,20,40\}$), yielding 450 problem
instances per dimension.
Unless otherwise stated, we use the default CMA-ES population size
$\lambda=4+\lfloor 3\ln d\rfloor$ (giving $\lambda{=}15$, $\mu{=}7$ at $d{=}40$) and identical initialization across methods. RB-PEM uses bootstrap size $B_{\mathrm{boot}}{=}32$ and reevaluation cap $K_{\max}{=}1$ throughout.
Table &lt;a href="#S6.T1" title="Table 1 ‣ 6.5 Comprehensive Comparison ‣ 6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; reports aggregate win/loss counts on all 30 functions
at $B=200d$; following the probe-statistic clustering rule (Appendix &lt;a href="#A6.SS12" title="F.12 Complete Results on High-Misranking COCO Functions ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;F.12&lt;/span&gt;&lt;/a&gt;),
Figures &lt;a href="#S6.F1" title="Figure 1 ‣ 6.2 Main Results on COCO bbob-noisy ‣ 6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;–&lt;a href="#S6.F2" title="Figure 2 ‣ 6.3 Depth–Fidelity Trade-off ‣ 6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; and the appendix ablations focus on a
high-misranking subset of 15 functions at $d=40$ with $B=100d$, where misranking dominates.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Baselines include:
(i) vanilla CMA-ES; (ii) fixed-$k$ resampling (Res.($k$)) with $k\in\{5,10\}$; (iii) UH-CMA-ES; and (iv) RB-PEM. There are six external tasks with 50 random seeds each: LQR control, Breast Cancer classification, Digits recognition, CartPole-HT (heavy-tailed),
standard CartPole, and Pendulum (Table &lt;a href="#S6.T1" title="Table 1 ‣ 6.5 Comprehensive Comparison ‣ 6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S6.SS1.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Reproducibility&lt;/span&gt;. We provide one-click reproducible source code at &lt;a href="https://github.com/sichen-wang/Depth-over-Fidelity_ICML2026" title="" class="ltx_ref ltx_url ltx_font_typewriter"&gt;https://github.com/sichen-wang/Depth-over-Fidelity_ICML2026&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S6.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="main-results-on-coco-bbob-noisy"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;6.2 &lt;/span&gt;Main Results on COCO bbob-noisy&lt;/h3&gt;
&lt;div id="S6.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Figure &lt;a href="#S6.F1" title="Figure 1 ‣ 6.2 Main Results on COCO bbob-noisy ‣ 6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; presents fixed-budget convergence curves on four representative
&lt;span class="ltx_text ltx_font_typewriter"&gt;bbob-noisy&lt;/span&gt; functions, showing that RB-PEM achieves substantially lower final
regret than evaluation-stage denoising baselines while maintaining near-maximal depth.
A key observation is that depth markers are almost non-overlapping across methods:
in these high-misranking regimes, greater depth strongly correlates with better final performance,
supporting our depth-over-fidelity thesis.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="S6.F1" class="ltx_figure"&gt;&lt;img style="width:79%" width="518" height="341" loading="lazy" src="figure1_money_plot.svg" id="S6.F1.g1" class="ltx_graphics ltx_centering " alt="Refer to caption"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Figure 1&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;RB-PEM improves fixed-budget progress on COCO &lt;span class="ltx_text ltx_font_typewriter"&gt;bbob-noisy&lt;/span&gt;.&lt;span class="ltx_text ltx_font_medium"&gt;
Median (solid) and interquartile range (shaded) of $\log_{10}(f(\hat{x})-f^{\star})$ versus evaluations on four representative high-misranking functions (f110, f113, f116, f125; $d=40$, $B=100d$, 15 instances each).
Right-side markers indicate the number of completed CMA-ES generations (depth).
Methods that preserve depth (CMA-ES, RB-PEM) generally achieve lower final regret; among these, RB-PEM further improves by integrating ranking uncertainty at the selection stage rather than spending evaluations on per-candidate denoising.
Evaluation-stage baselines (Resample, UH-CMA-ES) sacrifice depth for per-generation fidelity, resulting in higher final regret despite cleaner intra-generation rankings.
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; Each of the 15 COCO instances is run once per method (no repeated seeds); lines show the median and shading spans the 25th–75th percentile (IQR) across instances.&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/section&gt;
&lt;section id="S6.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="depthfidelity-trade-off"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;6.3 &lt;/span&gt;Depth–Fidelity Trade-off&lt;/h3&gt;
&lt;figure id="S6.F2" class="ltx_figure"&gt;&lt;img style="width:79%" width="232" height="167" loading="lazy" src="figure2_depth_fidelity_bubble.svg" id="S6.F2.g1" class="ltx_graphics ltx_centering " alt="Refer to caption"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Figure 2&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Depth–fidelity trade-off under a fixed budget.&lt;span class="ltx_text ltx_font_medium"&gt;
Each method is plotted by its average per-candidate evaluation cost (fidelity, $x$-axis) and number of completed generations (depth, $y$-axis) on the high-misranking COCO &lt;span class="ltx_text ltx_font_typewriter"&gt;bbob-noisy&lt;/span&gt; subset ($d=40$, $B=100d$, 225 problems = 15 functions $\times$ 15 instances).
Bubble annotations encode the median final $\log_{10}$ regret (smaller is better).
The grey hyperbola marks the budget constraint $\text{depth}\times\text{cost}\approx B/\lambda$: higher fidelity necessarily reduces depth.
RB-PEM achieves the lowest regret while remaining in the low-cost / high-depth region, supporting the thesis that selection-stage uncertainty integration is more sample-efficient than evaluation-stage denoising under strict budgets.
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; Each instance is run once per method; each bubble represents one method and its annotation reports the median final regret across all 225 instances.&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div id="S6.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Figure &lt;a href="#S6.F2" title="Figure 2 ‣ 6.3 Depth–Fidelity Trade-off ‣ 6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; confirms the depth–fidelity trade-off of Section &lt;a href="#S3.SS4" title="3.4 Mainstream Noise Handling under Fixed Budgets: Fidelity over Depth ‣ 3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.4&lt;/span&gt;&lt;/a&gt; empirically: under a fixed budget the baselines spread along the depth–fidelity frontier, and RB-PEM occupies the low-cost/high-depth corner that minimizes regret.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="S6.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="probe-and-switch-evaluation"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;6.4 &lt;/span&gt;Probe-and-Switch Evaluation&lt;/h3&gt;
&lt;div id="S6.SS4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Figure &lt;a href="#S6.F3" title="Figure 3 ‣ 6.4 Probe-and-Switch Evaluation ‣ 6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; shows RB-PEM excelling under severe ranking noise (e.g., heavy-tailed RL rollouts, noisy HPO) but slipping below vanilla CMA-ES on low-misranking tasks, where its extra smoothing and reevaluations become unnecessary overhead—motivating an adaptive policy.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="S6.F3" class="ltx_figure"&gt;&lt;img style="width:77%" width="377" height="268" loading="lazy" src="figure3a_ranking.svg" id="S6.F3.g1" class="ltx_graphics ltx_centering " alt="Refer to caption"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Figure 3&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Task-level algorithm ranking&lt;span class="ltx_text ltx_font_medium"&gt; (1 = best).
Median rank across instances for each method (columns) on each task (rows): 15 high-misranking COCO &lt;span class="ltx_text ltx_font_typewriter"&gt;bbob-noisy&lt;/span&gt; functions and six external tasks ($d=40$, $B=100d$ for COCO; task-specific budgets otherwise; darker is better).
RB-PEM ranks first on most high-misranking tasks but underperforms CMA-ES on low-misranking tasks (e.g., CartPole, Pendulum), where the bootstrap overhead outweighs the smoothing benefit.
This pattern motivates probe-and-switch (Section &lt;a href="#S5.SS5" title="5.5 Decision Theory for Probe-and-Switch ‣ 5 Theory ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.5&lt;/span&gt;&lt;/a&gt;).
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; 1 run per COCO instance (15 each), 50 seeds per external task (Appendix: per-task budgets/noise); ranks use each task’s median objective.&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div id="S6.SS4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We verify that the high-misranking subset used in
Figures &lt;a href="#S6.F1" title="Figure 1 ‣ 6.2 Main Results on COCO bbob-noisy ‣ 6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;–&lt;a href="#S6.F3" title="Figure 3 ‣ 6.4 Probe-and-Switch Evaluation ‣ 6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; is not a post-hoc
selection: Figure &lt;a href="#S6.F4" title="Figure 4 ‣ 6.4 Probe-and-Switch Evaluation ‣ 6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; sorts all 30 &lt;span class="ltx_text ltx_font_typewriter"&gt;bbob-noisy&lt;/span&gt;
functions by the probe statistic $P$ and reveals a sharply bimodal structure
(gap $0.145$, $\approx 3\times$ either cluster’s width) that yields the same
partition for any $\tau_{\text{cluster}}\in[0.16,0.29]$. The probe also
predicts &lt;em class="ltx_emph ltx_font_italic"&gt;when&lt;/em&gt; uncertainty integration helps: RB-PEM and Probe-and-Switch
lead on the high-misranking cluster but stay within roughly one rank of the
others on the low-misranking cluster.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="S6.F4" class="ltx_figure"&gt;&lt;img style="width:90%" width="414" height="207" loading="lazy" src="figure_rank_by_probe.svg" id="S6.F4.g1" class="ltx_graphics ltx_centering " alt="Refer to caption"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Figure 4&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Per-function ranking across all 30 &lt;span class="ltx_text ltx_font_typewriter"&gt;bbob-noisy&lt;/span&gt;
functions reveals a bimodal misranking structure that defines the
high-misranking subset.&lt;span class="ltx_text ltx_font_medium"&gt;
Mean rank (1 = best) of five methods, sorted by the median probe statistic
$P$ (Eq. (&lt;a href="#A4.E56" title="In Appendix D Decision-Theoretic Analysis for Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;56&lt;/span&gt;&lt;/a&gt;)). The $P$-values are sharply bimodal:
14 &lt;em class="ltx_emph ltx_font_italic"&gt;low-misranking&lt;/em&gt; functions cluster in $P\in[0.00,0.15]$ (left) and
15 &lt;em class="ltx_emph ltx_font_italic"&gt;high-misranking&lt;/em&gt; ones in $P\in[0.30,0.35]$ (right), separated by a
gap of $0.145$ ($\approx 3\times$ either cluster’s width), so any threshold
$\tau_{\text{cluster}}\in[0.16,0.29]$ produces the same partition.
RB-PEM and Probe-and-Switch rank first or second on the
high-misranking cluster, while LRA-CMA-ES and UH-CMA-ES trail; on the
low-misranking cluster all five methods are within roughly one rank.
We exclude f107 (high $P$ from step-ellipsoidal structure, not noise);
the remaining 15 functions are the subset used in
Figures &lt;a href="#S6.F1" title="Figure 1 ‣ 6.2 Main Results on COCO bbob-noisy ‣ 6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;–&lt;a href="#S6.F3" title="Figure 3 ‣ 6.4 Probe-and-Switch Evaluation ‣ 6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; and the appendix ablations.
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; $B{=}100d$; mean rank averaged over
$d\in\{10,20,40\}\times 15$ instances per function. Probe $P$ computed at
$d{=}40$ from 20 ES-sampled candidate sets with $(\lambda,\mu)=(32,8)$.&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div id="S6.SS4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Figure &lt;a href="#S6.F5" title="Figure 5 ‣ 6.4 Probe-and-Switch Evaluation ‣ 6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; plots the conditional advantage
$\Delta(p)=\mathbb{E}[L_{0}-L_{1}\mid P=p]$ against the probe statistic $P$.
The curve exhibits approximate &lt;em class="ltx_emph ltx_font_italic"&gt;single crossing&lt;/em&gt;—$\Delta(p)&amp;lt;0$ for small $P$ (stable ranks) and $\Delta(p)&amp;gt;0$ beyond a threshold—which
enables a &lt;span class="ltx_text ltx_font_bold"&gt;probe-and-switch&lt;/span&gt; policy: route tasks with $P\geq\tau$ ($\tau=0.12$) to RB-PEM and
the rest to CMA-ES, yielding purely positive improvement under the model of
Section &lt;a href="#S5.SS5" title="5.5 Decision Theory for Probe-and-Switch ‣ 5 Theory ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5.5&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="S6.F5" class="ltx_figure"&gt;&lt;img style="width:86%" width="235" height="164" loading="lazy" src="figure3b_single_crossing.svg" id="S6.F5.g1" class="ltx_graphics ltx_centering " alt="Refer to caption"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Figure 5&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Conditional advantage and single crossing.&lt;span class="ltx_text ltx_font_medium"&gt;
Estimated $\Delta(p)=\mathbb{E}[L_{\mathrm{CMA}}-L_{\mathrm{RB\text{-}PEM}}\mid P=p]$ vs. the probe statistic $P$ (normalized rank disagreement, Eq. (&lt;a href="#A4.E56" title="In Appendix D Decision-Theoretic Analysis for Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;56&lt;/span&gt;&lt;/a&gt;)) on all 30 COCO &lt;span class="ltx_text ltx_font_typewriter"&gt;bbob-noisy&lt;/span&gt; functions ($d=40$, $B=500d$); positive $\Delta$ favors RB-PEM.
The curve crosses zero once near $\tau=0.12$ (dashed line), giving a threshold rule (RB-PEM when $P\geq\tau$, else CMA-ES) that is Bayes-optimal under single crossing (Proposition &lt;a href="#Thmproposition5" title="Proposition 5. ‣ Appendix D Decision-Theoretic Analysis for Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;).
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; 450 problems (30 functions $\times$ 15 instances), 1 run each; bin means over 12 quantile bins, error bars $\pm 1.96\,\mathrm{SE}$ (95% CI).&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div id="S6.SS4.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Scanning thresholds on COCO identifies two robust operating points: an aggressive $\tau=0.12$ (switch more often) and a conservative $\tau=0.22$ (switch only under strong misranking evidence).
Figure &lt;a href="#S6.F6" title="Figure 6 ‣ 6.4 Probe-and-Switch Evaluation ‣ 6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt; shows these COCO-calibrated thresholds transfer reasonably to external tasks, though new domains may warrant re-tuning.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="S6.F6" class="ltx_figure"&gt;&lt;img style="width:86%" width="233" height="181" loading="lazy" src="figure3c_transfer.svg" id="S6.F6.g1" class="ltx_graphics ltx_centering " alt="Refer to caption"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Figure 6&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Threshold transfer to external tasks.&lt;span class="ltx_text ltx_font_medium"&gt;
Regret reduction of Probe-and-Switch relative to CMA-ES on nine transfer targets (COCO and external), using COCO-calibrated thresholds $\tau\in\{0.12,\,0.22\}$ without per-task re-tuning.
The aggressive $\tau=0.12$ activates RB-PEM more often, yielding larger reductions on high-misranking tasks (e.g., LQR, MLP), while the conservative $\tau=0.22$ mitigates negative transfer on low-misranking ones (e.g., HPO, Pendulum).
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; mean regret reduction per target (over instances/seeds), ordered by $\Delta(\tau{=}0.12)$; 1 run per COCO instance, 50 seeds per external task.&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/section&gt;
&lt;section id="S6.SS5" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="comprehensive-comparison"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;6.5 &lt;/span&gt;Comprehensive Comparison&lt;/h3&gt;
&lt;div id="S6.SS5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Table &lt;a href="#S6.T1" title="Table 1 ‣ 6.5 Comprehensive Comparison ‣ 6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; reports pairwise win/loss counts for probe-and-switch against each competitor across COCO and six external tasks. It wins decisively against all evaluation-stage baselines (Res.(10), Res.(5), UH-CMA-ES; all above 77%) and holds a moderate advantage over its constituent algorithms (CMA-ES, RB-PEM), indicating that the switch reliably activates the beneficial mode without unnecessary overhead. Its significance against CMA-ES strengthens with dimension, consistent with misranking becoming more problematic in higher dimensions; on external tasks it tracks RB-PEM under high rank instability and defaults to CMA-ES otherwise.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="S6.T1" class="ltx_table"&gt;
&lt;table class="ltx_tabular ltx_centering ltx_align_middle"&gt;
&lt;tbody class="ltx_tbody"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_border_tt" style="padding:0.35pt 2.8pt;"&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_tt" style="padding:0.35pt 2.8pt;" colspan="2"&gt;
&lt;span class="ltx_inline-block"&gt;
&lt;span class="ltx_p"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;vs&lt;/span&gt;&lt;/span&gt;
&lt;span class="ltx_p"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;Res.(10)&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_tt" style="padding:0.35pt 2.8pt;" colspan="2"&gt;
&lt;span class="ltx_inline-block"&gt;
&lt;span class="ltx_p"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;vs&lt;/span&gt;&lt;/span&gt;
&lt;span class="ltx_p"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;Res.(5)&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_tt" style="padding:0.35pt 2.8pt;" colspan="2"&gt;
&lt;span class="ltx_inline-block"&gt;
&lt;span class="ltx_p"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;vs&lt;/span&gt;&lt;/span&gt;
&lt;span class="ltx_p"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;UH-CMA-ES&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_tt" style="padding:0.35pt 2.8pt;" colspan="2"&gt;
&lt;span class="ltx_inline-block"&gt;
&lt;span class="ltx_p"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;vs&lt;/span&gt;&lt;/span&gt;
&lt;span class="ltx_p"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;CMA-ES&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_tt" style="padding:0.35pt 2.8pt;" colspan="2"&gt;
&lt;span class="ltx_inline-block"&gt;
&lt;span class="ltx_p"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;vs&lt;/span&gt;&lt;/span&gt;
&lt;span class="ltx_p"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;RB-PEM&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_left ltx_border_t" style="padding:0.35pt 2.8pt;" colspan="11"&gt;&lt;span class="ltx_text ltx_font_italic" style="font-size:70%;"&gt;COCO benchmark (30 functions $\times$ 15 instances per dim, $B=200d$)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;$d=10$&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;390&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;60&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;364&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;86&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;359&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;91&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;230&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;210&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;281&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_nopad_r ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;169&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;$d=20$&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;373&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;77&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;356&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;94&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;368&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;82&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;239&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;195&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;*&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;269&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_nopad_r ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;181&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;$d=40$&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;363&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;87&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;347&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;103&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;359&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;91&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;257&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;170&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;**&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;270&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_nopad_r ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;180&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_left ltx_border_t" style="padding:0.35pt 2.8pt;" colspan="11"&gt;&lt;span class="ltx_text ltx_font_italic" style="font-size:70%;"&gt;External tasks (50 seeds each)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;LQR&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;50&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;0&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;46&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;4&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;46&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;4&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;31&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;19&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;23/&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_nopad_r ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;27&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;Breast Cancer&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;50&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;0&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;37&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;13&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;25/&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;25&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;20/&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;29&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;22/&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_nopad_r ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;28&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;Digits&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;49&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;1&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;40&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;10&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;31&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;19&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;17/&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text" style="font-size:70%;"&gt;33&lt;/span&gt;&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;*&lt;/span&gt;&lt;/sup&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;17/&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_nopad_r ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text" style="font-size:70%;"&gt;33&lt;/span&gt;&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;*&lt;/span&gt;&lt;/sup&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;CartPole-HT&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;48&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;2&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;43&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;6&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;30&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;19&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;21/&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;23&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;20/&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_nopad_r ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;24&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;CartPole&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;44&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;6&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;36&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;14&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;**&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;26&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;24&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;19/&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;30&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;21/&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_nopad_r ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;27&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;Pendulum&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;46&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;4&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;38&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;11&lt;sup class="ltx_sup"&gt;&lt;span class="ltx_text ltx_font_medium"&gt;***&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;32&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;18&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;31&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;19&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;31&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_nopad_r ltx_align_left" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;19&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_left ltx_border_t" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;Total W/L&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right ltx_border_t" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;1413&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left ltx_border_t" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;237&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right ltx_border_t" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;1307&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left ltx_border_t" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;341&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right ltx_border_t" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;1276&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left ltx_border_t" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;373&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right ltx_border_t" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;865&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_align_left ltx_border_t" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;728&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_right ltx_border_t" style="padding:0.35pt 2.8pt;"&gt;
&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;954&lt;/span&gt;&lt;span class="ltx_text" style="font-size:70%;"&gt;/&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_l ltx_nopad_r ltx_align_left ltx_border_t" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;688&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_left ltx_border_bb" style="padding:0.35pt 2.8pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;Win Rate&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb" style="padding:0.35pt 2.8pt;" colspan="2"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;85.6%&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb" style="padding:0.35pt 2.8pt;" colspan="2"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;79.3%&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb" style="padding:0.35pt 2.8pt;" colspan="2"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;77.4%&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb" style="padding:0.35pt 2.8pt;" colspan="2"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;54.3%&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb" style="padding:0.35pt 2.8pt;" colspan="2"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:70%;"&gt;58.1%&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;figcaption class="ltx_caption ltx_centering" style="font-size:70%;"&gt;&lt;span class="ltx_tag ltx_tag_table"&gt;&lt;span class="ltx_text" style="font-size:129%;"&gt;Table 1&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:129%;"&gt;Probe-and-Switch vs. competitors&lt;span class="ltx_text ltx_font_medium"&gt;: pairwise win/loss (W/L) counts on COCO &lt;span class="ltx_text ltx_font_typewriter"&gt;bbob-noisy&lt;/span&gt; (30 functions $\times$ 15 instances per dim, $B=200d$, $d\in\{10,20,40\}$) and six external tasks (50 seeds each).
Bold indicates Probe-and-Switch wins ($W&amp;gt;L$).
Stars denote two-sided Wilcoxon signed-rank significance: &lt;sup class="ltx_sup"&gt;***&lt;/sup&gt;$p{&amp;lt;}0.001$, &lt;sup class="ltx_sup"&gt;**&lt;/sup&gt;$p{&amp;lt;}0.01$, &lt;sup class="ltx_sup"&gt;*&lt;/sup&gt;$p{&amp;lt;}0.05$.
Res.($k$): $k$-fold fixed resampling; RB-PEM: residual-bootstrap PEM without probe-and-switch.
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; Probe-and-Switch uses threshold $\tau{=}0.12$; each COCO instance is run once per method and each external task with 50 independent seeds.&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div id="S6.SS5.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Appendix &lt;a href="#A6" title="Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;F&lt;/span&gt;&lt;/a&gt; provides controlled mechanism checks:
(i) tests linking higher misranking to larger update dispersion and objective loss, and
(ii) ablations confirming RB-PEM’s persistent gain under tightly capped reevaluation, supporting the “selection-stage integration” interpretation.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="S7" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="conclusion"&gt;
&lt;span class="ltx_tag ltx_tag_section"&gt;7 &lt;/span&gt;Conclusion&lt;/h2&gt;
&lt;div id="S7.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;In strictly fixed-budget noisy black-box optimization, the cost of improving intra-generation ranking fidelity is paid
in reduced &lt;em class="ltx_emph ltx_font_italic"&gt;depth&lt;/em&gt;: every additional evaluation spent on denoising or resampling shortens the number of
distribution updates that can be executed before the budget is exhausted.
By making this accounting explicit, we formalized a depth–fidelity trade-off for noisy rank-based evolution
strategies and argued that, in high-misranking regimes, the lost depth can dominate the gains from per-generation
fidelity.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We operationalized &lt;em class="ltx_emph ltx_font_italic"&gt;selection-stage uncertainty integration&lt;/em&gt; as
&lt;em class="ltx_emph ltx_font_italic"&gt;probabilistic elite membership&lt;/em&gt; (PEM)—a Rao–Blackwellization of the
noisy rank-based update that replaces hard rank assignments with expected
rank weights, preserving the mean update while reducing its dispersion.
We approximated PEM at near-unit cost via &lt;em class="ltx_emph ltx_font_italic"&gt;residual-bootstrapped PEM&lt;/em&gt;
(RB-PEM), which calibrates a local noise model from a small capped reevaluation
set, amortized across generations via pooled residuals and backed by a
falsifiable mismatch decomposition and runtime diagnostics; a low-cost
&lt;em class="ltx_emph ltx_font_italic"&gt;probe-and-switch&lt;/em&gt; policy reverts to vanilla CMA-ES when ranks are stable.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Our theory clarifies why depth-preserving uncertainty integration can win: under local curvature, conditional update
dispersion induces an unavoidable expected objective penalty, making &lt;em class="ltx_emph ltx_font_italic"&gt;dispersion reduction per oracle call&lt;/em&gt; the
relevant efficiency metric in fixed-budget regimes.
Empirically, RB-PEM achieves consistently steeper fixed-budget progress on the COCO bbob-noisy suite and diverse
external tasks, outperforming evaluation-stage denoising baselines whose higher per-generation costs collapse depth,
while probe-and-switch improves robustness across regimes.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="S7.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Overall, the results support a testable thesis:
&lt;em class="ltx_emph ltx_font_italic"&gt;when budgets are strict and ranking uncertainty is high, integrating uncertainty into selection is more
sample-efficient than spending evaluations to eliminate it&lt;/em&gt;.
Promising directions include extending the residual model to correlated and nonstationary noise, and porting depth-over-fidelity to other population-based optimizers.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="ltx_pagination ltx_role_newpage"&gt;&lt;/div&gt;
&lt;/section&gt;
&lt;section id="Sx1" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="impact-statement"&gt;Impact Statement&lt;/h2&gt;
&lt;div id="Sx1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;RB-PEM enables noisy black-box optimizers to extract more progress from a fixed number of evaluations, which directly reduces the computational cost of tasks such as RL policy search with stochastic rollouts and hyperparameter optimization with noisy validation. As a general-purpose algorithmic improvement, it inherits the dual-use profile common to all black-box optimizers; we are not aware of any application-specific risks particular to our method.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="Sx2" class="ltx_section"&gt;
&lt;h2 class="ltx_title ltx_title_section" id="acknowledgments"&gt;Acknowledgments&lt;/h2&gt;
&lt;div id="Sx2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The first author would like to thank his parents for their unwavering support and encouragement; his algorithm competition coaches Wenwu Wang and Yuan Sun, who sparked his interest in computer science; his ICPC teammates Zhang Chen, An Yan, and Yuqi Peng, and the many fellow competitors who accompanied him through eight years of algorithmic contests; Prof. Xiaoying Tang and the members of T-Lab at CUHK-Shenzhen, who patiently guided a newcomer into academic research; and Siyuan Xu, whose support and companionship sustained him throughout.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Sx2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This work is supported by Guangdong Province (No. 2023QN10X215), 2023 Shenzhen National Science Foundation (No. 20231128220938001), Shenzhen Science and Technology Program (No. JCYJ20241202130548062), the Natural Science Foundation of Shenzhen (No. JCYJ20230807142703006), and the Key Research Platforms and Projects of the Guangdong Provincial Department of Education (No.2023ZDZX1034).&lt;/p&gt;
&lt;/div&gt;
&lt;div class="ltx_pagination ltx_role_newpage"&gt;&lt;/div&gt;
&lt;/section&gt;
&lt;section id="bib" class="ltx_bibliography"&gt;
&lt;h2 class="ltx_title ltx_title_bibliography" id="references"&gt;References&lt;/h2&gt;
&lt;ul id="bib.L1" class="ltx_biblist"&gt;
&lt;li id="bib.bib52" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;S. Ament, S. Daulton, D. Eriksson, M. Balandat, and E. Bakshy (2023)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Unexpected improvements to expected improvement for bayesian optimization&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Advances in Neural Information Processing Systems&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Vol. &lt;span class="ltx_text ltx_bib_volume"&gt;36&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 20577–20612&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S2.p1" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib61" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;K. Azuma (1967)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Weighted sums of certain dependent random variables&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Tohoku Mathematical Journal, Second Series&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;19&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;3&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 357–367&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.2748/tmj/1178243286" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;,
&lt;a href="https://doi.org/10.2748/tmj/1178243286" title="" class="ltx_ref ltx_bib_external"&gt;Link&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A3.SS3.p1" title="C.3 Adaptive Residual Pool Concentration ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§C.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib50" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;L. Bajer, Z. Pitra, J. Repický, and M. Holeňa (2019)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Gaussian process surrogate models for the CMA evolution strategy&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Evolutionary Computation&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;27&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;4&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 665–697&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1162/evco%5Fa%5F00244" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S2.p1" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib51" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;M. Balandat, B. Karrer, D. R. Jiang, S. Daulton, B. Letham, A. G. Wilson, and E. Bakshy (2020)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;BoTorch: a framework for efficient monte-carlo bayesian optimization&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Advances in Neural Information Processing Systems&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;Vol. &lt;span class="ltx_text ltx_bib_volume"&gt;33&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S2.p1" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib31" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;H. Beyer and B. Sendhoff (2007)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Evolutionary algorithms in the presence of noise: to sample or not to sample&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Proceedings of the IEEE Symposium on Foundations of Computational Intelligence (FOCI) 2007&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 17–24&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1109/FOCI.2007.372142" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;,
&lt;a href="https://doi.org/10.1109/FOCI.2007.372142" title="" class="ltx_ref ltx_bib_external"&gt;Link&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.p3" title="1 Introduction ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S2.p1" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib15" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;M. Birattari, T. Stützle, L. Paquete, and K. Varrentrapp (2002)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;A racing algorithm for configuring metaheuristics&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Genetic and Evolutionary Computation Conference (GECCO 2002)&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 11–18&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.p3" title="1 Introduction ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S2.p1" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib20" class="ltx_bibitem ltx_bib_book"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;S. Boucheron, G. Lugosi, and P. Massart (2013)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Concentration inequalities: a nonasymptotic theory of independence&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; &lt;span class="ltx_text ltx_bib_publisher"&gt;Oxford University Press&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A3.SS3.p1" title="C.3 Adaptive Residual Pool Concentration ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§C.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib55" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;J. Branke, S. E. Chick, and C. Schmidt (2007)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Selecting a selection procedure&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Management Science&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;53&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;12&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 1916–1932&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1287/mnsc.1070.0721" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S2.p2" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib60" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;J. Branke and C. Schmidt (2004)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Sequential sampling in noisy environments&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Parallel Problem Solving from Nature - PPSN VIII (PPSN 2004)&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_series"&gt;Lecture Notes in Computer Science&lt;/span&gt;, Vol. &lt;span class="ltx_text ltx_bib_volume"&gt;3242&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 202–211&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1007/978-3-540-30217-9%5F21" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;,
&lt;a href="https://doi.org/10.1007/978-3-540-30217-9_21" title="" class="ltx_ref ltx_bib_external"&gt;Link&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S2.p1" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib64" class="ltx_bibitem ltx_bib_book"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;G. Casella and R. L. Berger (2002)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Statistical inference&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_edition"&gt;2nd edition&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_publisher"&gt;Duxbury&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;span class="ltx_text isbn ltx_bib_external"&gt;ISBN 9780534243128&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A5.p2" title="Appendix E Additional Theory Details ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix E&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S5.p1" title="5 Theory ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§5&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib24" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;P. Diaconis and R. L. Graham (1977)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Spearman’s footrule as a measure of disarray&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Journal of the Royal Statistical Society, Series B (Statistical Methodology)&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;39&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 262–268&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A4.p4" title="Appendix D Decision-Theoretic Analysis for Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix D&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib18" class="ltx_bibitem ltx_bib_book"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;B. Efron and R. J. Tibshirani (1993)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;An introduction to the bootstrap&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; &lt;span class="ltx_text ltx_bib_publisher"&gt;Chapman and Hall/CRC&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.p6" title="1 Introduction ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib56" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;P. I. Frazier (2014)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;A fully sequential elimination procedure for indifference-zone ranking and selection with tight bounds on probability of correct selection&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Operations Research&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;62&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;4&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 926–942&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1287/opre.2014.1282" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S2.p2" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib53" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;P. I. Frazier (2018)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;A tutorial on bayesian optimization&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;arXiv preprint arXiv:1807.02811&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;span class="ltx_text ltx_bib_external"&gt;1807.02811&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S2.p1" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib33" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;M. J. Groves and J. Branke (2018)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Sequential sampling for noisy optimisation with CMA-ES&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Proceedings of the Genetic and Evolutionary Computation Conference (GECCO) 2018&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 1023–1030&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/3205455.3205559" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;,
&lt;a href="https://doi.org/10.1145/3205455.3205559" title="" class="ltx_ref ltx_bib_external"&gt;Link&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.p3" title="1 Introduction ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S2.p1" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib2" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;N. Hansen, A. S. P. Niederberger, L. Guzzella, and P. Koumoutsakos (2009)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;A method for handling uncertainty in evolutionary optimization with an application to feedback control of combustion&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;IEEE Transactions on Evolutionary Computation&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;13&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;1&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 180–197&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.p3" title="1 Introduction ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S2.p1" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib1" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;N. Hansen and A. Ostermeier (2001)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Completely derandomized self-adaptation in evolution strategies&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Evolutionary Computation&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;9&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;2&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 159–195&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A1.p2" title="Appendix A CMA-ES Specification ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix A&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S1.p2" title="1 Introduction ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib62" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;W. Hoeffding (1963)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Probability inequalities for sums of bounded random variables&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Journal of the American Statistical Association&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;58&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;301&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 13–30&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1080/01621459.1963.10500830" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;,
&lt;a href="https://doi.org/10.1080/01621459.1963.10500830" title="" class="ltx_ref ltx_bib_external"&gt;Link&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A3.SS3.p1" title="C.3 Adaptive Residual Pool Concentration ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§C.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib57" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;L. J. Hong, W. Fan, and J. Luo (2021)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Review on ranking and selection: a new perspective&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Frontiers of Engineering Management&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;8&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 321–343&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1007/s42524-021-0152-6" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S2.p2" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib58" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;L. J. Hong, G. Jiang, and Y. Zhong (2022)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Solving large-scale fixed-budget ranking and selection problems&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;INFORMS Journal on Computing&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;34&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;6&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 2930–2949&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1287/ijoc.2022.1221" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S2.p2" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib4" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;Y. Jin and J. Branke (2005)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Evolutionary optimization in uncertain environments – a survey&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;IEEE Transactions on Evolutionary Computation&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;9&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;3&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 303–317&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1109/TEVC.2005.846356" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;,
&lt;a href="https://doi.org/10.1109/TEVC.2005.846356" title="" class="ltx_ref ltx_bib_external"&gt;Link&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.p3" title="1 Introduction ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib54" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;S. Kim and B. L. Nelson (2007)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Recent advances in ranking and selection&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Proceedings of the Winter Simulation Conference&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 162–172&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1109/WSC.2007.4419598" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S2.p2" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib49" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;O. Krause (2022)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Recombination weight based selection in the DTS-CMA-ES&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Parallel Problem Solving from Nature – PPSN XVII&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_series"&gt;Lecture Notes in Computer Science&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 295–308&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1007/978-3-031-14721-0%5F21" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S2.p1" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib65" class="ltx_bibitem ltx_bib_book"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;E. L. Lehmann and G. Casella (1998)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Theory of point estimation&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_edition"&gt;2 edition&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_publisher"&gt;Springer&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;span class="ltx_text isbn ltx_bib_external"&gt;ISBN 9780387985022&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A5.p2" title="Appendix E Additional Theory Details ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;Appendix E&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#S5.p1" title="5 Theory ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§5&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib47" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;K. Nishida and Y. Akimoto (2018)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;PSA-CMA-ES: CMA-ES with population size adaptation&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Proceedings of the Genetic and Evolutionary Computation Conference&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_series"&gt;GECCO ’18&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 865–872&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/3205455.3205467" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S2.p1" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib48" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;M. Nomura, Y. Akimoto, and I. Ono (2025)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;CMA-ES with learning rate adaptation&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;ACM Transactions on Evolutionary Learning and Optimization&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;5&lt;/span&gt; (&lt;span class="ltx_text ltx_bib_number"&gt;1&lt;/span&gt;), &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 1–28&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/3698203" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S2.p1" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib59" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;M. Pearce and J. Branke (2017)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Efficient expected improvement estimation for continuous multiple ranking and selection&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Proceedings of the Winter Simulation Conference&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_pages"&gt; pp. 2161–2172&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S2.p2" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib5" class="ltx_bibitem ltx_bib_article"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;P. Rakshit, A. Konar, and S. Das (2017)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Noisy evolutionary optimization algorithms - a comprehensive survey&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_journal"&gt;Swarm and Evolutionary Computation&lt;/span&gt; &lt;span class="ltx_text ltx_bib_volume"&gt;33&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 18–45&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1016/J.SWEVO.2016.09.002" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;,
&lt;a href="https://doi.org/10.1016/J.SWEVO.2016.09.002" title="" class="ltx_ref ltx_bib_external"&gt;Link&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S1.p3" title="1 Introduction ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib46" class="ltx_bibitem ltx_bib_inproceedings"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;K. Uchida, K. Nishihara, and S. Shirakawa (2024)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;CMA-ES with adaptive reevaluation for multiplicative noise&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;In &lt;span class="ltx_text ltx_bib_inbook"&gt;Proceedings of the Genetic and Evolutionary Computation Conference&lt;/span&gt;,
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_series"&gt;GECCO ’24&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_pages"&gt; pp. 731–739&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;a href="https://dx.doi.org/10.1145/3638529.3654182" title="" class="ltx_ref doi ltx_bib_external"&gt;Document&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#S2.p1" title="2 Related Work ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§2&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib21" class="ltx_bibitem ltx_bib_book"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;A. W. van der Vaart and J. A. Wellner (1996)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Weak convergence and empirical processes: with applications to statistics&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; &lt;span class="ltx_text ltx_bib_publisher"&gt;Springer&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A3.SS3.p1" title="C.3 Adaptive Residual Pool Concentration ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§C.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib19" class="ltx_bibitem ltx_bib_book"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;C. Villani (2008)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Optimal transport: old and new&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_series"&gt;Grundlehren der mathematischen Wissenschaften&lt;/span&gt;, Vol. &lt;span class="ltx_text ltx_bib_volume"&gt;338&lt;/span&gt;, &lt;span class="ltx_text ltx_bib_publisher"&gt;Springer&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A3.SS2.SSS0.Px2.p3" title="Weight-aware targeted reevaluation. ‣ C.2 From Distribution Mismatch to PEM ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§C.2&lt;/span&gt;&lt;/a&gt;,
&lt;a href="#A3.SS3.p1" title="C.3 Adaptive Residual Pool Concentration ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§C.3&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;li id="bib.bib63" class="ltx_bibitem ltx_bib_book"&gt;
&lt;span class="ltx_tag ltx_bib_author-year ltx_role_refnum ltx_tag_bibitem"&gt;D. Williams (1991)&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;&lt;span class="ltx_text ltx_bib_title"&gt;Probability with martingales&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt; &lt;span class="ltx_text ltx_bib_publisher"&gt;Cambridge University Press&lt;/span&gt;.
&lt;/span&gt;
&lt;span class="ltx_bibblock"&gt;External Links: &lt;span class="ltx_text ltx_bib_links"&gt;&lt;span class="ltx_text isbn ltx_bib_external"&gt;ISBN 9780521406055&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="ltx_bibblock ltx_bib_cited"&gt;Cited by: &lt;a href="#A3.SS1.p2" title="C.1 Fixed-Budget Condition (“Money Plot” Prediction) ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;§C.1&lt;/span&gt;&lt;/a&gt;.
&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;div class="ltx_pagination ltx_role_newpage"&gt;&lt;/div&gt;
&lt;section id="A1" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="cma-es-specification"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix A &lt;/span&gt;CMA-ES Specification&lt;/h2&gt;
&lt;div id="A1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Covariance matrix adaptation evolution strategy (CMA-ES) maintains a Gaussian search distribution&lt;/p&gt;
&lt;table id="A1.E25" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$x\sim\mathcal{N}\!\left(m_{t},\;\sigma_{t}^{2}C_{t}\right),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(25)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;parameterized by mean $m_{t}\in\mathbb{R}^{d}$, global step-size $\sigma_{t}&amp;gt;0$, and covariance $C_{t}\in\mathbb{R}^{d\times d}$.
More explicitly, it samples $\lambda$ candidates by drawing standardized
steps $z_{t,i}$ and mapping them through a factor $A_{t}$ of $C_{t}$ as follows:&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A6.EGx3"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A1.E26"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A1.E27"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle z_{t,i} &amp;amp; \displaystyle\sim\mathcal{N}(0,I_{d}),\quad i=1,\dots,\lambda, \\
\displaystyle x_{t,i} &amp;amp; \displaystyle=m_{t}+\sigma_{t}A_{t}z_{t,i},\quad A_{t}A_{t}^{\top}=C_{t}.
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;(26)&lt;br&gt;(27)&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The mean $m_{t}$ is updated according to the reordering of observed values. Let $\pi_{t}\in S_{\lambda}$ be a permutation such that&lt;/p&gt;
&lt;table id="A1.E28" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$y_{t,\pi_{t}(1)}\leq y_{t,\pi_{t}(2)}\leq\cdots\leq y_{t,\pi_{t}(\lambda)},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(28)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;with ties broken deterministically (e.g., by index). The rank of individual $i$ is
$r_{t,i}\in\{1,\dots,\lambda\}$ defined by $\pi_{t}(r_{t,i})=i$. Equivalently, for each candidate $i\in\{1,\dots,\lambda\}$ we define its rank by&lt;/p&gt;
&lt;table id="A1.E29" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$r_{t,i}:=1+\sum_{j=1}^{\lambda}\mathbf{1}\!\left\{\,y_{t,j}&amp;lt;y_{t,i}\right\}+\sum_{j=1}^{\lambda}\mathbf{1}\!\left\{\,y_{t,j}=y_{t,i},j&amp;lt;i\right\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(29)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;so that $r_{t,i}\in\{1,\dots,\lambda\}$ and $\pi_{t}(r_{t,i})=i$ (ties are broken by index). Then the mean is updated by&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A6.EGx4"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A1.E30"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\displaystyle m_{t+1} \displaystyle=m_{t}+\eta_{m}\sum_{i=1}^{\lambda}w(r_{t,i})(x_{t,i}-m_{t}),$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;(30)&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;where $w:\{1,\ldots,\lambda\}\to\mathbb{R}$ is a deterministic rank-weight map. For the mean update in standard positive-weight CMA-ES, these weights are nonnegative and normalized, $\sum_{j=1}^{\lambda}w(j)=1$. The default choice in modern CMA-ES implementations is the positive logarithmic recombination weight&lt;/p&gt;
&lt;table id="A1.E31" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$w(j)=\frac{\max\{\log(\mu+1/2)-\log j,\,0\}}{\sum_{\ell=1}^{\mu}\big(\log(\mu+1/2)-\log\ell\big)},\qquad j=1,\ldots,\lambda.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(31)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Uniform top-$\mu$ truncation, $w(j)=\frac{1}{\mu}\mathbf{1}\{j\leq\mu\}$, is an older/intermediate-recombination special case and is used in this paper only when explicitly stated as a pedagogical example. Finally, the remaining state variables $(\sigma_{t},C_{t})$ are updated using the standard cumulative step-size and covariance adaptation rules &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Hansen and Ostermeier, &lt;a href="#bib.bib1" title="Completely derandomized self-adaptation in evolution strategies" class="ltx_ref"&gt;2001&lt;/a&gt;)&lt;/cite&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Define the rank-weighted step in standardized coordinates&lt;/p&gt;
&lt;table id="A1.E32" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$z_{w,t}\;:=\;\sum_{i=1}^{\lambda}w(r_{t,i})\,z_{t,i}\;=\;\sum_{j=1}^{\lambda}w(j)\,z_{t,\pi_{t}(j)}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(32)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;The corresponding recombination point is&lt;/p&gt;
&lt;table id="A1.E33" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$x_{w,t}\;:=\;\sum_{j=1}^{\lambda}w(j)\,x_{t,\pi_{t}(j)}\;=\;m_{t}+\sigma_{t}A_{t}z_{w,t}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(33)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Thus the mean update (&lt;a href="#A1.E30" title="In Appendix A CMA-ES Specification ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;30&lt;/span&gt;&lt;/a&gt;) can be written equivalently as&lt;/p&gt;
&lt;table id="A1.E34" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$m_{t+1}\;=\;m_{t}+\eta_{m}\,(x_{w,t}-m_{t})\;=\;m_{t}+\eta_{m}\,\sigma_{t}A_{t}z_{w,t}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(34)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Crucially, the update depends on the observed values only through their &lt;em class="ltx_emph ltx_font_italic"&gt;relative ordering&lt;/em&gt; (&lt;a href="#A1.E28" title="In Appendix A CMA-ES Specification ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;28&lt;/span&gt;&lt;/a&gt;);
under noisy evaluations, the ranks $r_{t,i}$ (and hence $z_{w,t}$) are random even conditional on the queried points.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A2" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="residual-bootstrapping-implementation-details"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix B &lt;/span&gt;Residual Bootstrapping Implementation Details&lt;/h2&gt;
&lt;div id="A2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Implementing residual bootstrapping follows:&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 1: targeted reevaluation and robust residuals&lt;/span&gt;. After one baseline evaluation $y_{t,i}$ for each candidate, we form the observed ranks $\hat{r}_{t,i}$ (Section &lt;a href="#S3.SS3" title="3.3 Noisy Evaluation and Misranking ‣ 3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3.3&lt;/span&gt;&lt;/a&gt;) and select a small reevaluation set $\mathcal{B}_{t}$ subject to the cap $K_{t}\leq K_{\max}$. For uniform top-$\mu$ weights, the weight-instability criterion of Appendix &lt;a href="#A3" title="Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;C&lt;/span&gt;&lt;/a&gt; reduces to a narrow boundary band, for example $\hat{r}_{t,i}\in\{\mu-1,\mu,\mu+1\}$. For non-uniform monotone weights, the same criterion ranks candidates by bootstrap instability of $w(\tilde{r}_{t,i})$ and can include uncertain top-ranked candidates as well. We allocate $R_{t,i}$ additional independent reevaluations to each $i\in\mathcal{B}_{t}$ with $\sum_{i\in\mathcal{B}_{t}}R_{t,i}=K_{t}$ and $K_{t}\leq K_{\max}$. Let $y_{t,i}^{(1)}:=y_{t,i}$ and $y_{t,i}^{(2)},\ldots,y_{t,i}^{(1+R_{t,i})}$ denote these samples. We compute a robust per-candidate median over reevaluated points,&lt;/p&gt;
&lt;table id="A2.Ex6" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tilde{m}_{t,i}\;:=\;\mathrm{median}_{1\leq k\leq 1+R_{t,i}}\,y_{t,i}^{(k)},\qquad i\in\mathcal{B}_{t},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and residuals $\epsilon_{t,i}^{(k)}:=y_{t,i}^{(k)}-\tilde{m}_{t,i}$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 2: denoised centering model $\hat{f}_{t}(\cdot)$ (cross-fitted)&lt;/span&gt;. The bootstrap values should be centered at an estimate of the latent mean $f(x)$, not at the particular noisy draw $y_{t,i}$, otherwise the bootstrap targets a noise-convolved distribution. We fit a lightweight predictor $\hat{f}_{t}(\cdot)$ in standardized CMA-ES coordinates $z_{t,i}=(x_{t,i}-m_{t})/\sigma_{t}$
using the same $m_{t},\sigma_{t}$ as in sampling (Appendix &lt;a href="#A1" title="Appendix A CMA-ES Specification ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;A&lt;/span&gt;&lt;/a&gt;),
with &lt;em class="ltx_emph ltx_font_italic"&gt;cross-fitting&lt;/em&gt; so that $\hat{f}_{t}(x_{t,i})$ does not reuse $y_{t,i}$ when generating bootstrap values for candidate $i$.
A concrete instantiation is a two-fold ridge regression on pseudo-labels that use $\tilde{m}_{t,i}$ for $i\in\mathcal{B}_{t}$ and $y_{t,i}$ otherwise. See
full details of implementation in Appendix.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 3: optional input-dependent noise scaling $\hat{s}_{t}(\cdot)$ and winsorization&lt;/span&gt;.
To accommodate state-dependent noise scales, we optionally fit a simple scale model $\hat{s}_{t}(x)$ using only boundary points, for example, a two-parameter linear model in $|\hat{f}_{t}(x)|$, and we winsorize standardized residuals at a fixed threshold $M$. If input-dependent noise is weak or unknown, one may set $\hat{s}_{t}(\cdot)\equiv\hat{s}_{t}$ constant.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.p5" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 4: residual pool $\widehat{D}_{t}$ amortized across time&lt;/span&gt;. We insert winsorized standardized residuals into a pool:&lt;/p&gt;
&lt;table id="A2.Ex7" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\hat{z}_{t,i}^{(k)}\;:=\;\operatorname{clip}\!\left(\frac{\epsilon_{t,i}^{(k)}}{\hat{s}_{t}(x_{t,i})},\,[-M,M]\right),\qquad i\in\mathcal{B}_{t},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and let $\widehat{D}_{t}$ denote the empirical distribution of all pooled residuals collected up to generation $t$. This amortization is the main reason why residual bootstrapping can run many bootstrap rankings without consuming additional calls.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.p6" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Step 5: bootstrap rankings and expected weights&lt;/span&gt;.
Given $\hat{f}_{t}(\cdot)$, $\hat{s}_{t}(\cdot)$, and $\widehat{D}_{t}$, we generate synthetic noisy values&lt;/p&gt;
&lt;table id="A2.E35" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\tilde{y}_{t,i}^{(b)}\;=\;\hat{f}_{t}(x_{t,i})\;+\;\hat{s}_{t}(x_{t,i})\,z^{(b)}_{t,i},\quad z^{(b)}_{t,i}\stackrel{{\scriptstyle iid}}{{\sim}}\widehat{D}_{t}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(35)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;For each bootstrap replicate $b=1,\ldots,B_{\text{boot}}$, we compute the induced ranks $\tilde{r}_{t,i}^{(b)}=\operatorname{rank}_{i}(\tilde{y}_{t,1:\lambda}^{(b)})$
and estimate expected rank weights by averaging:&lt;/p&gt;
&lt;table id="A2.E36" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\hat{w}_{t,i}\;=\;\frac{1}{B_{\text{boot}}}\sum_{b=1}^{B_{\text{boot}}}w(\tilde{r}_{t,i}^{(b)}).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(36)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;It only requires sorting synthetic values, since it is free evaluation-wise once $\widehat{D}_{t}$ is built.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A2.p7" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;In summary, residual bootstrapping provides averaging estimates $\hat{w}_{t,i}$ of the PEM target weights $w_{t,i}^{\star}$ (&lt;a href="#S4.E18" title="In 4.1 Probabilistic Elite Membership (PEM) ‣ 4 Method: PEM, Residual Bootstrapping, and Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;18&lt;/span&gt;&lt;/a&gt;) via bootstrap pseudo-rankings, which are then used as a drop-in replacement for $w(r_{t,i})$ in the mean update (&lt;a href="#A1.E30" title="In Appendix A CMA-ES Specification ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;30&lt;/span&gt;&lt;/a&gt;) and any other rank-weighted CMA-ES statistics. Crucially, this preserves the &lt;em class="ltx_emph ltx_font_italic"&gt;one-evaluation-per-candidate&lt;/em&gt; baseline and spends the capped overhead $K_{t}$ only to calibrate the bootstrap noise model, yielding the per-generation evaluation cost $C_{t}=\lambda+K_{t}$ in (&lt;a href="#S3.E16" title="In 3.5 Depth over Fidelity: A Fixed-Budget Principle ‣ 3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;16&lt;/span&gt;&lt;/a&gt;). This design also cleanly separates &lt;em class="ltx_emph ltx_font_italic"&gt;evaluation-cost knobs&lt;/em&gt;, which directly affect $C_{t}$ ($K_{\max}$ and the boundary bandwidth defining $\mathcal{B}_{t}$), from &lt;em class="ltx_emph ltx_font_italic"&gt;compute-only knobs&lt;/em&gt; (the number of bootstrap replicates $B_{\text{boot}}$), which can be increased to stabilize $\hat{w}_{t,i}$ without changing the budget accounting in (&lt;a href="#S3.E16" title="In 3.5 Depth over Fidelity: A Fixed-Budget Principle ‣ 3 Preliminaries ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;16&lt;/span&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A3" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="residual-pool-theory-and-diagnostics"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix C &lt;/span&gt;Residual Pool Theory and Diagnostics&lt;/h2&gt;
&lt;section id="A3.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="fixed-budget-condition-money-plot-prediction"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;C.1 &lt;/span&gt;Fixed-Budget Condition (“Money Plot” Prediction)&lt;/h3&gt;
&lt;div id="Thmproposition1" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Proposition 1&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmproposition1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $B$ be the total number of allowed oracle calls and let the per-generation cost be $C_{t}=\lambda+K_{t}$ with $K_{t}\in[0,K_{\max}]$.
Then the number of completed generations $T$ satisfies&lt;/span&gt;&lt;/p&gt;
&lt;table id="A3.E37" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\left\lfloor\frac{B}{\lambda+K_{\max}}\right\rfloor\;\leq\;T\;\leq\;\left\lfloor\frac{B}{\lambda}\right\rfloor.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(37)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;In addition, if $(K_{t})_{t\geq 0}$ is i.i.d. with $\mathbb{E}[K_{t}]&amp;lt;\infty$, then for large budgets one has the approximation&lt;/span&gt;&lt;/p&gt;
&lt;table id="A3.E38" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\mathbb{E}[T]\;\approx\;\frac{B}{\lambda+\mathbb{E}[K_{t}]}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(38)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of Proposition &lt;a href="#Thmproposition1" title="Proposition 1. ‣ C.1 Fixed-Budget Condition (“Money Plot” Prediction) ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;.&lt;/h6&gt;
&lt;div id="A3.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The bounds (&lt;a href="#A3.E37" title="In Proposition 1. ‣ C.1 Fixed-Budget Condition (“Money Plot” Prediction) ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;37&lt;/span&gt;&lt;/a&gt;) are immediate from $\lambda\leq C_{t}\leq\lambda+K_{\max}$ and
$\sum_{t=0}^{T-1}C_{t}\leq B$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For (&lt;a href="#A3.E38" title="In Proposition 1. ‣ C.1 Fixed-Budget Condition (“Money Plot” Prediction) ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;38&lt;/span&gt;&lt;/a&gt;), assume $(C_{t})_{t\geq 0}$ are i.i.d. with $\mu:=\mathbb{E}[C_{0}]&amp;lt;\infty$.
Define $S_{n}:=\sum_{t=0}^{n-1}C_{t}$ and the stopping time $T:=\max\{n:\,S_{n}\leq B\}$.
Since $C_{t}\geq\lambda&amp;gt;0$, we have $T\leq\lfloor B/\lambda\rfloor$, hence $T$ is bounded.
Let $M_{n}:=S_{n}-n\mu$. Then $(M_{n})$ is a martingale, so by optional stopping,
$\mathbb{E}[M_{T}]=\mathbb{E}[M_{0}]=0$ and therefore $\mathbb{E}[S_{T}]=\mu\,\mathbb{E}[T]$ (Wald’s identity &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Williams, &lt;a href="#bib.bib63" title="Probability with martingales" class="ltx_ref"&gt;1991&lt;/a&gt;)&lt;/cite&gt;).
Because $S_{T}\leq B&amp;lt;S_{T+1}$, we get
$\mu\,\mathbb{E}[T]=\mathbb{E}[S_{T}]\leq B$ and $B&amp;lt;\mathbb{E}[S_{T+1}]=\mu\,\mathbb{E}[T+1]=\mu(\mathbb{E}[T]+1)$,
so $B/\mu-1&amp;lt;\mathbb{E}[T]\leq B/\mu$.
With $\mu=\lambda+\mathbb{E}[K_{t}]$ in condition, this yields $\mathbb{E}[T]=B/(\lambda+\mathbb{E}[K_{t}])+O(1)$, proving
(&lt;a href="#A3.E38" title="In Proposition 1. ‣ C.1 Fixed-Budget Condition (“Money Plot” Prediction) ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;38&lt;/span&gt;&lt;/a&gt;) for large $B$.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A3.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="from-distribution-mismatch-to-pem"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;C.2 &lt;/span&gt;From Distribution Mismatch to PEM&lt;/h3&gt;
&lt;div id="Thmassumption1" class="ltx_theorem ltx_theorem_assumption"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Assumption 1&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Localized strong convexity with localization)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmassumption1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For any fixed candidate set $x_{1:\lambda}$, random updated point
$X:=m+\Delta m(y)$ and its conditional mean $\bar{X}:=\mathbb{E}[X\mid x_{1:\lambda}]=m+\Delta m_{\mathrm{PEM}}$, there always exists a &lt;em class="ltx_emph ltx_font_italic"&gt;convex&lt;/em&gt; set $\mathcal{C}\subset\mathbb{R}^{d}$ such that:
(i) $f$ is $\alpha$-strongly convex on $\mathcal{C}$, and
(ii) $X,\bar{X}\in\mathcal{C}$ almost surely (conditional on $x_{1:\lambda}$).&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A3.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Note that Assumption &lt;a href="#Thmassumption1" title="Assumption 1 (Localized strong convexity with localization). ‣ C.2 From Distribution Mismatch to PEM ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; does not require global convexity. It only requires that the random update and its conditional mean stay inside a region where $f$ has curvature.
A typical special case is: $f$ is $\alpha$-strongly convex on a ball $B(m,r)$ and the update is localized by design, for example, via step-size control or explicit clipping, so that $\|X-m\|\leq r$ and $\|\bar{X}-m\|\leq r$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmassumption2" class="ltx_theorem ltx_theorem_assumption"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Assumption 2&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Standing noise factorization)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmassumption2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Conditional on the candidate set and history, evaluation noise is independent across candidates and has a common standardized marginal distribution.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A3.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Concretely, we assume&lt;/p&gt;
&lt;table id="A3.E39" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$y_{i}\;=\;f(x_{i})+s(x_{i})\,\varepsilon_{i},\qquad\varepsilon_{i}\stackrel{{\scriptstyle\text{i.i.d.}}}{{\sim}}D_{t},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(39)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and the bootstrap draws satisfy $\hat{\varepsilon}_{i}\stackrel{{\scriptstyle\text{i.i.d.}}}{{\sim}}\widehat{D}_{t}$.
If there is strong cross-candidate correlation or if the standardized shape depends sharply on $x$, then expected rank weights depend on the joint law of $(\varepsilon_{1},\ldots,\varepsilon_{\lambda})$ and a univariate residual pool is insufficient.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmassumption3" class="ltx_theorem ltx_theorem_assumption"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Assumption 3&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt; &lt;/span&gt;(Anti-concentration of pairwise gaps)&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmassumption3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Conditional on $x_{1:\lambda}$, for each $i\neq j$ the true gap
$G_{ij}:=y_{i}-y_{j}$
admits a density $p_{ij}$ in a neighborhood of $0$ with&lt;/p&gt;
&lt;table id="A3.E40" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\sup_{|u|\leq 1}p_{ij}(u)\;\leq\;L_{ij}\;&amp;lt;\;\infty.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(40)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Equivalently, for either gap $H_{ij}\in\{G_{ij},\widetilde{G}_{ij}\}$ and all $\eta\in(0,1]$,&lt;/p&gt;
&lt;table id="A3.E41" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Pr\!\left(|H_{ij}|\leq\eta\,\middle|\,x_{1:\lambda}\right)\;\leq\;2\eta\,L_{ij}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(41)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="Thmproposition2" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Proposition 2&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmproposition2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Suppose both $D_{t}$ and $\widehat{D}_{t}$ are winsorized on $[-M,M]$. Then,
under Assumption &lt;a href="#Thmassumption2" title="Assumption 2 (Standing noise factorization). ‣ C.2 From Distribution Mismatch to PEM ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; (&lt;a href="#A3.E39" title="In C.2 From Distribution Mismatch to PEM ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;39&lt;/span&gt;&lt;/a&gt;) and Assumption &lt;a href="#Thmassumption3" title="Assumption 3 (Anti-concentration of pairwise gaps). ‣ C.2 From Distribution Mismatch to PEM ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;, for any smoothing scale $\eta\in(0,1]$,&lt;/span&gt;&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A6.EGx5"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.E42"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\displaystyle|\widetilde{w}_{i}-w_{i}^{\star}|\leq\frac{\|w\|_{\infty}}{\eta}\Big(\textstyle\sum_{j=1}^{\lambda}s(x_{j})\Big)\,W_{1}(D_{t},\widehat{D}_{t})+4\Delta_{w}\,\eta\sum_{j\neq i}L_{ij}.$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;(42)&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A3.SS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The second term in (&lt;a href="#A3.E42" title="In Proposition 2. ‣ C.2 From Distribution Mismatch to PEM ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;42&lt;/span&gt;&lt;/a&gt;) scales with the mass of pairwise gaps near $0$.
It is small when candidate scores are well separated (large $|f(x_{i})-f(x_{j})|$ relative to noise), or when the gap distribution has a moderate density bound near $0$.
The statement is already for a general deterministic $w$: the weight map enters only through $\|w\|_{\infty}$ in the smooth mismatch term and through the adjacent-drop scale $\Delta_{w}$ in the near-tie term.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A3.SS2.SSS0.Px1" class="ltx_paragraph"&gt;
&lt;h4 class="ltx_title ltx_title_paragraph" id="specialization-to-standard-logarithmic-cma-es-weights"&gt;Specialization to standard logarithmic CMA-ES weights.&lt;/h4&gt;
&lt;div id="A3.SS2.SSS0.Px1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For (&lt;a href="#A1.E31" title="In Appendix A CMA-ES Specification ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;31&lt;/span&gt;&lt;/a&gt;), let
$Z_{\mu}:=\sum_{\ell=1}^{\mu}(\log(\mu+1/2)-\log\ell)$.
Then&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A6.EGx6"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.E43"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.E44"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle\delta_{k} &amp;amp; \displaystyle=\frac{\log(1+1/k)}{Z_{\mu}}, &amp;amp; \displaystyle k=1,\ldots,\mu-1, \\
\displaystyle\delta_{\mu} &amp;amp; \displaystyle=\frac{\log(1+1/(2\mu))}{Z_{\mu}},\qquad\delta_{k}=0, &amp;amp; \displaystyle k&amp;gt;\mu.
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;(43)&lt;br&gt;(44)&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;Since $Z_{\mu}=\mu+O(\log\mu)$, we have&lt;/p&gt;
&lt;table id="A3.E45" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\|w\|_{\infty}=\Theta\!\left(\frac{\log\mu}{\mu}\right),\qquad\Delta_{w}=\delta_{1}=\Theta\!\left(\frac{1}{\mu}\right).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(45)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Substituting into Proposition &lt;a href="#Thmproposition2" title="Proposition 2. ‣ C.2 From Distribution Mismatch to PEM ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;, and writing $S_{x}:=\sum_{j=1}^{\lambda}s(x_{j})$ and $A_{i}:=\sum_{j\neq i}L_{ij}$, gives&lt;/p&gt;
&lt;table id="A3.E46" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$|\widetilde{w}_{i}-w_{i}^{\star}|\leq C_{1}\frac{\log\mu}{\mu}\frac{S_{x}}{\eta}W_{1}(D_{t},\widehat{D}_{t})+C_{2}\frac{\eta}{\mu}A_{i}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(46)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;for absolute constants $C_{1},C_{2}&amp;gt;0$. Hence Proposition &lt;a href="#Thmproposition2" title="Proposition 2. ‣ C.2 From Distribution Mismatch to PEM ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; does not rely on uniform truncation: logarithmic weights preserve the same two-term structure, with a mild logarithmic factor only in the Wasserstein mismatch term. Uniform top-$\mu$ weights instead have $\|w\|_{\infty}=\Delta_{w}=1/\mu$ and concentrate all adjacent-drop mass at $k=\mu$.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A3.SS2.SSS0.Px2" class="ltx_paragraph"&gt;
&lt;h4 class="ltx_title ltx_title_paragraph" id="weight-aware-targeted-reevaluation"&gt;Weight-aware targeted reevaluation.&lt;/h4&gt;
&lt;div id="A3.SS2.SSS0.Px2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The same multi-cutoff representation gives a natural general-weight version of the boundary set in Appendix &lt;a href="#A2" title="Appendix B Residual Bootstrapping Implementation Details ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;B&lt;/span&gt;&lt;/a&gt;. Conditional on the fitted bootstrap model, define&lt;/p&gt;
&lt;table id="A3.E47" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$U_{t,i}:=\mathrm{Var}\!\left(w(\tilde{r}_{t,i})\mid x_{1:\lambda},\hat{f}_{t},\hat{s}_{t},\widehat{D}_{t}\right),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(47)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and let $\tilde{p}_{t,i,k}:=\Pr(\tilde{r}_{t,i}\leq k\mid x_{1:\lambda},\hat{f}_{t},\hat{s}_{t},\widehat{D}_{t})$.
Since the events $\{\tilde{r}_{t,i}\leq k\}$ are nested,&lt;/p&gt;
&lt;table id="A3.E48" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$U_{t,i}=\sum_{k=1}^{\lambda-1}\sum_{\ell=1}^{\lambda-1}\delta_{k}\delta_{\ell}\left(\tilde{p}_{t,i,\min(k,\ell)}-\tilde{p}_{t,i,k}\tilde{p}_{t,i,\ell}\right).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(48)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;For uniform top-$\mu$ truncation this reduces to
$U_{t,i}=\mu^{-2}\tilde{p}_{t,i,\mu}(1-\tilde{p}_{t,i,\mu})$, maximized near the elite boundary. For logarithmic weights, multiple $\delta_{k}$ are positive and largest near $k=1$, so uncertainty among highly ranked candidates contributes directly. Selecting reevaluations by the largest $U_{t,i}$ is therefore a weight-aware extension of the boundary heuristic; it recovers the original boundary rule in the one-cutoff case and expands the set toward top-ranked candidates when logarithmic weights are used.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of Proposition &lt;a href="#Thmproposition2" title="Proposition 2. ‣ C.2 From Distribution Mismatch to PEM ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;.&lt;/h6&gt;
&lt;div id="A3.SS2.SSS0.Px2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Step 1 (smoothing). Let $\xi\in\mathbb{R}^{\lambda}$ have i.i.d. coordinates $\xi_{k}\sim\mathrm{Unif}[-\eta/2,\eta/2]$.
Define the smoothed functional
$g_{i,\eta}(u):=\mathbb{E}_{\xi}\!\left[w\!\left(\operatorname{rank}_{i}(u+\xi)\right)\right]$
for $u\in\mathbb{R}^{\lambda}$.
This is the average of the bounded function $u\mapsto w(\operatorname{rank}_{i}(u))$ over an $\ell_{\infty}$ cube of side length $\eta$.
Therefore $g_{i,\eta}$ is $(\|w\|_{\infty}/\eta)$-Lipschitz w.r.t. $\|\cdot\|_{1}$:
shifting the cube by $\delta$ changes at most a $\|\delta\|_{1}/\eta$ fraction of its volume, so the cube-averaged value can change by at most $\|w\|_{\infty}\|\delta\|_{1}/\eta$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS2.SSS0.Px2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Step 2 (Wasserstein control of the smoothed mismatch).
Let $Y:=(y_{1},\ldots,y_{\lambda})$ and $\widetilde{Y}:=(\tilde{y}_{1},\ldots,\tilde{y}_{\lambda})$.
By Kantorovich–Rubinstein duality &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Villani, &lt;a href="#bib.bib19" title="Optimal transport: old and new" class="ltx_ref"&gt;2008&lt;/a&gt;)&lt;/cite&gt;,&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A6.EGx7"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.Ex8"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\displaystyle\big|\mathbb{E}[g_{i,\eta}(Y)\mid x_{1:\lambda}]-\mathbb{E}[g_{i,\eta}(\widetilde{Y})\mid x_{1:\lambda}]\big|\leq\mathrm{Lip}(g_{i,\eta})\cdot W_{1}(\mathcal{L}(Y\mid x_{1:\lambda}),\mathcal{L}(\widetilde{Y}\mid x_{1:\lambda})),$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;where $W_{1}$ on $\mathbb{R}^{\lambda}$ uses cost $\|u-v\|_{1}$.
Under (&lt;a href="#A3.E39" title="In C.2 From Distribution Mismatch to PEM ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;39&lt;/span&gt;&lt;/a&gt;), couple each $(\varepsilon_{i},\hat{\varepsilon}_{i})$ using an optimal 1D coupling achieving $W_{1}(D_{t},\widehat{D}_{t})$ and couple coordinates independently.
Then&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A6.EGx8"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.Ex9"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\displaystyle\mathbb{E}\left[\|Y-\widetilde{Y}\|_{1}\mid x_{1:\lambda}\right]=\sum_{j=1}^{\lambda}s(x_{j})\,\mathbb{E}\left[|\varepsilon_{j}-\hat{\varepsilon}_{j}|\right]=\Big(\sum_{j=1}^{\lambda}s(x_{j})\Big)\,W_{1}(D_{t},\widehat{D}_{t}),$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;so $W_{1}(\mathcal{L}(Y\mid x_{1:\lambda}),\mathcal{L}(\widetilde{Y}\mid x_{1:\lambda}))$ is bounded by the same quantity.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A3.SS2.SSS0.Px2.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Step 3 (smoothing bias is a near-tie term).
If $|G_{ij}|&amp;gt;\eta$ for all $j\neq i$, then adding $\xi\in[-\eta/2,\eta/2]^{\lambda}$ cannot change the sign of any pairwise gap involving $i$, hence it cannot change $\operatorname{rank}_{i}$.
Therefore
$w(\operatorname{rank}_{i}(Y))\neq w(\operatorname{rank}_{i}(Y+\xi))$
is only possible if $|G_{ij}|\leq\eta$ for some $j\neq i$.
Moreover, each adjacent rank crossing changes $w(\operatorname{rank}_{i})$ by at most $\Delta_{w}$; summing over possible crossings involving $i$ gives a bound that is independent of the particular shape of $w$.
Thus,&lt;/p&gt;
&lt;table id="A3.Ex10" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\big|w(\operatorname{rank}_{i}(Y))-g_{i,\eta}(Y)\big|\leq\Delta_{w}\sum_{j\neq i}\mathbf{1}\{|G_{ij}|\leq\eta\},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;and likewise for $\widetilde{Y}$.
Taking expectations and applying (&lt;a href="#A3.E41" title="In Assumption 3 (Anti-concentration of pairwise gaps). ‣ C.2 From Distribution Mismatch to PEM ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;41&lt;/span&gt;&lt;/a&gt;) yields the second term in (&lt;a href="#A3.E42" title="In Proposition 2. ‣ C.2 From Distribution Mismatch to PEM ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;42&lt;/span&gt;&lt;/a&gt;).
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A3.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="adaptive-residual-pool-concentration"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;C.3 &lt;/span&gt;Adaptive Residual Pool Concentration&lt;/h3&gt;
&lt;div id="Thmproposition3" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Proposition 3&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmproposition3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Let $\{\widehat{z}_{n}\}_{n=1}^{N_{t}}$ be the standardized residuals stored in the pool up to time $t$, with $|\widehat{z}_{n}|\leq M$ winsorized.
Let $\mathcal{F}_{n}$ denote the filtration revealing the history up to the creation of $\widehat{z}_{n}$.
Assume conditional independence in the sense that $\widehat{z}_{n}$ is independent of $\{\widehat{z}_{m}:m&amp;lt;n\}$ given $\mathcal{F}_{n-1}$.
Define the &lt;em class="ltx_emph ltx_font_upright"&gt;path-average&lt;/em&gt; distribution
$\overline{D}_{t}:=\frac{1}{N_{t}}\sum_{n=1}^{N_{t}}\mathcal{L}(\widehat{z}_{n}\mid\mathcal{F}_{n-1})$
and the empirical pool distribution $\widehat{D}_{t}:=\frac{1}{N_{t}}\sum_{n=1}^{N_{t}}\delta_{\widehat{z}_{n}}$.
Then there exists a constant $C&amp;gt;0$ such that, for any $\delta\in(0,1)$,&lt;/span&gt;&lt;/p&gt;
&lt;table id="A3.E49" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$W_{1}(\widehat{D}_{t},\overline{D}_{t})\leq C\,M\,\sqrt{\frac{\log(1/\delta)}{N_{t}}}$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(49)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;with probability at least $1-\delta$.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of Proposition &lt;a href="#Thmproposition3" title="Proposition 3. ‣ C.3 Adaptive Residual Pool Concentration ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;.&lt;/h6&gt;
&lt;div id="A3.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We use the Kantorovich–Rubinstein dual representation &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Villani, &lt;a href="#bib.bib19" title="Optimal transport: old and new" class="ltx_ref"&gt;2008&lt;/a&gt;)&lt;/cite&gt;:&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A6.EGx9"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.Ex11"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\displaystyle W_{1}(\widehat{D}_{t},\overline{D}_{t})=\sup_{\mathrm{Lip}(\varphi)\leq 1}\left|\frac{1}{N_{t}}\sum_{n=1}^{N_{t}}\varphi(\widehat{z}_{n})-\frac{1}{N_{t}}\sum_{n=1}^{N_{t}}\mathbb{E}[\varphi(\widehat{z}_{n})\mid\mathcal{F}_{n-1}]\right|.$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;Fix a 1-Lipschitz $\varphi$ with $\varphi(0)=0$.
Then $|\varphi(\widehat{z}_{n})|\leq M$ and&lt;/p&gt;
&lt;table id="A3.Ex12" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$d_{n}:=\varphi(\widehat{z}_{n})-\mathbb{E}[\varphi(\widehat{z}_{n})\mid\mathcal{F}_{n-1}]$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;is a bounded martingale difference with $|d_{n}|\leq 2M$.
Azuma–Hoeffding (&lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Azuma, &lt;a href="#bib.bib61" title="Weighted sums of certain dependent random variables" class="ltx_ref"&gt;1967&lt;/a&gt;)&lt;/cite&gt;, &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Hoeffding, &lt;a href="#bib.bib62" title="Probability inequalities for sums of bounded random variables" class="ltx_ref"&gt;1963&lt;/a&gt;)&lt;/cite&gt;) therefore yields, for any $t&amp;gt;0$,&lt;/p&gt;
&lt;table id="A3.Ex13" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\Pr\!\left(\left|\frac{1}{N_{t}}\sum_{n=1}^{N_{t}}d_{n}\right|\geq t\right)\leq 2\exp\!\left(-\frac{N_{t}t^{2}}{8M^{2}}\right).$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;To pass from a fixed $\varphi$ to the supremum over all 1-Lipschitz functions, cover the unit-Lipschitz class on $[-M,M]$ by an $\varepsilon$-net in $\|\cdot\|_{\infty}$ (piecewise-linear interpolation on a uniform grid suffices) and apply a union bound; see, e.g., &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;van der Vaart and Wellner (&lt;a href="#bib.bib21" title="Weak convergence and empirical processes: with applications to statistics" class="ltx_ref"&gt;1996&lt;/a&gt;); Boucheron&lt;span class="ltx_text ltx_bib_etal"&gt; et al.&lt;/span&gt; (&lt;a href="#bib.bib20" title="Concentration inequalities: a nonasymptotic theory of independence" class="ltx_ref"&gt;2013&lt;/a&gt;)&lt;/cite&gt;.
Choosing $\varepsilon$ on the order of $1/\sqrt{N_{t}}$ gives (&lt;a href="#A3.E49" title="In Proposition 3. ‣ C.3 Adaptive Residual Pool Concentration ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;49&lt;/span&gt;&lt;/a&gt;).
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A3.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="a-drift-aware-mismatch-decomposition-four-observable-terms"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;C.4 &lt;/span&gt;A Drift-Aware Mismatch Decomposition (Four Observable Terms)&lt;/h3&gt;
&lt;div id="Thmproposition4" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Proposition 4&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmproposition4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Assume winsorization at level $M$.
Let $\widehat{D}_{t}$ and $\overline{D}_{t}$ be the empirical pool and path-average distributions from Proposition &lt;a href="#Thmproposition3" title="Proposition 3. ‣ C.3 Adaptive Residual Pool Concentration ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt;.
For each stored residual index $n\in\{1,\ldots,N_{t}\}$, let $\tau_{n}$ denote the generation at which $\widehat{z}_{n}$ was created (so $\tau_{n}$ is $\mathcal{F}_{n-1}$-measurable),
and define the corresponding &lt;em class="ltx_emph ltx_font_upright"&gt;ideal&lt;/em&gt; (oracle) standardized residual&lt;/span&gt;&lt;/p&gt;
&lt;table id="A3.E50" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$z_{n}^{\star}\;:=\;\operatorname{clip}\!\left(\frac{y_{n}-f(x_{n})}{s(x_{n})},\,[-M,M]\right),$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(50)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id="Thmproposition4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;with conditional law $Q_{n}:=\mathcal{L}(z_{n}^{\star}\mid\mathcal{F}_{n-1})$. Let the ideal path-average distribution be $\overline{D}_{t}^{\star}:=\frac{1}{N_{t}}\sum_{n=1}^{N_{t}}Q_{n}$.
Let $D_{\tau}$ denote a &lt;em class="ltx_emph ltx_font_upright"&gt;per-generation&lt;/em&gt; target law for ideal residuals at generation $\tau$ (e.g., the conditional law of (&lt;a href="#A3.E50" title="In Proposition 4. ‣ C.4 A Drift-Aware Mismatch Decomposition (Four Observable Terms) ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;50&lt;/span&gt;&lt;/a&gt;) when $x$ is drawn from the boundary set at generation $\tau$).
Then for any reference generation $t$,&lt;/span&gt;&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A6.EGx10"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.E51"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\displaystyle W_{1}(\widehat{D}_{t},D_{t})\leq\underbrace{W_{1}(\widehat{D}_{t},\overline{D}_{t})}_{\text{(I) finite pool}}+\underbrace{\mathrm{StdErr}_{t}}_{\text{(II) standardization}}+\underbrace{\kappa_{t}^{\mathrm{shape}}}_{\text{(III) shape shift}}+\underbrace{\mathrm{Drift}_{t}}_{\text{(IV) drift}},$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;(51)&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;where&lt;/span&gt;&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A6.EGx11"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.E52"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.E53"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.E54"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\begin{aligned}
\displaystyle\mathrm{StdErr}_{t} &amp;amp; \displaystyle:=W_{1}(\overline{D}_{t},\overline{D}_{t}^{\star}), \\
\displaystyle\kappa_{t}^{\mathrm{shape}} &amp;amp; \displaystyle:=\frac{1}{N_{t}}\sum_{n=1}^{N_{t}}W_{1}(Q_{n},D_{\tau_{n}}), \\
\displaystyle\mathrm{Drift}_{t} &amp;amp; \displaystyle:=\frac{1}{N_{t}}\sum_{n=1}^{N_{t}}W_{1}(D_{\tau_{n}},D_{t}).
\end{aligned}$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;(52)&lt;br&gt;(53)&lt;br&gt;(54)&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of Proposition &lt;a href="#Thmproposition4" title="Proposition 4. ‣ C.4 A Drift-Aware Mismatch Decomposition (Four Observable Terms) ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;.&lt;/h6&gt;
&lt;div id="A3.SS4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Apply the triangle inequality twice:&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A6.EGx12"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.Ex14"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.Ex15"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\displaystyle W_{1}(\widehat{D}_{t},D_{t}) \displaystyle\leq W_{1}(\widehat{D}_{t},\overline{D}_{t})+W_{1}(\overline{D}_{t},D_{t}) \displaystyle\leq W_{1}(\widehat{D}_{t},\overline{D}_{t})+W_{1}(\overline{D}_{t},\overline{D}_{t}^{\star})+W_{1}(\overline{D}_{t}^{\star},D_{t}).$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;This yields term (I) and the definition of $\mathrm{StdErr}_{t}$ in (&lt;a href="#A3.E52" title="In Proposition 4. ‣ C.4 A Drift-Aware Mismatch Decomposition (Four Observable Terms) ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;52&lt;/span&gt;&lt;/a&gt;).
To bound the remaining term, use convexity of $W_{1}$ in its first argument (mixture subadditivity):&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A6.EGx13"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.Ex16"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\displaystyle W_{1}(\overline{D}_{t}^{\star},D_{t})=W_{1}\!\left(\frac{1}{N_{t}}\sum_{n=1}^{N_{t}}Q_{n},\,D_{t}\right)\leq\frac{1}{N_{t}}\sum_{n=1}^{N_{t}}W_{1}(Q_{n},D_{t}).$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;For each $n$, applying the triangle inequality $W_{1}(Q_{n},D_{t})\leq W_{1}(Q_{n},D_{\tau_{n}})+W_{1}(D_{\tau_{n}},D_{t})$ and average gives (&lt;a href="#A3.E53" title="In Proposition 4. ‣ C.4 A Drift-Aware Mismatch Decomposition (Four Observable Terms) ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;53&lt;/span&gt;&lt;/a&gt;)–(&lt;a href="#A3.E54" title="In Proposition 4. ‣ C.4 A Drift-Aware Mismatch Decomposition (Four Observable Terms) ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;54&lt;/span&gt;&lt;/a&gt;).
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A3.SS4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;To make $\mathrm{StdErr}_{t}$ explicit, suppose the stored residual uses estimated center/scale, $\widehat{z}_{n}=\operatorname{clip}((y_{n}-\widehat{f}(x_{n}))/\widehat{s}(x_{n}),[-M,M])$,
while the ideal residual is (&lt;a href="#A3.E50" title="In Proposition 4. ‣ C.4 A Drift-Aware Mismatch Decomposition (Four Observable Terms) ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;50&lt;/span&gt;&lt;/a&gt;).
Since $\operatorname{clip}(\cdot,[-M,M])$ is 1-Lipschitz and $W_{1}(P,Q)\leq\mathbb{E}|X-Y|$ for any coupling $(X,Y)$ of $P,Q$,
one convenient bound is&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A6.EGx14"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A3.E55"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\displaystyle\mathrm{StdErr}_{t} \displaystyle\leq\;\frac{1}{N_{t}}\sum_{n=1}^{N_{t}}\mathbb{E}\!\left[|\alpha_{n}|+\left|\beta_{n}\right|\cdot|\varepsilon_{n}|\;\middle|\;\mathcal{F}_{n-1}\right],$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;(55)&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;where $y_{n}=f(x_{n})+s(x_{n})\varepsilon_{n}$, $\alpha_{n}=\frac{f(x_{n})-\widehat{f}(x_{n})}{\widehat{s}(x_{n})}$ and $\beta_{n}=\frac{s(x_{n})-\widehat{s}(x_{n})}{\widehat{s}(x_{n})}$. Under winsorization $|\varepsilon_{n}|\leq M$, the second term is bounded by $M\,|s-\widehat{s}|/\widehat{s}$.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A3.SS5" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="assumptions-and-diagnostics"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;C.5 &lt;/span&gt;Assumptions and Diagnostics&lt;/h3&gt;
&lt;div id="A3.SS5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;We keep the assumptions explicit and map each to a simple diagnostic, so the theory is falsifiable. See table &lt;a href="#A5.T3" title="Table 3 ‣ Appendix E Additional Theory Details ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; for details.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="A3.T2" class="ltx_table"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_table"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Table 2&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Diagnostics toolbox: mapping modeling assumptions to loggable statistics.&lt;/span&gt;&lt;/figcaption&gt;
&lt;table class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle"&gt;
&lt;thead class="ltx_thead"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_justify ltx_align_top ltx_th ltx_th_column ltx_border_tt"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:117.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Assumption / term&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/th&gt;
&lt;th class="ltx_td ltx_align_justify ltx_align_top ltx_th ltx_th_column ltx_border_tt"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:143.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Diagnostic (loggable)&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/th&gt;
&lt;th class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top ltx_th ltx_th_column ltx_border_tt"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:147.4pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Failure mode indicator&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody class="ltx_tbody"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top ltx_border_t"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:117.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Conditional independence (or weak cross-candidate correlation)&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top ltx_border_t"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:143.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Cross-candidate correlation of standardized residuals within a generation&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top ltx_border_t"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:147.4pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Strong common random numbers / shared shocks&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:117.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Heavy tails handled by winsorization (&lt;/span&gt;$|\widehat{z}|\leq M$&lt;span class="ltx_text" style="font-size:90%;"&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:143.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Clipping saturation rate &lt;/span&gt;$\Pr(|\widehat{z}|=M)$&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:147.4pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;If large, analysis applies only to winsorized noise&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:117.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Finite pool size error&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:143.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Pool size &lt;/span&gt;$N_{t}$&lt;span class="ltx_text" style="font-size:90%;"&gt; (and bootstrap samples &lt;/span&gt;$B$&lt;span class="ltx_text" style="font-size:90%;"&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:147.4pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Small &lt;/span&gt;$N_{t}$&lt;span class="ltx_text" style="font-size:90%;"&gt; yields high Wasserstein-1 (&lt;/span&gt;$W_{1}$&lt;span class="ltx_text" style="font-size:90%;"&gt;) estimation error&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:117.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Shape / covariate shift&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:143.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Bucket by &lt;/span&gt;$|\widehat{m}|$&lt;span class="ltx_text" style="font-size:90%;"&gt; and compare buckets via KS / &lt;/span&gt;$W_{1}$&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:147.4pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Strong state-dependent noise shape not captured by standardization&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:117.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Drift / nonstationarity&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:143.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Sliding-window &lt;/span&gt;$W_{1}$&lt;span class="ltx_text" style="font-size:90%;"&gt; between recent pool slices&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:147.4pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Rapid drift breaks pooling across time&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:117.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Standardization error&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:143.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Split-median center stability; held-out scale CV&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:147.4pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Poor center/scale estimates induce systematic bias&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top ltx_border_bb"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:117.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Anti-concentration (few near ties)&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top ltx_border_bb"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:143.1pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Mass of pairwise gaps near &lt;/span&gt;$0$&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top ltx_border_bb"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:147.4pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Near-ties make rank-based updates unstable&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/figure&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="A4" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="decision-theoretic-analysis-for-probe-and-switch"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix D &lt;/span&gt;Decision-Theoretic Analysis for Probe-and-Switch&lt;/h2&gt;
&lt;div id="A4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;In practice, before optimization (or at a designated checkpoint), we sample a probe population from the current search distribution, evaluate each probe point twice
with independent oracle noise, and compute a rank-disagreement statistic:&lt;/p&gt;
&lt;table id="A4.E56" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$P\;:=\;\frac{1}{\lambda^{2}}\sum_{i=1}^{\lambda}\left|r_{i}^{(a)}-r_{i}^{(b)}\right|\;\in\;[0,1/2].$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(56)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Here, $r_{i}^{(a)}$ and $r_{i}^{(b)}$ are the ranks of the same candidate under the two independent evaluation vectors. The probe consumes $2\lambda$ evaluations, reducing the remaining optimization budget to $B-2\lambda$. Then, given a threshold $\tau\in[0,1/2]$, we run RB-PEM if $P\geq\tau$ and otherwise run standard CMA-ES (with one evaluation per candidate and no bootstrap).
This policy is explicitly budgeted: it pays a fixed probe cost up front, and it pays the RB-PEM overhead $K_{t}$ only in regimes where the probe indicates that
intra-generation ranking uncertainty is substantial.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;After paying a probe cost of $2\lambda$ evaluations, we must choose one of two actions
$a\in\{0,1\}$ for the remaining budget: $a=0$ runs CMA-ES, and $a=1$ runs RB-PEM.
Let $L_{a}$ denote the random loss (e.g., final noise-free best value) obtained by action $a$
under the remaining budget, and let $P\in[0,1/2]$ be the probe statistic
(Eq. (&lt;a href="#A4.E56" title="In Appendix D Decision-Theoretic Analysis for Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;56&lt;/span&gt;&lt;/a&gt;)).
A decision rule is any measurable map $\pi:[0,1/2]\to\{0,1\}$, and its risk is
$\mathcal{R}(\pi)=\mathbb{E}[L_{\pi(P)}]$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="Thmproposition5" class="ltx_theorem ltx_theorem_proposition"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_title_theorem"&gt;
&lt;span class="ltx_tag ltx_tag_theorem"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Proposition 5&lt;/span&gt;&lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt;.&lt;/span&gt;
&lt;/h6&gt;
&lt;div id="Thmproposition5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;Among all decision rules that depend only on $P$, the Bayes-optimal rule is&lt;/span&gt;&lt;/p&gt;
&lt;table id="A4.E57" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\pi^{\star}(p)=\mathbf{1}\{\Delta(p)\geq 0\}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(57)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_italic"&gt;If $\Delta(\cdot)$ is continuous and has a single crossing, i.e., there exists $p^{\star}$ such that
$\Delta(p)\leq 0$ for $p\leq p^{\star}$ and $\Delta(p)\geq 0$ for $p\geq p^{\star}$,
then $\pi^{\star}$ is a threshold rule $\pi^{\star}(p)=\mathbf{1}\{p\geq p^{\star}\}$.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof.&lt;/h6&gt;
&lt;div id="A4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;By iterated expectation,
$\mathcal{R}(\pi)=\mathbb{E}[\mathbb{E}[L_{\pi(P)}\mid P]]$.
For each realized $P=p$, the inner conditional expectation is minimized by choosing the action
with smaller conditional expected loss. This yields $\pi^{\star}(p)=\mathbf{1}\{\Delta(p)\geq 0\}$.
If $\Delta(\cdot)$ single-crosses, the set $\{p:\Delta(p)\geq 0\}$ is an interval $[p^{\star},1/2]$,
hence $\pi^{\star}$ is a threshold.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A4.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;A sufficient structural condition for a monotone/threshold rule is that (i) the relative benefit of
RB-PEM increases with an underlying misranking-severity parameter, and (ii) the probe statistic $P$
is stochastically increasing in that parameter (e.g., a monotone likelihood ratio signal).
In our setting, $P$ is a rank-disagreement proxy that is constant-factor equivalent to Kendall
discordance &lt;cite class="ltx_cite ltx_citemacro_citep"&gt;(Diaconis and Graham, &lt;a href="#bib.bib24" title="Spearman’s footrule as a measure of disarray" class="ltx_ref"&gt;1977&lt;/a&gt;)&lt;/cite&gt;, and our mechanism analysis links higher misranking to larger
update dispersion and curvature loss. We empirically validate approximate single-crossing behavior
in our core COCO regime.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A5" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="additional-theory-details"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix E &lt;/span&gt;Additional Theory Details&lt;/h2&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of Lemma &lt;a href="#Thmlemma2" title="Lemma 2. ‣ 5.1 PEM as the Conditional Mean Update ‣ 5 Theory ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt;.&lt;/h6&gt;
&lt;div id="A5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;For any $\mathcal{G}$-measurable $a$,&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A6.EGx15"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A5.Ex17"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\displaystyle\mathbb{E}\left[\|\Delta m-a\|^{2}\mid\mathcal{G}\right]=\mathbb{E}\left[\|\Delta m-\mathbb{E}[\Delta m\mid\mathcal{G}]\|^{2}\mid\mathcal{G}\right]+\|a-\mathbb{E}[\Delta m\mid\mathcal{G}]\|^{2},$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;by $\mathbb{E}[(\Delta m-\mathbb{E}[\Delta m\mid\mathcal{G}])^{\top}(a-\mathbb{E}[\Delta m\mid\mathcal{G}])\mid\mathcal{G}]=0$.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="A5.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Lemma &lt;a href="#Thmlemma2" title="Lemma 2. ‣ 5.1 PEM as the Conditional Mean Update ‣ 5 Theory ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;2&lt;/span&gt;&lt;/a&gt; is the same “conditioning improves an estimator” principle behind the classical Rao–Blackwell theorem; see, e.g., &lt;cite class="ltx_cite ltx_citemacro_citet"&gt;Lehmann and Casella (&lt;a href="#bib.bib65" title="Theory of point estimation" class="ltx_ref"&gt;1998&lt;/a&gt;); Casella and Berger (&lt;a href="#bib.bib64" title="Statistical inference" class="ltx_ref"&gt;2002&lt;/a&gt;)&lt;/cite&gt;.
Here the $\sigma$-field $\mathcal{G}$ is generated by the candidate set (and hence contains all information unrelated to evaluation noise), so $\Delta m_{\mathrm{PEM}}$ is the variance-reduced update that averages only over ranking uncertainty.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="ltx_proof"&gt;
&lt;h6 class="ltx_title ltx_runin ltx_font_italic ltx_title_proof"&gt;Proof of Theorem &lt;a href="#Thmtheorem1" title="Theorem 1. ‣ 5.2 Update Dispersion Induces Curvature Loss ‣ 5 Theory ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;.&lt;/h6&gt;
&lt;div id="A5.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Since $f$ is $\alpha$-strongly convex on the convex set $\mathcal{C}$, for any $u,v\in\mathcal{C}$,&lt;/p&gt;
&lt;table id="A5.E58" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$f(u)\;\geq\;f(v)+\langle\nabla f(v),u-v\rangle+\frac{\alpha}{2}\|u-v\|^{2}.$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(58)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;Apply (&lt;a href="#A5.E58" title="In Appendix E Additional Theory Details ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;58&lt;/span&gt;&lt;/a&gt;) with $u=X$ and $v=\bar{X}$, which is valid by Assumption &lt;a href="#Thmassumption1" title="Assumption 1 (Localized strong convexity with localization). ‣ C.2 From Distribution Mismatch to PEM ‣ Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;(ii), and take conditional expectation:&lt;/p&gt;
&lt;div class="paper-eqgroup"&gt;&lt;span class="paper-eq-anchor" id="A6.EGx16"&gt;&lt;/span&gt;&lt;span class="paper-eq-anchor" id="A5.Ex18"&gt;&lt;/span&gt;&lt;div class="paper-eqgroup-body"&gt;$$\displaystyle\mathbb{E}\left[f(X)\mid x_{1:\lambda}\right]\geq f(\bar{X})+\left\langle\nabla f(\bar{X}),\mathbb{E}\left[X-\bar{X}\mid x_{1:\lambda}\right]\right\rangle+\frac{\alpha}{2}\mathbb{E}\left[\|X-\bar{X}\|^{2}\mid x_{1:\lambda}\right].$$&lt;/div&gt;&lt;div class="paper-eqgroup-no"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class="ltx_p"&gt;The middle term vanishes because $\mathbb{E}\left[X-\bar{X}\mid x_{1:\lambda}\right]=0$ by the definition of $\bar{X}$.
∎&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figure id="A5.T3" class="ltx_table"&gt;
&lt;table class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle"&gt;
&lt;thead class="ltx_thead"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_justify ltx_align_top ltx_th ltx_th_column ltx_border_tt" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:34.7pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;ID&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/th&gt;
&lt;th class="ltx_td ltx_align_justify ltx_align_top ltx_th ltx_th_column ltx_border_tt" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:86.7pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Figure/Table&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/th&gt;
&lt;th class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top ltx_th ltx_th_column ltx_border_tt" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:286.2pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;What it demonstrates (and why it matters)&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody class="ltx_tbody"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top ltx_border_t" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:34.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;F1&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top ltx_border_t" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:86.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Fig. &lt;/span&gt;&lt;a href="#A6.F7" title="Figure 7 ‣ F.1 Mechanism Validation on a Controlled Quadratic ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref" style="font-size:90%;"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top ltx_border_t" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:286.2pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;A controlled mechanism chain:
more misranking &lt;/span&gt;$\Rightarrow$&lt;span class="ltx_text" style="font-size:90%;"&gt; larger update dispersion &lt;/span&gt;$\Rightarrow$&lt;span class="ltx_text" style="font-size:90%;"&gt; larger curvature-induced loss, matching Theorem &lt;/span&gt;&lt;a href="#Thmtheorem1" title="Theorem 1. ‣ 5.2 Update Dispersion Induces Curvature Loss ‣ 5 Theory ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref" style="font-size:90%;"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;.&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:34.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;F2&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:86.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Fig. &lt;/span&gt;&lt;a href="#A6.F8" title="Figure 8 ‣ F.1 Mechanism Validation on a Controlled Quadratic ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref" style="font-size:90%;"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;; Tab. &lt;/span&gt;&lt;a href="#A6.T4" title="Table 4 ‣ F.3 Log-Weight Ablation ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref" style="font-size:90%;"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:286.2pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;RB-PEM gains are robust to estimator knobs and to the bootstrap-internal weight map, and persist even when boundary reevaluation overhead is disabled (&lt;/span&gt;$K_{\max}=0$&lt;span class="ltx_text" style="font-size:90%;"&gt;), ruling out “hidden resampling” or a special weight parametrization as the main driver.&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:34.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;F3&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:86.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Fig. &lt;/span&gt;&lt;a href="#A6.F9" title="Figure 9 ‣ F.4 Residual-Pool Diagnostic Snapshots ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref" style="font-size:90%;"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;9&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:286.2pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Online diagnostics separate successes from failures and reveal &lt;/span&gt;&lt;em class="ltx_emph ltx_font_italic" style="font-size:90%;"&gt;which&lt;/em&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt; assumptions break; failures often manifest as &lt;/span&gt;&lt;em class="ltx_emph ltx_font_italic" style="font-size:90%;"&gt;depth collapse&lt;/em&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt; due to excessive boundary reevaluations.&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:34.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;F4&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:86.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Fig. &lt;/span&gt;&lt;a href="#A6.F10" title="Figure 10 ‣ F.4 Residual-Pool Diagnostic Snapshots ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref" style="font-size:90%;"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;10&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:286.2pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;The rank-disagreement statistic used by the probe is tightly related to Kendall discordance and top-&lt;/span&gt;$\mu$&lt;span class="ltx_text" style="font-size:90%;"&gt; elite disagreement; empirically, the theoretical bounds are never violated.&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:34.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;F5&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:86.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Fig. &lt;/span&gt;&lt;a href="#A6.F11" title="Figure 11 ‣ F.6 Variance Does Not Equal Misranking (A Counterexample) ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref" style="font-size:90%;"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:286.2pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;A counterexample where local variance is &lt;/span&gt;&lt;em class="ltx_emph ltx_font_italic" style="font-size:90%;"&gt;zero&lt;/em&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt; but misranking is large; misranking-based probe succeeds while variance-based probe fails, justifying our probe design.&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:34.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;F6&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:86.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Fig. &lt;/span&gt;&lt;a href="#A6.F12" title="Figure 12 ‣ F.7 Probe Calibration Curves ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref" style="font-size:90%;"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;12&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:286.2pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Calibration curves: &lt;/span&gt;$\Pr(\text{RB-PEM wins}\mid P)$&lt;span class="ltx_text" style="font-size:90%;"&gt; is monotone in the probe statistic &lt;/span&gt;$P$&lt;span class="ltx_text" style="font-size:90%;"&gt;, supporting a threshold rule as in Prop. &lt;/span&gt;&lt;a href="#Thmproposition5" title="Proposition 5. ‣ Appendix D Decision-Theoretic Analysis for Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref" style="font-size:90%;"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;.&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:34.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;F7&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:86.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Fig. &lt;/span&gt;&lt;a href="#A6.F13" title="Figure 13 ‣ F.7 Probe Calibration Curves ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref" style="font-size:90%;"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;13&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:286.2pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Probe budget vs. reliability: small probes already discriminate well (AUC &lt;/span&gt;$\approx 0.71$&lt;span class="ltx_text" style="font-size:90%;"&gt; at &lt;/span&gt;$\lambda{=}4$&lt;span class="ltx_text" style="font-size:90%;"&gt;) and saturate near the default population size.&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:34.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;F8&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:86.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Fig. &lt;/span&gt;&lt;a href="#A6.F14" title="Figure 14 ‣ F.9 Threshold Sensitivity Analysis ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref" style="font-size:90%;"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;14&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:286.2pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Threshold choice is not brittle: accuracy and decision regret exhibit a broad plateau; misranking probe dominates a variance proxy across thresholds.&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:34.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;F9&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:86.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Fig. &lt;/span&gt;&lt;a href="#A6.F15" title="Figure 15 ‣ F.10 Depth–Fidelity Robustness and UH-CMA-ES Sensitivity ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref" style="font-size:90%;"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;15&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:286.2pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Depth–fidelity robustness across budgets/dimensions and a UH-CMA-ES sweep showing evaluation-stage reevaluation is structurally disadvantaged under fixed budget.&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:34.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;F10&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:86.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Fig. &lt;/span&gt;&lt;a href="#A6.F16" title="Figure 16 ‣ F.11 External Validity on a Nonconvex Real-Data Task ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref" style="font-size:90%;"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;16&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:286.2pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;External validity on a nonconvex real-data task; warmstarting can eliminate probe overhead when evaluations are effectively deterministic.&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:34.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;F11&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:86.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Tab. &lt;/span&gt;&lt;a href="#A6.T5" title="Table 5 ‣ F.12 Complete Results on High-Misranking COCO Functions ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref" style="font-size:90%;"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:286.2pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Complete COCO results on the high-misranking function class, demonstrating the main-text pattern is not cherry-picked.&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top ltx_border_bb" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:34.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;F12&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_align_justify ltx_align_top ltx_border_bb" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:86.7pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Tabs. &lt;/span&gt;&lt;a href="#A6.T6" title="Table 6 ‣ F.13 All-Function Breakdowns by Probe Regime and Noise Family ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref" style="font-size:90%;"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;–&lt;/span&gt;&lt;a href="#A6.T7" title="Table 7 ‣ F.13 All-Function Breakdowns by Probe Regime and Noise Family ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref" style="font-size:90%;"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td class="ltx_td ltx_nopad_r ltx_align_justify ltx_align_top ltx_border_bb" style="padding:0.65pt 3.0pt;"&gt;
&lt;span class="ltx_inline-block ltx_align_top"&gt;
&lt;span class="ltx_p" style="width:286.2pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;All-function breakdowns by probe-defined regime and noise family, showing where selection-stage smoothing helps and where probe-and-switch avoids unnecessary overhead.&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;figcaption class="ltx_caption ltx_centering" style="font-size:90%;"&gt;&lt;span class="ltx_tag ltx_tag_table"&gt;Table 3: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Appendix experiment roadmap.&lt;/span&gt; Each experiment targets a distinct link in the paper’s argument:
(i) depth-over-fidelity mechanism (F1, F9, F11), (ii) RB-PEM validity and robustness (F2–F4),
and (iii) probe-and-switch design and tuning (F5–F8, F10).&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/section&gt;
&lt;section id="A6" class="ltx_appendix"&gt;
&lt;h2 class="ltx_title ltx_title_appendix" id="additional-experiments"&gt;
&lt;span class="ltx_tag ltx_tag_appendix"&gt;Appendix F &lt;/span&gt;Additional Experiments&lt;/h2&gt;
&lt;div id="A6.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;This appendix provides supplementary experimental evidence supporting the paper’s central thesis:
under strict fixed evaluation budgets, the dominant efficiency bottleneck for noisy rank-based evolution strategies is often
&lt;em class="ltx_emph ltx_font_italic"&gt;update quality per oracle call&lt;/em&gt;, not update quality per generation.
Accordingly, methods that spend budget on &lt;em class="ltx_emph ltx_font_italic"&gt;evaluation-stage&lt;/em&gt; denoising (e.g., uniform resampling or
uncertainty-handling reevaluations) can lose by collapsing &lt;em class="ltx_emph ltx_font_italic"&gt;depth&lt;/em&gt; (the number of completed generations),
while &lt;em class="ltx_emph ltx_font_italic"&gt;selection-stage&lt;/em&gt; uncertainty integration (RB-PEM) can improve performance at near-maximal depth.
We also provide targeted evidence for the design of our probe-and-switch policy.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Note that relative to the earlier experimental plan, we (i) removed the planned transfer-matrix experiment, and
(ii) merged the prior “budget grid” and “UH &lt;span class="ltx_text ltx_font_typewriter"&gt;maxevals&lt;/span&gt; sweep” into a single robustness study.
To avoid gaps and to make cross-referencing unambiguous, we renumber the appendix experiments sequentially as
F1–F11 below.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Table &lt;a href="#A5.T3" title="Table 3 ‣ Appendix E Additional Theory Details ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;3&lt;/span&gt;&lt;/a&gt; summarizes the role of each appendix experiment and the key
alternative explanation it addresses.&lt;/p&gt;
&lt;/div&gt;
&lt;section id="A6.SS1" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="mechanism-validation-on-a-controlled-quadratic"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;F.1 &lt;/span&gt;Mechanism Validation on a Controlled Quadratic&lt;/h3&gt;
&lt;div id="A6.SS1.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Theorem &lt;a href="#Thmtheorem1" title="Theorem 1. ‣ 5.2 Update Dispersion Induces Curvature Loss ‣ 5 Theory ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; formalizes the key mechanism behind “depth over fidelity”:
under local curvature, conditional update dispersion incurs an unavoidable Jensen gap, so reducing dispersion
can improve expected progress per oracle call.
This experiment tests the full mechanism chain in the simplest setting where the curvature penalty is
analytically transparent.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Setup&lt;/span&gt;.
We use a strongly convex quadratic $f(x)=\frac{1}{2}\|x\|^{2}$ (strong convexity parameter $\alpha=1$) and sample
$\lambda=16$ candidates in $d=40$ dimensions (truncation $\mu=8$).
For each of 200 independently sampled candidate sets, we draw &lt;em class="ltx_emph ltx_font_italic"&gt;two&lt;/em&gt; independent noisy evaluation vectors
(with additive Gaussian noise of standard deviation $\sigma_{\mathrm{noise}}=1.0$), producing two induced rankings.
We measure:
(i) a two-draw rank-disagreement score $M_{\mathrm{RD}}$ (same structure as the probe statistic $P$ in
Eq. (&lt;a href="#A4.E56" title="In Appendix D Decision-Theoretic Analysis for Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;56&lt;/span&gt;&lt;/a&gt;));
(ii) &lt;em class="ltx_emph ltx_font_italic"&gt;update dispersion&lt;/em&gt; $\|\Delta m^{(a)}-\Delta m^{(b)}\|^{2}$ under the two rankings; and
(iii) the &lt;em class="ltx_emph ltx_font_italic"&gt;curvature loss&lt;/em&gt; (Jensen gap) $\mathbb{E}[f(m+\Delta m)]-f(m+\mathbb{E}[\Delta m])$, estimated via Monte Carlo
(256 draws per candidate set).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS1.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Results and interpretation&lt;/span&gt;.
Figure &lt;a href="#A6.F7" title="Figure 7 ‣ F.1 Mechanism Validation on a Controlled Quadratic ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt; verifies both links in the chain.
First, dispersion increases with misranking (Pearson $r=0.45$; Fig. &lt;a href="#A6.F7" title="Figure 7 ‣ F.1 Mechanism Validation on a Controlled Quadratic ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;a),
showing that ranking noise is directly converted into update randomness by truncation selection.
Second, the curvature loss matches the quadratic identity
$\mathbb{E}[f(m+\Delta m)]-f(m+\mathbb{E}[\Delta m])=\tfrac{1}{2}\mathrm{Var}(\Delta m)$ exactly (slope 1; Fig. &lt;a href="#A6.F7" title="Figure 7 ‣ F.1 Mechanism Validation on a Controlled Quadratic ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt;b).
Together, these results give a controlled, falsifiable confirmation of the theoretical story:
misranking is not merely “label noise”, it induces update dispersion, and under curvature that dispersion
translates into real expected objective loss.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="A6.F7" class="ltx_figure"&gt;&lt;img style="width:95%" width="439" height="165" loading="lazy" src="fig_a1_mechanism_quadratic.svg" id="A6.F7.g1" class="ltx_graphics ltx_centering " alt="Refer to caption"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Figure 7&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Mechanism validation on a strongly convex quadratic.&lt;span class="ltx_text ltx_font_medium"&gt;
(a) Update dispersion $\|\Delta m^{(a)}-\Delta m^{(b)}\|^{2}$ grows with two-draw misranking $M_{\mathrm{RD}}$ (Pearson $r=0.45$).
(b) For quadratic objectives, the Jensen gap equals $\tfrac{1}{2}\mathrm{Var}(\Delta m)$ exactly (slope 1), confirming that dispersion translates into expected loss under curvature.
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; $d{=}40$, $\lambda{=}16$, $\mu{=}8$, $\sigma_{\mathrm{noise}}{=}1.0$.
200 independently sampled candidate sets; 256 Monte Carlo draws per set.
This is a single-step analysis (no optimization loop).&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure id="A6.F8" class="ltx_figure"&gt;&lt;img style="width:95%" width="482" height="130" loading="lazy" src="fig_a2_ablations.svg" id="A6.F8.g1" class="ltx_graphics ltx_centering " alt="Refer to caption"&gt;
&lt;figcaption class="ltx_caption ltx_centering" style="font-size:80%;"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;&lt;span class="ltx_text" style="font-size:113%;"&gt;Figure 8&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:113%;"&gt;Estimator ablations on the high-misranking COCO subset ($d{=}40$, $B{=}100d$, 225 problems).&lt;span class="ltx_text ltx_font_medium"&gt;
Boxplots show per-instance $\Delta\log_{10}$ regret relative to CMA-ES; the dashed line marks parity.
Percentages report win rates (fraction with $\Delta&amp;gt;0$).
(a) Reevaluation cap $K_{\max}$: gains persist even at $K_{\max}{=}0$ (no boundary reevaluations).
(b) Bootstrap samples $B_{\mathrm{boot}}$: stable across 16–64.
(c) Noise-model choice: all variants improve; variance-based modeling yields the highest win rate (72%).
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; $\lambda{=}15$, $\mu{=}7$. Non-ablated hyperparameters held at defaults ($B_{\mathrm{boot}}{=}32$, $K_{\max}{=}1$).
225 problems (15 functions $\times$ 15 instances), each run once per method.
Boxes show the median (center line) and interquartile range (IQR); whiskers extend to $1.5\times$ IQR; outliers plotted individually.&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/section&gt;
&lt;section id="A6.SS2" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="rb-pem-estimator-ablations"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;F.2 &lt;/span&gt;RB-PEM Estimator Ablations&lt;/h3&gt;
&lt;div id="A6.SS2.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;A natural concern is that RB-PEM’s gains might be fragile (driven by a narrow hyperparameter choice), or
they might simply reflect spending extra evaluations near the truncation boundary (i.e., implicit resampling).
This ablation isolates these possibilities.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Setup&lt;/span&gt;. We evaluate RB-PEM variants on the COCO &lt;span class="ltx_text ltx_font_typewriter"&gt;bbob-noisy&lt;/span&gt; high-misranking subset at $d=40$ and budget $B=100d$
(225 problems: 15 functions $\times$ 15 instances).
For each problem instance, we report
$\Delta\log_{10}\text{regret}=\log_{10}(f(\hat{x}_{B})-f^{\star})_{\text{CMA}}-\log_{10}(f(\hat{x}_{B})-f^{\star})_{\text{variant}}$,
so $\Delta&amp;gt;0$ means the variant improves over CMA-ES.
Figure &lt;a href="#A6.F8" title="Figure 8 ‣ F.1 Mechanism Validation on a Controlled Quadratic ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt; sweeps:
(a) boundary reevaluation cap $K_{\max}\in\{0,1,3\}$;
(b) bootstrap sample count $B_{\mathrm{boot}}\in\{16,32,64\}$;
(c) noise-model variants used inside the bootstrap weight estimator.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS2.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Results and interpretation&lt;/span&gt;.
All variants exhibit positive median improvements and clear majority win rates (62–72%; Fig. &lt;a href="#A6.F8" title="Figure 8 ‣ F.1 Mechanism Validation on a Controlled Quadratic ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;8&lt;/span&gt;&lt;/a&gt;).
Two implications are especially important.
First, the improvement persists at $K_{\max}=0$ (66% win rate), where RB-PEM operates with essentially the
same per-generation evaluation cost as vanilla CMA-ES.
This strongly disfavors the hypothesis that RB-PEM wins primarily by spending extra evaluations at the boundary.
Instead, it supports the intended interpretation: the main gain comes from how uncertainty is used
(selection-stage smoothing of the rank weights), not from brute-force denoising.
Second, performance is stable across bootstrap counts and across several plausible noise models, suggesting that the
estimator is not brittle and that modest Monte Carlo effort (e.g., $B_{\mathrm{boot}}\approx 32$) is sufficient.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A6.SS3" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="log-weight-ablation"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;F.3 &lt;/span&gt;Log-Weight Ablation&lt;/h3&gt;
&lt;div id="A6.SS3.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The CMA-ES baseline uses its standard logarithmic recombination weights throughout.
Our default RB-PEM estimator uses a smooth power-lift weight map inside the bootstrap, and Probe-and-Switch inherits this default when it switches to RB-PEM.
This ablation asks whether the gains depend on that bootstrap-internal choice.
We rerun matched variants that replace only the bootstrap-internal map with the standard CMA-ES log weights from (&lt;a href="#A1.E31" title="In Appendix A CMA-ES Specification ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;31&lt;/span&gt;&lt;/a&gt;), holding seeds, candidate populations, budgets, and all other hyperparameters fixed.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="A6.T4" class="ltx_table"&gt;
&lt;table class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle"&gt;
&lt;thead class="ltx_thead"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_border_tt" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Method (vs. CMA-ES)&lt;/span&gt;&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt" style="padding:0.55pt 5.0pt;"&gt;$B=20d$&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt" style="padding:0.55pt 5.0pt;"&gt;$B=50d$&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt" style="padding:0.55pt 5.0pt;"&gt;$B=100d$&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt" style="padding:0.55pt 5.0pt;"&gt;$B=200d$&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody class="ltx_tbody"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_left ltx_border_t" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;RB-PEM (power-lift)&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_t" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;65.6%&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_t" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;69.5%&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_t" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;68.1%&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_t" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;62.2%&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_left" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;RB-PEM (log-weight)&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;63.7%&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;66.4%&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;67.7%&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;62.2%&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_left" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Probe-and-Switch (power-lift)&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;63.7%&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;67.3%&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;65.2%&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;65.3%&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;td class="ltx_td ltx_align_left ltx_border_bb" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Probe-and-Switch (log-weight)&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;61.2%&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;62.4%&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;65.3%&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb" style="padding:0.55pt 5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;62.5%&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;figcaption class="ltx_caption ltx_centering" style="font-size:90%;"&gt;&lt;span class="ltx_tag ltx_tag_table"&gt;Table 4: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Log-weight ablation.&lt;/span&gt;
Win rates against CMA-ES on the high-misranking COCO subset across four budgets.
The CMA-ES baseline uses standard logarithmic recombination weights in every row; the ablation changes only the bootstrap-internal weight map used by RB-PEM, either directly or inside Probe-and-Switch.
The maximum gap between each default method and its log-weight counterpart is $3.1$ percentage points, indicating that the expected-weight mechanism is not tied to the power-lift parametrization.
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; 15 high-misranking functions $\times$ 15 instances $\times$ 3 dimensions = 675 matched problems per budget; $B_{\mathrm{boot}}{=}32$, $K_{\max}{=}1$, and shared seeds/candidate populations across paired variants.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div id="A6.SS3.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Direct head-to-head comparisons also show near parity between the two bootstrap-internal weight maps: RB-PEM (log-weight) wins against RB-PEM (power-lift) on roughly $44\%$ of matched high-misranking problems, with median regret differences around $10^{-3}$.
Median wall-clock overheads at $d=40$, $B=100d$ are similar as well: $1.70\times$, $1.64\times$, $1.66\times$, and $1.62\times$ CMA-ES for RB-PEM (power-lift), RB-PEM (log-weight), Probe-and-Switch (power-lift), and Probe-and-Switch (log-weight), respectively.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A6.SS4" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="residual-pool-diagnostic-snapshots"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;F.4 &lt;/span&gt;Residual-Pool Diagnostic Snapshots&lt;/h3&gt;
&lt;div id="A6.SS4.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;RB-PEM relies on reusing a pooled residual distribution; Appendix &lt;a href="#A3" title="Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;C&lt;/span&gt;&lt;/a&gt; shows that
residual-pool mismatch can be decomposed into multiple falsifiable components.
This experiment asks whether our diagnostics meaningfully distinguish successful runs from failures and whether they
identify the relevant mismatch mode.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS4.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Setup&lt;/span&gt;. On the same 225 high-misranking COCO problems ($d=40$, $B=100d$), we compare RB-PEM against a representative
evaluation-stage baseline (UH-CMA-ES with a conservative reevaluation budget).
We label each run as &lt;em class="ltx_emph ltx_font_italic"&gt;good&lt;/em&gt; if RB-PEM achieves lower final regret and &lt;em class="ltx_emph ltx_font_italic"&gt;bad&lt;/em&gt; otherwise (193 good, 32 bad).
We then compare four per-run diagnostic summaries (defined in Appendix &lt;a href="#A3" title="Appendix C Residual Pool Theory and Diagnostics ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;C&lt;/span&gt;&lt;/a&gt;):
drift $W_{1}$, shape $W_{1}$, scale $R^{2}$, and a centering-stability metric (“center rel”).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS4.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Results: diagnostics isolate specific failure modes&lt;/span&gt;.
Figure &lt;a href="#A6.F9" title="Figure 9 ‣ F.4 Residual-Pool Diagnostic Snapshots ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;9&lt;/span&gt;&lt;/a&gt;a shows that &lt;em class="ltx_emph ltx_font_italic"&gt;shape&lt;/em&gt; mismatch and &lt;em class="ltx_emph ltx_font_italic"&gt;centering&lt;/em&gt; instability are the dominant
distinguishers between good and bad runs:
one-sided Mann–Whitney tests detect significant separation for shape $W_{1}$ ($p=0.003$) and center rel ($p=0.001$),
while drift and scale do not separate at conventional levels.
This selective pattern is desirable: rather than firing a generic alarm, the diagnostics point to a concrete
assumption violation (“residuals are well-standardized and shape-stable”) as the likely culprit in failures.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS4.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Results: failures often manifest as depth collapse&lt;/span&gt;.
Figure &lt;a href="#A6.F9" title="Figure 9 ‣ F.4 Residual-Pool Diagnostic Snapshots ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;9&lt;/span&gt;&lt;/a&gt;b shows per-generation traces of shape $W_{1}$ for a representative good and bad case.
The bad case exhausts its fixed budget by generation 129, while the good case continues to generation 211
($\Delta T=82$ generations; 39% of depth lost).
This illustrates a concrete failure pathway that is consistent with the paper’s depth accounting:
instability in standardization can increase boundary reevaluations (raising $K_{t}$), which directly consumes budget and
eliminates the depth advantage RB-PEM is designed to preserve.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="A6.F9" class="ltx_figure"&gt;&lt;img style="width:100%" width="485" height="181" loading="lazy" src="fig_a3_diagnostics.svg" id="A6.F9.g1" class="ltx_graphics ltx_centering " alt="Refer to caption"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Figure 9&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Diagnostics make residual-pool assumptions falsifiable.&lt;span class="ltx_text ltx_font_medium"&gt;
(a) Boxplots of four diagnostic summaries for &lt;em class="ltx_emph ltx_font_italic"&gt;good&lt;/em&gt; runs ($n=193$, RB-PEM wins) vs. &lt;em class="ltx_emph ltx_font_italic"&gt;bad&lt;/em&gt; runs ($n=32$, RB-PEM loses) on the COCO high-misranking subset ($d=40$, $B=100d$).
Shape $W_{1}$ ($p=0.003$) and centering stability ($p=0.001$) significantly separate the two groups (one-sided Mann–Whitney); drift and scale do not, indicating that shape mismatch and standardization instability are the dominant failure modes.
(b) Per-generation traces of shape $W_{1}$ (faint: raw; solid: smoothed) for a representative good and bad run.
The bad run terminates at generation 129, losing $\Delta T=82$ generations (39% of depth) relative to the good run (generation 211), illustrating how pool mismatch triggers depth collapse—the same mechanism the paper’s budget accounting predicts.
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; $\lambda{=}15$, $\mu{=}7$, $B_{\mathrm{boot}}{=}32$, $K_{\max}{=}1$.
225 problems (15 functions $\times$ 15 instances), each run once.
Boxes show the median and IQR; whiskers extend to $1.5\times$ IQR; boxplot outlier markers suppressed. Individual data points overlaid as jittered scatter.&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure id="A6.F10" class="ltx_figure"&gt;&lt;img style="width:100%" width="483" height="165" loading="lazy" src="fig_a4_misranking_sandwich.svg" id="A6.F10.g1" class="ltx_graphics ltx_centering " alt="Refer to caption"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Figure 10&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Empirical validation of sandwich bounds for rank disagreement.&lt;span class="ltx_text ltx_font_medium"&gt;
(a) Kendall discordance $q_{\mathrm{pair}}$ vs. $M_{\mathrm{RD}}$; (b) top-$\mu$ disagreement $M_{\mathrm{top}\mu}$ vs. $M_{\mathrm{RD}}$.
Grey lines indicate the bounds in Eq. (&lt;a href="#A6.E59" title="In F.5 Interpreting the Rank-Disagreement Probe via Sandwich Bounds ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;59&lt;/span&gt;&lt;/a&gt;). Zero violations.
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; $d{=}40$, $\lambda{=}15$, $\mu{=}7$.
750 candidate sets from COCO &lt;span class="ltx_text ltx_font_typewriter"&gt;bbob-noisy&lt;/span&gt; (30 functions $\times$ 1 instance $\times$ 25 candidate sets per function), sampled via CMA-ES evolution.&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/section&gt;
&lt;section id="A6.SS5" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="interpreting-the-rank-disagreement-probe-via-sandwich-bounds"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;F.5 &lt;/span&gt;Interpreting the Rank-Disagreement Probe via Sandwich Bounds&lt;/h3&gt;
&lt;div id="A6.SS5.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Probe-and-switch (Appendix &lt;a href="#A4" title="Appendix D Decision-Theoretic Analysis for Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;D&lt;/span&gt;&lt;/a&gt;) uses a rank-disagreement statistic
$P=\frac{1}{\lambda^{2}}\sum_{i}|r_{i}^{(a)}-r_{i}^{(b)}|$ (Eq. (&lt;a href="#A4.E56" title="In Appendix D Decision-Theoretic Analysis for Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;56&lt;/span&gt;&lt;/a&gt;)).
This statistic is essentially a normalized Spearman footrule distance between two permutations.
To connect it to more familiar notions of misranking, we relate it to:
(i) Kendall discordance (fraction of discordant pairs) and
(ii) &lt;em class="ltx_emph ltx_font_italic"&gt;elite disagreement&lt;/em&gt; (how often the top-$\mu$ set changes),
which directly governs truncation selection.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS5.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Theoretical relations&lt;/span&gt;.
Let $q_{\mathrm{pair}}\in[0,1]$ be the fraction of discordant pairs between the two induced rankings (Kendall),
and let $M_{\mathrm{top}\mu}\in[0,1]$ be the fraction of indices whose membership in the top-$\mu$ set differs.
Standard inequalities between footrule and Kendall distances imply constant-factor bounds of the form&lt;/p&gt;
&lt;table id="A6.E59" class="ltx_equation ltx_eqn_table"&gt;
&lt;tbody&gt;&lt;tr class="ltx_equation ltx_eqn_row ltx_align_baseline"&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padleft"&gt;&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_align_center"&gt;$$\frac{\lambda}{\lambda-1}M_{\mathrm{RD}}\;\leq\;q_{\mathrm{pair}}\;\leq\;\frac{2\lambda}{\lambda-1}M_{\mathrm{RD}},\qquad M_{\mathrm{top}\mu}\;\leq\;\frac{\lambda^{2}}{2\mu}M_{\mathrm{RD}},$$&lt;/td&gt;
&lt;td class="ltx_eqn_cell ltx_eqn_center_padright"&gt;&lt;/td&gt;
&lt;td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"&gt;&lt;span class="ltx_tag ltx_tag_equation ltx_align_right"&gt;(59)&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class="ltx_p"&gt;where $M_{\mathrm{RD}}$ is the two-draw rank-disagreement score (numerically the same object as $P$ up to notation).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS5.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Empirical validation&lt;/span&gt;.
We sample 750 candidate sets from COCO &lt;span class="ltx_text ltx_font_typewriter"&gt;bbob-noisy&lt;/span&gt; at $d=40$ with the default $\lambda=15$ and $\mu=7$.
Figure &lt;a href="#A6.F10" title="Figure 10 ‣ F.4 Residual-Pool Diagnostic Snapshots ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;10&lt;/span&gt;&lt;/a&gt; shows $(q_{\mathrm{pair}},M_{\mathrm{top}\mu})$ versus $M_{\mathrm{RD}}$ together with
the bounds in Eq. (&lt;a href="#A6.E59" title="In F.5 Interpreting the Rank-Disagreement Probe via Sandwich Bounds ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;59&lt;/span&gt;&lt;/a&gt;).
There are zero violations out of 750 points.
This supports two practical interpretations:
(i) $M_{\mathrm{RD}}$ is a scale-consistent proxy for overall rank instability (Kendall discordance), and
(ii) large $M_{\mathrm{RD}}$ implies nontrivial instability of the top-$\mu$ set, which is precisely the part of the ranking
that affects CMA-ES updates most strongly.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A6.SS6" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="variance-does-not-equal-misranking-a-counterexample"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;F.6 &lt;/span&gt;Variance Does Not Equal Misranking (A Counterexample)&lt;/h3&gt;
&lt;div id="A6.SS6.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;A tempting simplification would be to trigger switching based on a &lt;em class="ltx_emph ltx_font_italic"&gt;variance probe&lt;/em&gt; (estimate the noise variance
at a point and switch when it is large).
This experiment constructs a clean counterexample showing that variance at a single location can be arbitrarily
misleading for rank-based ES, while rank disagreement remains reliable.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS6.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Radial (state-dependent) noise model&lt;/span&gt;.
We consider heteroscedastic noise with scale increasing with distance to an initial reference point $x_{0}$:
$\sigma_{\mathrm{eff}}(x)=\sigma\|x-x_{0}\|_{\mathrm{RMS}}$.
Under this model, evaluations &lt;em class="ltx_emph ltx_font_italic"&gt;at&lt;/em&gt; $x_{0}$ are effectively noiseless, but ES candidates sampled away from $x_{0}$
experience substantial noise—exactly where misranking matters.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS6.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Probe decoupling&lt;/span&gt;.
Figure &lt;a href="#A6.F11" title="Figure 11 ‣ F.6 Variance Does Not Equal Misranking (A Counterexample) ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;a shows the key pathology:
the variance probe stays at machine precision across all 54 problem instances (it never triggers),
while the rank-disagreement probe $M_{\mathrm{RD}}$ spans a wide range and triggers on 49/54 problems
(at $\tau=0.12$).
Thus, variance can be &lt;em class="ltx_emph ltx_font_italic"&gt;decoupled&lt;/em&gt; from the misranking regime experienced by the candidate population.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS6.p4" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Algorithmic consequence&lt;/span&gt;.
This decoupling changes decisions.
Figure &lt;a href="#A6.F11" title="Figure 11 ‣ F.6 Variance Does Not Equal Misranking (A Counterexample) ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;11&lt;/span&gt;&lt;/a&gt;b compares probe-and-switch using misranking detection (MR) versus a variance-based
variant (Var). Misranking-based switching wins on 39/54 problems ($p=0.0007$, sign test).
This provides direct support for our design choice in Appendix &lt;a href="#A4" title="Appendix D Decision-Theoretic Analysis for Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;D&lt;/span&gt;&lt;/a&gt;: a probe should measure ranking
instability &lt;em class="ltx_emph ltx_font_italic"&gt;in the current search distribution&lt;/em&gt;, not variance at an arbitrary point.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="A6.F11" class="ltx_figure"&gt;&lt;img style="width:100%" width="481" height="178" loading="lazy" src="fig_a5_probe_decoupling.svg" id="A6.F11.g1" class="ltx_graphics ltx_centering " alt="Refer to caption"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Figure 11&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Variance $\neq$ misranking under radial noise.&lt;span class="ltx_text ltx_font_medium"&gt;
(a) The variance probe is near machine precision while the misranking probe varies widely; triggers: MR 49/54, Var 0/54.
(b) Switching decisions: MR-based probe-and-switch outperforms variance-based (MR wins 39/54; $p=0.0007$).
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; Radial noise $\sigma_{\mathrm{eff}}(x)=0.5\|x-x_{0}\|$, $d\in\{80,160,320\}$, $B=200d$, $B_{\mathrm{boot}}{=}32$, $K_{\max}{=}1$.
$\lambda$ follows the CMA-ES default at each $d$ (17, 19, 21).
54 problems (6 functions $\times$ 3 instances $\times$ 3 dimensions), each run once per method.&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/section&gt;
&lt;section id="A6.SS7" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="probe-calibration-curves"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;F.7 &lt;/span&gt;Probe Calibration Curves&lt;/h3&gt;
&lt;div id="A6.SS7.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Proposition &lt;a href="#Thmproposition5" title="Proposition 5. ‣ Appendix D Decision-Theoretic Analysis for Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; shows that if the conditional advantage $\Delta(p)$ single-crosses,
then a &lt;em class="ltx_emph ltx_font_italic"&gt;threshold&lt;/em&gt; rule in the probe statistic $P$ is Bayes-optimal among rules depending only on $P$.
This experiment empirically checks whether $P$ behaves as a calibrated predictor of when RB-PEM wins.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS7.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Setup&lt;/span&gt;.
We compute the probe statistic $P$ (Eq. (&lt;a href="#A4.E56" title="In Appendix D Decision-Theoretic Analysis for Probe-and-Switch ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;56&lt;/span&gt;&lt;/a&gt;)) and bin problems into quantiles of $P$.
Within each bin we estimate the empirical win rate of RB-PEM over CMA-ES, with 95% Wilson score intervals.
To test generalization and avoid within-suite leakage, we evaluate on a held-out test split of instances
(instances 6–15), using thresholds calibrated on instances 1–5.
We report two representative budgets to illustrate budget dependence.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS7.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Results and interpretation&lt;/span&gt;.
Figure &lt;a href="#A6.F12" title="Figure 12 ‣ F.7 Probe Calibration Curves ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;12&lt;/span&gt;&lt;/a&gt; shows a clear monotone trend:
at low $P$ (stable ranks), RB-PEM wins with probability well below 0.5 (CMA-ES is preferred);
at high $P$, RB-PEM wins with probability 0.7–0.8.
The calibrated thresholds (vertical dashed lines) fall near the empirical 0.5 crossing, aligning with the
decision-theoretic interpretation: the probe is measuring a quantity that is predictive of the algorithm crossover.
The threshold shifts with budget in the expected direction: when the remaining budget is larger, the relative cost of
RB-PEM’s bounded overhead is smaller, so switching becomes beneficial at lower misranking levels.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="A6.F12" class="ltx_figure"&gt;&lt;img style="width:100%" width="482" height="165" loading="lazy" src="fig_a6_probe_calibration.svg" id="A6.F12.g1" class="ltx_graphics ltx_centering " alt="Refer to caption"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Figure 12&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Probe calibration curves.&lt;span class="ltx_text ltx_font_medium"&gt;
Empirical $\Pr(\text{RB-PEM wins}\mid P)$ versus probe statistic $P$ (quantile bins; 95% Wilson intervals).
Shaded regions indicate which algorithm is preferred; the vertical dashed line is the calibrated threshold.
The win probability increases monotonically with $P$, supporting a threshold decision rule.
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; $d{=}40$, $\lambda{=}15$, $\mu{=}7$, $B_{\mathrm{boot}}{=}32$, $K_{\max}{=}1$.
Two budget levels: $B{=}200d$ and $B{=}500d$. 450 problems per budget (30 functions $\times$ 15 instances), each run once.
Calibration uses instances 1–5 (train) and 6–15 (test).&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure id="A6.F13" class="ltx_figure"&gt;&lt;img style="width:55%" width="233" height="231" loading="lazy" src="fig_a7_probe_budget_roc.svg" id="A6.F13.g1" class="ltx_graphics ltx_centering " alt="Refer to caption"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Figure 13&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Probe budget vs. ROC.&lt;span class="ltx_text ltx_font_medium"&gt;
ROC curves for different probe population sizes $\lambda$ on COCO &lt;span class="ltx_text ltx_font_typewriter"&gt;bbob-noisy&lt;/span&gt; ($d{=}40$, $B{=}200d$).
Legend: AUC and accuracy at the displayed operating point. Reliability improves up to $\lambda\approx 16$ and then saturates.
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; $B_{\mathrm{boot}}{=}32$, $K_{\max}{=}1$.
30 functions $\times$ 15 instances = 450 problems per $\lambda$ value, each run once.
$\lambda\in\{4,8,16,32\}$; $\mu{=}\lfloor\lambda/2\rfloor$. Operating point: $\tau{=}0.12$.&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/section&gt;
&lt;section id="A6.SS8" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="probe-reliability-versus-probe-budget"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;F.8 &lt;/span&gt;Probe Reliability versus Probe Budget&lt;/h3&gt;
&lt;div id="A6.SS8.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The probe costs $2\lambda$ evaluations, so it must be informative at modest budgets.
This experiment quantifies the classification quality of the probe as we vary its cost by changing $\lambda$.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS8.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Setup&lt;/span&gt;.
We sweep probe population sizes $\lambda\in\{4,8,16,32\}$.
For each setting we compute $P$ and evaluate its ability to classify problems where RB-PEM beats CMA-ES
(ground-truth labels from full runs) on 450 COCO problems at $d=40$, $B=200d$.
We report ROC curves; the legend lists AUC and accuracy at a representative threshold.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS8.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Results and interpretation&lt;/span&gt;.
Figure &lt;a href="#A6.F13" title="Figure 13 ‣ F.7 Probe Calibration Curves ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;13&lt;/span&gt;&lt;/a&gt; shows that even the cheapest probe ($\lambda=4$, cost 8 evaluations) is strongly
informative (AUC 0.71, accuracy 0.72), and performance improves up to $\lambda\approx 16$ (AUC 0.76).
Increasing probe cost further does not help (AUC drops to 0.73 at $\lambda=32$), indicating diminishing returns and a
clear cost-effectiveness plateau.
This justifies using a modest probe budget comparable to the default ES population size.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section id="A6.SS9" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="threshold-sensitivity-analysis"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;F.9 &lt;/span&gt;Threshold Sensitivity Analysis&lt;/h3&gt;
&lt;div id="A6.SS9.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Probe-and-switch introduces a single scalar hyperparameter: the switching threshold $\tau$.
A practical method should not require fragile tuning.
This experiment evaluates (i) how accuracy depends on $\tau$ and (ii) how much regret is incurred by choosing a
suboptimal threshold.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS9.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Setup&lt;/span&gt;.
We sweep $\tau\in[0,0.30]$ and evaluate classification accuracy of the misranking probe (MR) and a variance proxy
(Var) at two budgets.
We also compute &lt;em class="ltx_emph ltx_font_italic"&gt;decision regret&lt;/em&gt;: the mean $\log_{10}$ performance gap to an oracle that always chooses the
better of CMA-ES and RB-PEM for each problem instance.
We report both the train split (instances 1–5) and the held-out test split (instances 6–15).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS9.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Results and interpretation&lt;/span&gt;.
Figure &lt;a href="#A6.F14" title="Figure 14 ‣ F.9 Threshold Sensitivity Analysis ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;14&lt;/span&gt;&lt;/a&gt;a shows a broad accuracy plateau: for MR, accuracy varies by only
$\approx 2$ percentage points over $\tau\in[0.08,0.18]$.
Across all thresholds, MR outperforms Var by roughly 5–6 percentage points, reinforcing the necessity of
rank-based probing (cf. F5).
Figure &lt;a href="#A6.F14" title="Figure 14 ‣ F.9 Threshold Sensitivity Analysis ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;14&lt;/span&gt;&lt;/a&gt;b shows that decision regret is highly asymmetric:
very small $\tau$ causes &lt;em class="ltx_emph ltx_font_italic"&gt;over-switching&lt;/em&gt; (unnecessary RB-PEM overhead on low-misranking problems),
while very large $\tau$ causes &lt;em class="ltx_emph ltx_font_italic"&gt;under-switching&lt;/em&gt; (missing beneficial RB-PEM deployments).
Importantly, the regret curve is also flat across the plateau, so near-optimal decisions do not require precise
threshold tuning; $\tau=0.12$ lies safely in the robust region.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="A6.F14" class="ltx_figure"&gt;&lt;img style="width:98%" width="483" height="169" loading="lazy" src="fig_a8_threshold_sensitivity.svg" id="A6.F14.g1" class="ltx_graphics ltx_centering " alt="Refer to caption"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Figure 14&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Threshold sensitivity.&lt;span class="ltx_text ltx_font_medium"&gt;
(a) Classification accuracy vs. threshold $\tau$: MR exhibits a broad plateau and outperforms Var.
(b) Decision regret vs. $\tau$: over-switching dominates at small $\tau$, under-switching at large $\tau$; the minimum lies within the accuracy plateau, showing robust tuning.
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; $d{=}40$, $\lambda{=}15$, $\mu{=}7$, $B_{\mathrm{boot}}{=}32$, $K_{\max}{=}1$.
Two budget levels: $B{=}200d$ and $B{=}500d$. 450 problems per budget (30 functions $\times$ 15 instances), each run once.
Accuracy is the proportion of problems correctly routed; decision regret is the mean $\log_{10}$ performance gap to an oracle selector.&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/section&gt;
&lt;section id="A6.SS10" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="depthfidelity-robustness-and-uh-cma-es-sensitivity"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;F.10 &lt;/span&gt;Depth–Fidelity Robustness and UH-CMA-ES Sensitivity&lt;/h3&gt;
&lt;div id="A6.SS10.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The main paper argues that under fixed budget, evaluation-stage denoising is structurally disadvantaged because it
reduces depth.
This section provides two complementary robustness checks:
(a) whether RB-PEM’s advantage persists across budgets and dimensions, and
(b) whether UH-CMA-ES can be “rescued” by tuning its &lt;span class="ltx_text ltx_font_typewriter"&gt;maxevals&lt;/span&gt; parameter.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS10.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;a: Budget and dimension robustness&lt;/span&gt;.
Figure &lt;a href="#A6.F15" title="Figure 15 ‣ F.10 Depth–Fidelity Robustness and UH-CMA-ES Sensitivity ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;15&lt;/span&gt;&lt;/a&gt;a reports win rates of RB-PEM against three baselines across
budgets $B\in\{50d,100d,200d\}$ and dimensions $d\in\{20,40\}$ (225 high-misranking COCO problems per setting).
RB-PEM wins decisively against UH-CMA-ES (roughly 79–94%) and against Resample($k{=}10$) (roughly 78–83%) in
every regime, and maintains majority wins even against vanilla CMA-ES.
The advantage is larger at $d=40$ than at $d=20$, consistent with misranking becoming more damaging in higher
dimensions and with the paper’s empirical observation that depth becomes increasingly predictive of performance as
misranking increases.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS10.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;b: UH-CMA-ES &lt;span class="ltx_text ltx_font_typewriter"&gt;maxevals&lt;/span&gt; sweep&lt;/span&gt;.
Figure &lt;a href="#A6.F15" title="Figure 15 ‣ F.10 Depth–Fidelity Robustness and UH-CMA-ES Sensitivity ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;15&lt;/span&gt;&lt;/a&gt;b sweeps &lt;span class="ltx_text ltx_font_typewriter"&gt;maxevals$\in\{1,10,30\}$&lt;/span&gt;.
Across both budgets, UH-CMA-ES remains far below the 50% parity line versus CMA-ES and versus probe-and-switch.
Moreover, increasing &lt;span class="ltx_text ltx_font_typewriter"&gt;maxevals&lt;/span&gt; monotonically &lt;em class="ltx_emph ltx_font_italic"&gt;reduces&lt;/em&gt; UH-CMA-ES win rate: allocating more reevaluations
per generation worsens fixed-budget performance.
This supports the interpretation that UH-CMA-ES’s underperformance is not a tuning artifact but a depth-loss effect.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="A6.F15" class="ltx_figure"&gt;&lt;img style="width:98%" width="484" height="170" loading="lazy" src="fig_a10_depth_fidelity_tradeoff.svg" id="A6.F15.g1" class="ltx_graphics ltx_centering " alt="Refer to caption"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Figure 15&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Depth–fidelity robustness and baseline sensitivity.&lt;span class="ltx_text ltx_font_medium"&gt;
(a) Win rate of RB-PEM across budgets and dimensions against UH-CMA-ES, Resample($k{=}10$), and CMA-ES.
(b) UH-CMA-ES win rate vs. CMA-ES and vs. Probe-and-Switch ($\tau{=}0.12$) as a function of &lt;span class="ltx_text ltx_font_typewriter"&gt;maxevals&lt;/span&gt;; all values are far below parity, and larger &lt;span class="ltx_text ltx_font_typewriter"&gt;maxevals&lt;/span&gt; further degrades performance.
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; $B_{\mathrm{boot}}{=}32$, $K_{\max}{=}1$.
Panel (a): $d\in\{20,40\}$, $B\in\{50d,100d,200d\}$, 15 high-misranking functions $\times$ 15 instances = 225 problems per (budget, dimension) pair, each run once.
Panel (b): $d{=}40$, $B\in\{200d,500d\}$, 30 functions $\times$ 15 instances = 450 problems per budget, each run once; &lt;span class="ltx_text ltx_font_typewriter"&gt;maxevals$\in\{1,10,30\}$&lt;/span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/section&gt;
&lt;section id="A6.SS11" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="external-validity-on-a-nonconvex-real-data-task"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;F.11 &lt;/span&gt;External Validity on a Nonconvex Real-Data Task&lt;/h3&gt;
&lt;div id="A6.SS11.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The COCO suite is synthetic and largely separable from end-to-end ML pipelines.
This experiment tests whether the probe-and-switch principle generalizes to a small nonconvex real-data task where
noise is induced by stochastic mini-batching.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS11.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Setup&lt;/span&gt;.
We train a single-hidden-layer MLP (4 hidden units) on the &lt;span class="ltx_text ltx_font_typewriter"&gt;digits0&lt;/span&gt; binary classification task
(digit 0 vs. non-0), with $n=256$ samples and $d=265$ parameters.
We control ranking noise via mini-batch size $B_{\mathrm{batch}}\in\{4,16,256\}$ (smaller batches $\Rightarrow$ noisier
objective values $\Rightarrow$ more misranking).
We compare CMA-ES, probe-and-switch, and a &lt;em class="ltx_emph ltx_font_italic"&gt;warmstart&lt;/em&gt; variant that reuses the probe evaluations as part of the
first generation, thereby removing the probe’s opportunity cost when the probe indicates “no switch.”
All methods use the same total budget $B=40d=10{,}600$ and 50 random seeds.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS11.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Results and interpretation&lt;/span&gt;.
Figure &lt;a href="#A6.F16" title="Figure 16 ‣ F.11 External Validity on a Nonconvex Real-Data Task ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;16&lt;/span&gt;&lt;/a&gt; shows three regimes.
&lt;em class="ltx_emph ltx_font_italic"&gt;Moderate noise&lt;/em&gt; ($B_{\mathrm{batch}}=16$, $M_{\mathrm{RD}}\in[0.13,0.34]$): probe-and-switch improves over CMA-ES
(66% win rate) and warmstart is stronger still (76% win rate), consistent with the paper’s main claim that selection-stage
uncertainty integration is most beneficial in high-misranking regimes.
&lt;em class="ltx_emph ltx_font_italic"&gt;Extreme noise&lt;/em&gt; ($B_{\mathrm{batch}}=4$): both variants are near parity (54% win rate), suggesting a saturation regime
where all methods are heavily noise-limited.
Deterministic ($B_{\mathrm{batch}}=256$, $M_{\mathrm{RD}}=0$): warmstart matches CMA-ES almost exactly (48/50 ties,
i.e., 96%), demonstrating that the probe can correctly detect “no misranking” and that warmstarting can remove probe cost
when switching is unnecessary.
Overall, this nonconvex experiment supports the external validity of probe-and-switch and highlights warmstarting as a
simple practical refinement in low-noise settings.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="A6.F16" class="ltx_figure"&gt;&lt;img style="width:100%" width="489" height="144" loading="lazy" src="fig_a12_mlp_digits0.svg" id="A6.F16.g1" class="ltx_graphics ltx_centering " alt="Refer to caption"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_figure"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Figure 16&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;MLP training on &lt;span class="ltx_text ltx_font_typewriter"&gt;digits0&lt;/span&gt; (nonconvex).&lt;span class="ltx_text ltx_font_medium"&gt;
Final post-hoc loss (lower is better) across 50 seeds at fixed budget $B=40d$.
Numbers above boxes indicate the fraction of seeds on which the method improves upon (or ties with) CMA-ES.
Left: $B_{\mathrm{batch}}=4$ (extreme noise); Center: $B_{\mathrm{batch}}=16$ (moderate noise); Right: $B_{\mathrm{batch}}=256$ (deterministic).
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; $d{=}265$, $\lambda{=}20$ (CMA-ES default), $\mu{=}10$, $B_{\mathrm{boot}}{=}32$, $K_{\max}{=}1$.
50 independent seeds per (method, batch-size) pair.
Boxes show the median (center line) and IQR; whiskers extend to $1.5\times$ IQR; outliers plotted individually.&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/section&gt;
&lt;section id="A6.SS12" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="complete-results-on-high-misranking-coco-functions"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;F.12 &lt;/span&gt;Complete Results on High-Misranking COCO Functions&lt;/h3&gt;
&lt;div id="A6.SS12.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;The main text visualizes convergence on a small set of representative functions.
Table &lt;a href="#A6.T5" title="Table 5 ‣ F.12 Complete Results on High-Misranking COCO Functions ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;5&lt;/span&gt;&lt;/a&gt; provides the complete per-function summary on the full high-misranking
function class used throughout the paper, to verify that the reported gains are not an artifact of selective
function choice.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS12.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Setup&lt;/span&gt;.
We report median final $\log_{10}$ regret at budget $B=100d$ for $d=40$ across 15 instances per function.
We compare CMA-ES, UH-CMA-ES, RB-PEM, and probe-and-switch (bold indicates the best median per function).&lt;/p&gt;
&lt;/div&gt;
&lt;div id="A6.SS12.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Results and interpretation&lt;/span&gt;.
Two patterns stand out.
First, RB-PEM and probe-and-switch &lt;em class="ltx_emph ltx_font_italic"&gt;dominate&lt;/em&gt; UH-CMA-ES across the entire class (no exceptions),
reinforcing the depth-fidelity argument: evaluation-stage reevaluation is consistently uncompetitive under strict budgets.
Second, selection-stage methods usually outperform vanilla CMA-ES, with the largest gains on the functions where the
noisy ranking is most unstable (e.g., f110, f111, f116).
On the few functions where CMA-ES is marginally better, the gaps are small, consistent with a low-misranking regime
where smoothing and any additional overhead bring limited benefit.
This table therefore complements the main-text figures by showing that the “selection-stage wins” pattern is broad
and not cherry-picked.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="A6.T5" class="ltx_table"&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_table"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Table 5&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Median $\log_{10}$ regret at $B=100d$ across all 15 high-misranking COCO functions&lt;span class="ltx_text ltx_font_medium"&gt; ($d{=}40$, 15 instances each). &lt;/span&gt;Bold&lt;span class="ltx_text ltx_font_medium"&gt;: lowest per function.
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; $\lambda{=}15$, $\mu{=}7$, $B_{\mathrm{boot}}{=}32$, $K_{\max}{=}1$. Probe-and-Switch uses $\tau{=}0.12$.
Each instance is run once per method; the reported statistic is the median across 15 instances.&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;table class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle"&gt;
&lt;thead class="ltx_thead"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_th ltx_th_row ltx_border_tt" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt" style="padding-left:5.0pt;padding-right:5.0pt;" colspan="2"&gt;&lt;span class="ltx_text ltx_font_italic" style="font-size:80%;"&gt;Baselines&lt;/span&gt;&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt" style="padding-left:5.0pt;padding-right:5.0pt;" colspan="2"&gt;&lt;span class="ltx_text ltx_font_italic" style="font-size:80%;"&gt;Selection-stage&lt;/span&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_th_row" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;Function&lt;/span&gt;&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_t" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;CMA-ES&lt;/span&gt;&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_t" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;UH-CMA-ES&lt;/span&gt;&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_t" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;RB-PEM&lt;/span&gt;&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_t" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;Probe-and-switch&lt;/span&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody class="ltx_tbody"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;f108&lt;/span&gt;&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_t" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;2.39&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_t" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;2.46&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_t" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;2.37&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_t" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:80%;"&gt;2.36&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;f110&lt;/span&gt;&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;4.87&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;5.35&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:80%;"&gt;4.47&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;4.53&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;f111&lt;/span&gt;&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;5.22&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;5.48&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;5.11&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:80%;"&gt;5.09&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;f113&lt;/span&gt;&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;2.87&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;3.05&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;2.77&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:80%;"&gt;2.75&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;f114&lt;/span&gt;&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:80%;"&gt;3.03&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;3.16&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;3.13&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;3.06&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;f116&lt;/span&gt;&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;4.65&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;4.99&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:80%;"&gt;4.48&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;4.54&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;f117&lt;/span&gt;&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;4.93&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;4.98&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;4.90&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:80%;"&gt;4.89&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;f119&lt;/span&gt;&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1.58&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1.74&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1.53&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:80%;"&gt;1.50&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;f120&lt;/span&gt;&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1.73&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1.84&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1.69&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:80%;"&gt;1.68&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;f122&lt;/span&gt;&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1.04&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1.14&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:80%;"&gt;1.03&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1.04&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;f123&lt;/span&gt;&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:80%;"&gt;1.13&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1.19&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1.15&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1.15&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;f125&lt;/span&gt;&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;0.26&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;0.36&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;0.12&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:80%;"&gt;0.10&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;f126&lt;/span&gt;&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;0.32&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;0.39&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;0.22&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:80%;"&gt;0.21&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;f128&lt;/span&gt;&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1.91&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1.92&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1.91&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:80%;"&gt;1.90&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;f129&lt;/span&gt;&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1.91&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1.91&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text" style="font-size:80%;"&gt;1.91&lt;/span&gt;&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb" style="padding-left:5.0pt;padding-right:5.0pt;"&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:80%;"&gt;1.91&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/figure&gt;
&lt;/section&gt;
&lt;section id="A6.SS13" class="ltx_subsection"&gt;
&lt;h3 class="ltx_title ltx_title_subsection" id="all-function-breakdowns-by-probe-regime-and-noise-family"&gt;
&lt;span class="ltx_tag ltx_tag_subsection"&gt;F.13 &lt;/span&gt;All-Function Breakdowns by Probe Regime and Noise Family&lt;/h3&gt;
&lt;div id="A6.SS13.p1" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Table &lt;a href="#S6.T1" title="Table 1 ‣ 6.5 Comprehensive Comparison ‣ 6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;1&lt;/span&gt;&lt;/a&gt; and Fig. &lt;a href="#S6.F4" title="Figure 4 ‣ 6.4 Probe-and-Switch Evaluation ‣ 6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt; report all-function evidence; here we unpack where those gains arise.
The probe statistic separates &lt;span class="ltx_text ltx_font_typewriter"&gt;bbob-noisy&lt;/span&gt; into a selected high-misranking subset and a more stable complement.
Table &lt;a href="#A6.T6" title="Table 6 ‣ F.13 All-Function Breakdowns by Probe Regime and Noise Family ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;6&lt;/span&gt;&lt;/a&gt; quantifies this split at $B=100d$.
Always-on RB-PEM is strongest on the selected high-misranking functions but can be harmful on the complement, where smoothing and reevaluation overhead are often unnecessary.
Probe-and-Switch preserves most of the high-misranking gain while reverting toward CMA-ES on the complement.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="A6.T6" class="ltx_table"&gt;
&lt;table class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle"&gt;
&lt;thead class="ltx_thead"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_th_row ltx_border_tt" style="padding:0.6pt 7.0pt;"&gt;Method (vs. CMA-ES)&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt" style="padding:0.6pt 7.0pt;"&gt;Selected high-misranking 15f&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt" style="padding:0.6pt 7.0pt;"&gt;Complement 15f&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody class="ltx_tbody"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t" style="padding:0.6pt 7.0pt;"&gt;RB-PEM&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_t" style="padding:0.6pt 7.0pt;"&gt;68.1% (460/675)&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_t" style="padding:0.6pt 7.0pt;"&gt;35.3% (238/675)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding:0.6pt 7.0pt;"&gt;RB-PEM (log-weight)&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center" style="padding:0.6pt 7.0pt;"&gt;67.7% (457/675)&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding:0.6pt 7.0pt;"&gt;37.3% (252/675)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding:0.6pt 7.0pt;"&gt;Probe-and-Switch&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center" style="padding:0.6pt 7.0pt;"&gt;65.2% (440/675)&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding:0.6pt 7.0pt;"&gt;47.4% (320/675)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb" style="padding:0.6pt 7.0pt;"&gt;Probe-and-Switch (log-weight)&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb" style="padding:0.6pt 7.0pt;"&gt;65.3% (441/675)&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb" style="padding:0.6pt 7.0pt;"&gt;46.1% (311/675)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_table"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Table 6&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;High-misranking versus complement breakdown.&lt;span class="ltx_text ltx_font_medium"&gt;
Win rates against CMA-ES at $B=100d$ after splitting all 30 COCO &lt;span class="ltx_text ltx_font_typewriter"&gt;bbob-noisy&lt;/span&gt; functions by the probe-based partition of Fig. &lt;a href="#S6.F4" title="Figure 4 ‣ 6.4 Probe-and-Switch Evaluation ‣ 6 Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;4&lt;/span&gt;&lt;/a&gt;.
RB-PEM variants win decisively on the selected high-misranking subset but lose on the complement, while Probe-and-Switch stays near parity there by reverting to CMA-ES when rankings are stable.
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; $d\in\{10,20,40\}$, 15 instances per function, one run per method, 675 matched problems per column.
The selected high-misranking column is the 15-function subset used throughout the paper; the complement contains the 14 low-misranking functions plus f107, whose large probe value is structural rather than noise-induced.&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div id="A6.SS13.p2" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;Table &lt;a href="#A6.T7" title="Table 7 ‣ F.13 All-Function Breakdowns by Probe Regime and Noise Family ‣ Appendix F Additional Experiments ‣ Depth over Fidelity in Fixed-Budget Noisy Evolution Strategies" class="ltx_ref"&gt;&lt;span class="ltx_text ltx_ref_tag"&gt;7&lt;/span&gt;&lt;/a&gt; gives an orthogonal view by COCO noise family.
The moderate-Gaussian group is mostly stable-ranking, so always-on RB-PEM often pays overhead without enough ranking uncertainty to offset it.
By contrast, the severe Gaussian, Cauchy, and multimodal groups contain regimes where selection-stage smoothing is more useful.
The Cauchy row should be read as an empirical stress test: raw Cauchy noise violates the finite-variance assumption, while the implementation clips standardized residuals to $[-M,M]$ and therefore bootstraps from a winsorized working distribution.&lt;/p&gt;
&lt;/div&gt;
&lt;figure id="A6.T7" class="ltx_table"&gt;
&lt;table class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle"&gt;
&lt;thead class="ltx_thead"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_th_row ltx_border_tt" style="padding:0.6pt 7.0pt;"&gt;Noise family&lt;/th&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_th_row ltx_border_tt" style="padding:0.6pt 7.0pt;"&gt;Functions&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt" style="padding:0.6pt 7.0pt;"&gt;Win/Loss&lt;/th&gt;
&lt;th class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt" style="padding:0.6pt 7.0pt;"&gt;Win rate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody class="ltx_tbody"&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t" style="padding:0.6pt 7.0pt;"&gt;Moderate Gaussian&lt;/th&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t" style="padding:0.6pt 7.0pt;"&gt;f101–f109&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_t" style="padding:0.6pt 7.0pt;"&gt;40/95&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_t" style="padding:0.6pt 7.0pt;"&gt;29.6%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding:0.6pt 7.0pt;"&gt;Severe Gaussian&lt;/th&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding:0.6pt 7.0pt;"&gt;f110–f118&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center" style="padding:0.6pt 7.0pt;"&gt;87/48&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding:0.6pt 7.0pt;"&gt;64.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding:0.6pt 7.0pt;"&gt;Severe Cauchy&lt;/th&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row" style="padding:0.6pt 7.0pt;"&gt;f119–f124&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center" style="padding:0.6pt 7.0pt;"&gt;55/35&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center" style="padding:0.6pt 7.0pt;"&gt;61.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="ltx_tr"&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb" style="padding:0.6pt 7.0pt;"&gt;Severe + multimodal&lt;/th&gt;
&lt;th class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb" style="padding:0.6pt 7.0pt;"&gt;f125–f130&lt;/th&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb" style="padding:0.6pt 7.0pt;"&gt;61/29&lt;/td&gt;
&lt;td class="ltx_td ltx_align_center ltx_border_bb" style="padding:0.6pt 7.0pt;"&gt;67.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;figcaption class="ltx_caption ltx_centering"&gt;&lt;span class="ltx_tag ltx_tag_table"&gt;&lt;span class="ltx_text" style="font-size:90%;"&gt;Table 7&lt;/span&gt;: &lt;/span&gt;&lt;span class="ltx_text ltx_font_bold" style="font-size:90%;"&gt;Noise-family breakdown for RB-PEM (log-weight).&lt;span class="ltx_text ltx_font_medium"&gt;
Win/loss counts and win rates against CMA-ES at $B=100d$, grouped by the COCO &lt;span class="ltx_text ltx_font_typewriter"&gt;bbob-noisy&lt;/span&gt; noise families.
Gains concentrate in the severe Gaussian, severe Cauchy, and multimodal families, whereas the mostly stable moderate-Gaussian family is less favorable to always-on smoothing.
&lt;em class="ltx_emph ltx_font_italic"&gt;Protocol:&lt;/em&gt; $d=40$, 15 instances per function, one run per method.
The Cauchy row is an empirical robustness check for the implemented winsorized residual pool, which clips standardized residuals to $[-M,M]$; it is not a claim that the raw Cauchy noise satisfies the finite-variance theory.&lt;/span&gt;&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div id="A6.SS13.p3" class="ltx_para"&gt;
&lt;p class="ltx_p"&gt;&lt;span class="ltx_text ltx_font_bold"&gt;Practical takeaway&lt;/span&gt;.
Across the appendix, the empirical message is consistent with the theoretical one: when ranking noise is substantial,
it is more sample-efficient (under a strict budget) to integrate uncertainty into selection weights (RB-PEM) than
to spend evaluations trying to eliminate it, and a low-cost rank-disagreement probe provides a robust mechanism for
avoiding overhead in low-misranking regimes.&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;/article&gt;</description></item><item><title>向量三重积</title><link>https://sichen-wang.github.io/blog/%E5%90%91%E9%87%8F%E4%B8%89%E9%87%8D%E7%A7%AF/</link><pubDate>Sun, 23 Feb 2025 20:24:25 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E5%90%91%E9%87%8F%E4%B8%89%E9%87%8D%E7%A7%AF/</guid><description>&lt;p&gt;存在&lt;strong&gt;向量三重积&lt;/strong&gt;公式
&lt;/p&gt;
\[
\mathbf{a} \times (\mathbf{b} \times \mathbf{c}) = (\mathbf{a} \cdot \mathbf{c})\mathbf{b} - (\mathbf{a} \cdot \mathbf{b})\mathbf{c}
\]&lt;hr&gt;
&lt;p&gt;设向量为：
&lt;/p&gt;
\[
\mathbf{a} = (a_1, a_2, a_3), \quad \mathbf{b} = (b_1, b_2, b_3), \quad \mathbf{c} = (c_1, c_2, c_3).
\]&lt;p&gt;
&lt;/p&gt;
\[
\mathbf{b} \times \mathbf{c} = \begin{pmatrix}
b_2 c_3 - b_3 c_2 \\
b_3 c_1 - b_1 c_3 \\
b_1 c_2 - b_2 c_1
\end{pmatrix}
\]&lt;p&gt;
&lt;/p&gt;
\[
\mathbf{a} \times (\mathbf{b} \times \mathbf{c}) = \begin{pmatrix}
a_2 (b_1 c_2 - b_2 c_1) - a_3 (b_3 c_1 - b_1 c_3) \\
a_3 (b_2 c_3 - b_3 c_2) - a_1 (b_1 c_2 - b_2 c_1) \\
a_1 (b_3 c_1 - b_1 c_3) - a_2 (b_2 c_3 - b_3 c_2)
\end{pmatrix}
\]&lt;p&gt;展开并整理各分量：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;第一分量：&lt;/li&gt;
&lt;/ul&gt;
\[
a_2 b_1 c_2 - a_2 b_2 c_1 - a_3 b_3 c_1 + a_3 b_1 c_3 = b_1 (a_2 c_2 + a_3 c_3) - c_1 (a_2 b_2 + a_3 b_3)
\]&lt;ul&gt;
&lt;li&gt;第二分量：&lt;/li&gt;
&lt;/ul&gt;
\[
a_3 b_2 c_3 - a_3 b_3 c_2 - a_1 b_1 c_2 + a_1 b_2 c_1 = b_2 (a_3 c_3 + a_1 c_1) - c_2 (a_3 b_3 + a_1 b_1)
\]&lt;ul&gt;
&lt;li&gt;第三分量：&lt;/li&gt;
&lt;/ul&gt;
\[
a_1 b_3 c_1 - a_1 b_1 c_3 - a_2 b_2 c_3 + a_2 b_3 c_2 = b_3 (a_1 c_1 + a_2 c_2) - c_3 (a_1 b_1 + a_2 b_2)
\]&lt;p&gt;观察到每个分量中缺少 \(a_{1} b_{1} c_{1}\)（第一分量）、\(a_{2} b_{2} c_{2}\)（第二分量）、\(a_{3} b_{3} c_{3}\)（第三分量）&lt;/p&gt;
&lt;p&gt;添加这些项后，表达式可统一写为：
&lt;/p&gt;
\[
\mathbf{b} (\mathbf{a} \cdot \mathbf{c}) - \mathbf{c} (\mathbf{a} \cdot \mathbf{b})
\]</description></item><item><title>Motif</title><link>https://sichen-wang.github.io/blog/motif/</link><pubDate>Sun, 23 Feb 2025 20:21:36 +0000</pubDate><guid>https://sichen-wang.github.io/blog/motif/</guid><description>&lt;h2 id="definitions"&gt;Definitions&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Motif 标准定义&lt;/strong&gt;: Motif 是多次出现在图中的子结构，其出现频率显著高于在随机网络中的频率.&lt;/p&gt;
&lt;p&gt;一般而言, k-motif 在 \(k \geqslant 3\) 时才有意义, 于是 3-motif 也成为被研究最多的结构.&lt;/p&gt;
&lt;p&gt;另外, 在生成随机网络时需要满足:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;每个点的入度和出度需要与真实网络中相似. (为了确保子图的数量尽可能一致)&lt;/li&gt;
&lt;li&gt;在计算 k-motif 时, (k-1)-motif 的出现频率需要与真实网络中相似. (为了确保 k-motif 的出现频率高并不仅仅因为其某个子结构的出现频率高)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;而很多时候点是有其自身属性的, 于是可以用若干个标签刻画一个点的属性, 于是有 colored-motif 的定义如下&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;带标签 Motif&lt;/strong&gt;: colored-motif 是元素取自标签全集 \(\mathbb{C}\) 中的一个可重集.&lt;/p&gt;
&lt;p&gt;而在很多情况下, 在图中显著欠表达的子结构也是需要关注的, 于是有 anti-motif 的定义如下&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;欠表达 Motif&lt;/strong&gt;: anti-motif 是很少出现在图中的子结构，其出现频率显著低于在随机网络中的频率.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;概率阈值 P&lt;/strong&gt;: 通过实验可以确定一个阈值, 一个子结构在随机图中出现的频率大于其在原图中出现的频率的概率不大于 \(P\) 则该子结构可能被认为是 motif. 该阈值 \(P\) 可以通过 z-score 来刻画, z-score 被定义为超过平均频率多少个标准差, 形式化的有
&lt;/p&gt;
\[
\text{z-score}(G_k) = \frac{f_{\text{ori}} - \text{eva}(f_{\text{ran}})}{\sigma(f_{\text{ran}})}
\]&lt;p&gt;其中 \(f_{\text{ori}}\) 表示原始网络中该 motif 的频率, \(\text{eva}(f_{\text{ran}})\) 表示随机图中该 motif 的平均频率, \(\sigma(f_{\text{ran}})\) 表示随机图中 motif 频率的标准差.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;唯一性阈值 U&lt;/strong&gt;: 通过实验可以确定一个阈值, 出现频率超过该阈值 \(U\) 的子结构可能被认为是 motif.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;差异度阈值 D&lt;/strong&gt;: 通过实验可以确定一个阈值, 满足 \(f_{\text{ori}} - \text{eva}(f_{\text{ran}}) \gt D \times \text{eva}(f_{\text{ran}})\) 的子结构可能被认为是 motif.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Motif 参数化定义&lt;/strong&gt;: 在图 \(G\) 中, motif 是指由参数集 \(\{P, U, D, N\}\) 限制的导出子图 \(G_{k}\). 其中 \(P, U, D\) 的定义如上所述, \(N\) 为随机图的数量, 一组可供参考的超参数为 \(\{0.01, 4, 0.1, 1000\}\).&lt;/p&gt;</description></item><item><title>微分方程</title><link>https://sichen-wang.github.io/blog/%E5%BE%AE%E5%88%86%E6%96%B9%E7%A8%8B/</link><pubDate>Tue, 14 Jan 2025 00:00:00 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E5%BE%AE%E5%88%86%E6%96%B9%E7%A8%8B/</guid><description>&lt;h2 id="i-可分离变量的微分方程"&gt;I. 可分离变量的微分方程&lt;/h2&gt;
\[
\frac{\mathrm{d} y}{\mathrm{d} x} = p(x)q(y)
\]&lt;p&gt;直接分离变量得
&lt;/p&gt;
\[
p(x) \mathrm{d} x = \frac{1}{q(y)} \mathrm{d} y
\]&lt;p&gt;对两边积分即有
&lt;/p&gt;
\[
\int p(x) \mathrm{d} x = \int \frac{1}{q(y)} \mathrm{d} y
\]&lt;h3 id="齐次微分方程"&gt;齐次微分方程&lt;/h3&gt;
\[
\frac{\mathrm{d} y}{\mathrm{d} x} = \varphi \left(\frac{y}{x}\right)
\]&lt;p&gt;设 \(u = \dfrac{y}{x}\), 则有
&lt;/p&gt;
\[
\frac{\mathrm{d} (u x)}{\mathrm{d} x} = \varphi(u)
\]&lt;p&gt;整理得
&lt;/p&gt;
\[
\int \frac{\mathrm{d} u}{\varphi (u) - u} = \int \frac{\mathrm{d} x}{x}
\]&lt;p&gt;最后将 \(u = \dfrac{y}{x}\) 回代即得原方程的解.&lt;/p&gt;
&lt;p&gt;需要注意的是, 求解方程的过程中可能会丢失一些解, 需要考虑一些边界情况.&lt;/p&gt;
&lt;h2 id="ii-一阶线性微分方程"&gt;II. 一阶线性微分方程&lt;/h2&gt;
\[
\frac{\mathrm{d} y}{\mathrm{d} x} + p(x) y = q(x) \tag{2.1}
\]&lt;h3 id="齐次方程的通解"&gt;齐次方程的通解&lt;/h3&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;当 \(q(x) \equiv 0\) 时, 该方程称为一阶齐次线性微分方程, 可求其通解.
&lt;/p&gt;
\[
\frac{\mathrm{d} y}{\mathrm{d} x} + p(x) y = 0
\]
&lt;/blockquote&gt;
&lt;p&gt;考虑直接分离变量
&lt;/p&gt;
\[
\frac{\mathrm{d} y}{y} = -p(x) \mathrm{d} x
\]&lt;p&gt;两边积分并整理得
&lt;/p&gt;
\[
y = C \exp\left(-\int p(x) \mathrm{d} x\right)
\]&lt;h3 id="非齐次方程的特解"&gt;非齐次方程的特解&lt;/h3&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;当 \(q(x) \not\equiv 0\) 时, 该方程称为一阶非齐次线性微分方程, 可先求其对应齐次方程的通解, 再求非齐次方程的一个特解, 两者相加即得该非齐次方程的通解.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;对式 (2.1) 两边同时除以 \(y\), 并整理得
&lt;/p&gt;
\[
\frac{\mathrm{d} y}{y} = -p(x) \mathrm{d} x + \frac{q(x)}{y} \mathrm{d} x
\]&lt;p&gt;两边积分并化简得
&lt;/p&gt;
\[
y = C \exp\left(-\int p(x) \mathrm{d} x + \int \frac{q(x)}{y} \mathrm{d} x \right)
\]&lt;p&gt;设 \(c(x) = C \exp\left(\displaystyle \int \frac{q(x)}{y} \mathrm{d} x \right)\), 将其带入即有
&lt;/p&gt;
\[
y = c(x) \exp(-\int p(x) \mathrm{d} x) \tag{2.2}
\]&lt;p&gt;将上式带入式 (2.1) 得
&lt;/p&gt;
\[
c'(x) \exp(-\int p(x) \mathrm{d} x) - c(x) \exp(-\int p(x) \mathrm{d} x) p(x) + p(x) c(x) \exp(-\int p(x) \mathrm{d} x) = q(x)
\]&lt;p&gt;注意到中间两项是可以消去的, 于是
&lt;/p&gt;
\[
c'(x) = q(x) \exp(\int p(x) \mathrm{d} x)
\]&lt;p&gt;两边积分得
&lt;/p&gt;
\[
c(x) = \int q(x) \exp(\int p(x) \mathrm{d} x) + C
\]&lt;p&gt;将 \(c(x)\) 的表达式带入式 (2.2) 即得方程 (2.1) 的一个特解(消去 \(C\) 是因为常数项已经在通解中刻画了)
&lt;/p&gt;
\[
y^{\ast} = \exp(-\int p(x) \mathrm{d} x) \int q(x) \exp(\int p(x) \mathrm{d} x)
\]&lt;p&gt;结合齐次方程的通解, 则方程 (2.1) 的通解为
&lt;/p&gt;
\[
y = C \exp\left(-\int p(x) \mathrm{d} x\right) + \exp(-\int p(x) \mathrm{d} x) \int q(x) \exp(\int p(x) \mathrm{d} x)
\]&lt;h3 id="伯努利方程"&gt;伯努利方程&lt;/h3&gt;
\[
\frac{\mathrm{d} y}{\mathrm{d} x} + p(x) y = q(x) y^n
\]&lt;p&gt;两边同时除以 \(y^{n}\) 即得
&lt;/p&gt;
\[
y^{-n}\frac{\mathrm{d} y}{\mathrm{d} x} + p(x) y^{1-n} = q(x)
\]&lt;p&gt;设 \(Y = y^{1-n}, P(x) = (1-n)p(x), Q(x) = (1-n)q(x)\), 将两边同乘 \((1-n)\) 即得
&lt;/p&gt;
\[
\frac{\mathrm{d} Y}{\mathrm{d} x} + P(x) Y = Q(x)
\]&lt;p&gt;容易套用「一阶线性微分方程」的解法.&lt;/p&gt;
&lt;h2 id="iii-可降阶的高阶微分方程"&gt;III. 可降阶的高阶微分方程&lt;/h2&gt;
&lt;h3 id="变量分离"&gt;变量分离&lt;/h3&gt;
\[
y^{(n)} = f(x)
\]&lt;p&gt;两边同时做 \(n\) 次积分即可, 最后结果形如
&lt;/p&gt;
\[
y = \int \left(\int \cdots \left(\int f(x) \mathrm{d} x\right) \cdots \mathrm{d} x \right)\mathrm{d} x + C_1 x^{n - 1} + C_2 x_{n - 2} + \cdots + C_n
\]&lt;h3 id="无显式原函数"&gt;无显式原函数&lt;/h3&gt;
\[
y'' = f(x, y')
\]&lt;p&gt;设 \(y' = g(x)\), 则原式化为一阶微分方程
&lt;/p&gt;
\[
g'(x) = f(x, g(x))
\]&lt;p&gt;解得
&lt;/p&gt;
\[
g(x) = \varphi(x, C_1)
\]&lt;p&gt;积分即得
&lt;/p&gt;
\[
y = \int g(x) \mathrm{d} x + C = \int \varphi(x, C_1) \mathrm{d} x + C_2
\]&lt;h3 id="无显式自变量"&gt;无显式自变量&lt;/h3&gt;
\[
y'' = f(y, y')
\]&lt;p&gt;设 \(y' = p(y)\), 则
&lt;/p&gt;
\[
y'' = \frac{\mathrm{d} p}{\mathrm{d} x} = \frac{\mathrm{d} p}{\mathrm{d} y} \frac{\mathrm{d} y}{\mathrm{d} x} = p(y) \frac{\mathrm{d} p}{\mathrm{d} y}
\]&lt;p&gt;回代得
&lt;/p&gt;
\[
\frac{\mathrm{d} p}{\mathrm{d} y} = \frac{f(y, p(y))}{p(y)}
\]&lt;p&gt;设其通解为 \(p(y) = \varphi(y, C_{1})\), 则分离变量后积分可得
&lt;/p&gt;
\[
\int \frac{\mathrm{d} y}{\varphi(y, C_1)} = x + C_2
\]&lt;h2 id="iv-常系数线性微分方程"&gt;IV. 常系数线性微分方程&lt;/h2&gt;
&lt;p&gt;研究「常系数线性微分方程」一般以二阶微分方程为主, 形如
&lt;/p&gt;
\[
y'' + py' + qy = f(x)
\]&lt;h3 id="二阶常系数齐次线性微分方程"&gt;二阶常系数齐次线性微分方程&lt;/h3&gt;
&lt;p&gt;对于方程
&lt;/p&gt;
\[
y'' + py' + qy = 0
\]&lt;p&gt;注意到 \(\mathrm{e}^{rx}\) 与其导数只差常数因子, 于是设 \(y = \mathrm{e}^{rx}\) 即得
&lt;/p&gt;
\[
(r^2 + pr + q)\mathrm{e}^{rx} = 0
\]&lt;p&gt;称 \(r^{2} + pr + q = 0\) 为原方程的「特征方程」, 求出来的根称为「特征根」.&lt;/p&gt;
&lt;p&gt;注意到方程的通解可以用两个线性无关的特解的线性组合刻画(此处不加以证明), 于是考虑根据特征根构造两个特解.&lt;/p&gt;
&lt;p&gt;当特征方程 \(\Delta \gt 0\) 时, 存在两相异实根 \(r_{1}, r_{2}\), 则该微分方程的通解为
&lt;/p&gt;
\[
y = C_1\mathrm{e}^{r_1 x} + C_2 \mathrm{e}^{r_2x}
\]&lt;p&gt;当特征方程 \(\Delta = 0\) 时, 存在两相同实根 \(r_{1} = r_{2}\), 则该微分方程有一个特解 \(y_{1} = \mathrm{e}^{r_{1} x}\).&lt;/p&gt;
&lt;p&gt;设另一特解 \(y_{2} = y_{1} u(x) = \mathrm{e}^{r_{1} x}u(x)\), 将其带入方程得
&lt;/p&gt;
\[
\mathrm{e}^{r_1x}\left( (u''(x) + 2r_1 u'(x) + {r_1}^2 u(x)) + p(u'(x) + r_1 u(x)) + qu(x) \right) = 0
\]&lt;p&gt;化简得
&lt;/p&gt;
\[
u''(x) + (2r_1 + p)u'(x) + ({r_1}^2 + pr_1 + q) u(x) = 0
\]&lt;p&gt;由于 \(r_{1} = -\dfrac{p}{2}\) 且其为方程 \({r_{1}}^{2} + pr_{1} + q = 0\) 的根, 于是解得
&lt;/p&gt;
\[
u''(x) = 0
\]&lt;p&gt;取 \(u(x) = x\) 即得特解 \(y_{2} = x \mathrm{e}^{r_{1} x}\), 结合特解 \(y_{1}\) 即有原方程通解
&lt;/p&gt;
\[
y = \left( C_1 + C_2 x \right) \mathrm{e}^{r_1 x}
\]&lt;p&gt;当特征方程 \(\Delta \lt 0\) 时, 存在一对共轭复根 \(r_{1} = \alpha + i\beta, r_{2} = \alpha - i \beta\).&lt;/p&gt;
&lt;p&gt;此时原方程有两个解
&lt;/p&gt;
\[
y = \exp \left( (\alpha \pm i\beta) x \right)
\]&lt;p&gt;运用欧拉公式 \(\mathrm{e}^{i \theta} = \cos\theta + i\sin \theta\) 得到
&lt;/p&gt;
\[
y = \mathrm{e}^{\alpha x} \left( \cos \beta x \pm i \sin \beta x \right)
\]&lt;p&gt;通过线性组合构造两个线性无关的解
&lt;/p&gt;
\[
\begin{aligned}
y_1 &amp;= \frac{1}{2} \sum y = \mathrm{e}^{\alpha x} \cos \beta x \\
y_2 &amp;= \frac{1}{2i} \Delta y = \mathrm{e}^{\alpha x} \sin \beta x
\end{aligned}
\]&lt;p&gt;于是原方程的通解为
&lt;/p&gt;
\[
y = \mathrm{e}^{\alpha x} \left( C_1 \cos \beta x + C_2 \sin \beta x \right)
\]&lt;p&gt;以上结论均可推广到高阶情形.&lt;/p&gt;
&lt;h3 id="二阶常系数非齐次线性微分方程"&gt;二阶常系数非齐次线性微分方程&lt;/h3&gt;
&lt;p&gt;对形如下式的微分方程
&lt;/p&gt;
\[
y'' + py' + qy = \mathrm{e}^{\lambda x} f(x)
\]&lt;p&gt;根据前面的经验, 我们只需要求出该方程的一个特解.&lt;/p&gt;
&lt;p&gt;设特解 \(y^{\ast} = \mathrm{e}^{\lambda x} g(x)\), 则有
&lt;/p&gt;
\[
\begin{aligned}
\left(y^{\ast}\right)^{\prime} &amp;= \mathrm{e}^{\lambda x} (\lambda g(x) + g'(x)) \\
\left(y^{\ast}\right)^{\prime\prime} &amp;= \mathrm{e}^{\lambda x} (\lambda^2 g(x) + 2\lambda g'(x) + g''(x))
\end{aligned}
\]&lt;p&gt;带入原方程并化简得
&lt;/p&gt;
\[
g''(x) + (2\lambda + p) g'(x) + (\lambda^2 + p\lambda + q) g(x) = f(x) \tag{4.1}
\]&lt;p&gt;注意到当 \(\lambda\) 分别为特征方程的 \(k = 0, 1, 2\) 重根的时候, \(g(x)\) 和 \(g'(x)\) 对应项会依次变为 \(0\). 这意味着当 \(k\) 取 \(0, 1, 2\) 时, \(g(x), g'(x)\) 和 \(g''(x)\) 需要分别为与 \(f(x)\) 同次数的多项式, 于是不妨设 \(r(x)\) 为与 \(f(x)\) 同次数的待定系数多项式, 特解即为
&lt;/p&gt;
\[
y^{\ast} = g(x)\mathrm{e}^{\lambda x} = x^k r(x)\mathrm{e}^{\lambda x}
\]&lt;p&gt;将其带入式 (4.1) 中即可算出 \(r(x)\) 的各系数, 进而得到方程的一个特解.&lt;/p&gt;
&lt;p&gt;对形如下式的微分方程
&lt;/p&gt;
\[
y'' + py' + qy = \mathrm{e}^{\lambda x} \left( f(x) \cos \omega x + g(x) \sin \omega x \right)
\]&lt;p&gt;应用欧拉公式将等式右侧化为
&lt;/p&gt;
\[
\begin{aligned}
h(x) &amp;= \mathrm{e}^{\lambda x} \left( f(x) \cos \omega x + g(x) \sin \omega x \right) \\
&amp;= \mathrm{e}^{\lambda x} \left( f(x) \frac{\mathrm{e}^{\omega x i} + \mathrm{e}^{-\omega x i}}{2} + g(x) \frac{\mathrm{e}^{\omega x i} - \mathrm{e}^{-\omega x i}}{2i} \right) \\
&amp;= \left( \frac{f(x)}{2} + \frac{g(x)}{2i} \right) \mathrm{e}^{(\lambda + \omega i) x} + \left( \frac{f(x)}{2} - \frac{g(x)}{2i} \right) \mathrm{e}^{(\lambda - \omega i) x} \\
&amp;= h_1(x) \mathrm{e}^{(\lambda + \omega i) x} + h_2(x) \mathrm{e}^{(\lambda - \omega i) x}
\end{aligned}
\]&lt;p&gt;其中 \(h_{1}(x)\) 和 \(h_{2}(x)\) 为从 \(f(x)\) 和 \(g(x)\) 线性组合得到的函数, 且对应项系数共轭.&lt;/p&gt;
&lt;p&gt;设 \(\lambda + \omega i\) 是特征方程的 \(k\) 重根(\(k = 0, 1\)), 则方程
&lt;/p&gt;
\[
y'' + py' + qy = h_1(x) \mathrm{e}^{(\lambda + \omega i) x}
\]&lt;p&gt;有特解
&lt;/p&gt;
\[
{y_1}^{\ast} = x^k r(x) \mathrm{e}^{(\lambda + \omega i) x} \tag{4.2}
\]&lt;p&gt;设 \(m\) 为 \(f(x), g(x)\) 中次数较大者的次数, \(r(x)\) 是待定系数的 \(m\) 次多项式. 对式 (4.2) 两边取共轭即得
&lt;/p&gt;
\[
\left({y_1}^{\ast}\right)^{\prime\prime} + p\left({y_1}^{\ast}\right)^{\prime} + q({y_1}^{\ast}) \equiv h_1(x) \mathrm{e}^{(\lambda + \omega i) x} = h_2(x) \mathrm{e}^{(\lambda - \omega i) x}
\]&lt;p&gt;因此 \({y_{2}}^{\ast} = ({y_{1}}^{\ast})\) 为以下方程的特解
&lt;/p&gt;
\[
y'' + py' + qy = h_2(x) \mathrm{e}^{(\lambda - \omega i) x}
\]&lt;p&gt;于是原方程的特解可以用两部分的特解之和来刻画, 即
&lt;/p&gt;
\[
\begin{aligned}
y^{\ast} &amp;= {y_1}^{\ast} + {y_2}^{\ast} \\
&amp;= x^k \mathrm{e}^{\lambda x} \left( r(x) \mathrm{e}^{i\omega x} + (r(x))\mathrm{e}^{-i\omega x} \right) \\
&amp;= x^k \mathrm{e}^{\lambda x} \left( r_1(x) \cos \omega x + r_2(x) \sin \omega x \right)
\end{aligned}
\]&lt;p&gt;从上述推到中我们可以发现 \(y^{\ast}\) 实则是个实函数, 于是 \(r_{1}\) 和 \(r_{2}\) 也均为 \(m\) 次实多项式.&lt;/p&gt;
&lt;p&gt;综上, 对于微分方程
&lt;/p&gt;
\[
y'' + py' + qy = \mathrm{e}^{\lambda x} \left( f(x) \cos \omega x + g(x) \sin \omega x \right)
\]&lt;p&gt;可以设特解为
&lt;/p&gt;
\[
y^{\ast} = x^k \mathrm{e}^{\lambda x} \left( r_1(x) \cos \omega x + r_2(x) \sin \omega x \right)
\]&lt;p&gt;然后代入原方程解出待定系数. 该结论也可推广到高阶形式.&lt;/p&gt;</description></item><item><title>三种曲线方程刻画方式的相互转换</title><link>https://sichen-wang.github.io/blog/%E4%B8%89%E7%A7%8D%E6%9B%B2%E7%BA%BF%E6%96%B9%E7%A8%8B%E5%88%BB%E7%94%BB%E6%96%B9%E5%BC%8F%E7%9A%84%E7%9B%B8%E4%BA%92%E8%BD%AC%E6%8D%A2/</link><pubDate>Mon, 13 Jan 2025 20:20:13 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E4%B8%89%E7%A7%8D%E6%9B%B2%E7%BA%BF%E6%96%B9%E7%A8%8B%E5%88%BB%E7%94%BB%E6%96%B9%E5%BC%8F%E7%9A%84%E7%9B%B8%E4%BA%92%E8%BD%AC%E6%8D%A2/</guid><description>&lt;p&gt;&lt;strong&gt;直角坐标方程&lt;/strong&gt;形如 \(y = f(x)\) 或 \(f(x, y) = 0\)，&lt;strong&gt;参数方程&lt;/strong&gt;形如
&lt;/p&gt;
\[
\begin{cases}
x = f(t) \\
y = g(t)
\end{cases}
\]&lt;p&gt;
&lt;strong&gt;极坐标方程&lt;/strong&gt;形如 \(\ell = \rho(\theta)\)。&lt;/p&gt;
&lt;h3 id="直角坐标方程转参数方程"&gt;直角坐标方程转参数方程&lt;/h3&gt;
\[
y = f(x) \Longrightarrow
\begin{cases}
x = t \\
y = f(t)
\end{cases}
\]&lt;h3 id="参数方程转直角坐标方程"&gt;参数方程转直角坐标方程&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;代入法: 直接从 \(x = f(t)\) 解出 \(t = f^{-1}(x)\), 然后将其带入 \(y = g(t)\) 解得 \(x\) 和 \(y\) 关系.&lt;/li&gt;
&lt;li&gt;三角法: 如果方程涉及三角函数, 则可以利用三角恒等式解出直角坐标方程.
\[
\begin{cases}
x = r \cos t \\
y = r \sin t
\end{cases}
\Longrightarrow
x^2 + y^2 = r^2 (\sin^2 t + \cos^2 t) = r^2
\]&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="极坐标方程转参数方程"&gt;极坐标方程转参数方程&lt;/h3&gt;
\[
\ell = \rho(\theta) \Longrightarrow
\begin{cases}
y = \rho(t) \sin t \\
x = \rho(t) \cos t
\end{cases}
\]&lt;h3 id="参数方程转极坐标方程"&gt;参数方程转极坐标方程&lt;/h3&gt;
&lt;p&gt;注意到在极坐标系中, 点的表示为
&lt;/p&gt;
\[
\begin{aligned}
\ell &amp;= \sqrt{x^2 + y^2} \\
\theta &amp;= \arctan \frac{y}{x}
\end{aligned}
\]&lt;p&gt;于是将参数方程带入即可得出 \(\ell, \theta\) 与 \(t\) 的关系, 设 \(\ell = p(t), \theta = \arctan q(t)\), 则
&lt;/p&gt;
\[
\ell = p \circ q^{-1}(\tan \theta)
\]</description></item><item><title>Project Euler Problem 918</title><link>https://sichen-wang.github.io/blog/project-euler-problem-918/</link><pubDate>Thu, 09 Jan 2025 13:57:54 +0000</pubDate><guid>https://sichen-wang.github.io/blog/project-euler-problem-918/</guid><description>&lt;p&gt;定义数列 \(\{a_{n}\}\) 满足 \(a_{1} = 1\), 对于 \(n \geqslant 1\) 有:
&lt;/p&gt;
\[
\begin{aligned}
a_{2n} &amp;= 2a_n \\
a_{2n + 1} &amp;= a_n - 3a_{n + 1}
\end{aligned}
\]&lt;p&gt;定义 \(S_{n} = \sum\limits_{i = 1}^{n} a_{i}\), 求 \(S_{k}(k = 10^{12})\).&lt;/p&gt;
&lt;hr&gt;
\[
\begin{aligned}
S_{2n} &amp;= (a_1 + a_3 + \cdots + a_{2n - 1}) + (a_2 + a_4 + \cdots + a_{2n}) \\
&amp;= [a_1 + (a_1 - 3a_2) + \cdots + (a_{n - 1} - 3a_n)] + (2a_1 + 2a_2 + \cdots + 2a_n) \\
&amp;= 4a_1 + (-2a_1 - 2a_2 - \cdots - 2a_{n - 1} - 3a_n) + (2a_1 + 2a_2 + \cdots + 2a_n) \\
&amp;= 4 - a_n
\end{aligned}
\]&lt;p&gt;故要求 \(S_{2n}\) 只需递归求 \(a_{n}\) 即可.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="n"&gt;i64&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;constexpr&lt;/span&gt; &lt;span class="n"&gt;i64&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e12&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;i64&lt;/span&gt; &lt;span class="nf"&gt;a&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i64&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Answer \(= -6999033352333308\)&lt;/p&gt;</description></item><item><title>SMBU24-25 学年《中国近代史纲要》期末考试</title><link>https://sichen-wang.github.io/blog/smbu24-25-%E5%AD%A6%E5%B9%B4%E4%B8%AD%E5%9B%BD%E8%BF%91%E4%BB%A3%E5%8F%B2%E7%BA%B2%E8%A6%81%E6%9C%9F%E6%9C%AB%E8%80%83%E8%AF%95/</link><pubDate>Sat, 04 Jan 2025 00:00:00 +0000</pubDate><guid>https://sichen-wang.github.io/blog/smbu24-25-%E5%AD%A6%E5%B9%B4%E4%B8%AD%E5%9B%BD%E8%BF%91%E4%BB%A3%E5%8F%B2%E7%BA%B2%E8%A6%81%E6%9C%9F%E6%9C%AB%E8%80%83%E8%AF%95/</guid><description>&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;CCA 押题卷及其答案(仅根据历史老师最后一节课给出的信息和下发的复习资料整理与改写而成)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id="1-近代中国半殖民地半封建社会有哪些主要特点"&gt;(1) 近代中国半殖民地半封建社会有哪些主要特点&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;封建根基&lt;/strong&gt;: 中国自然经济的基础虽然遭到破坏, 但封建剥削制度的根基依然存在。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;帝国操纵&lt;/strong&gt;: 资本与帝国主义操纵着中国的财政和经济与政治, 成为支配中国各方面的决定性力量。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;内外勾结&lt;/strong&gt;: 中国封建势力同外国侵略势力相勾结, 帮助外国列强奴役中国人民。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;民资无力&lt;/strong&gt;: 中国的民族资本主义有所发展, 但没有成为中国社会经济的主体。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;破坏平衡&lt;/strong&gt;: 造成了近代中国各地区政治、经济和文化发展极不平衡。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="3-洋务运动的失败及其原因"&gt;(3) 洋务运动的失败及其原因&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;封建性&lt;/strong&gt;: 洋务运动具有封建性, 秉承&amp;quot;中学为体, 西学为用&amp;quot;的原则, 其阶级局限性以及妥协性使其无法成为自救之道, 只能作为当时可行的过渡性模式。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;依赖性&lt;/strong&gt;: 洋务运动对列强具有依赖性, 资金、技术和人才均对外高度依赖。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;腐朽性&lt;/strong&gt;: 洋务企业的管理具有腐朽性, 用封建衙门式的管理方式管理近代企业是不可行的。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;综上, 洋务运动不可能为中国摆脱贫弱找到出路。&lt;/p&gt;
&lt;h3 id="6-什么是伟大建党精神"&gt;(6) 什么是伟大建党精神&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;坚持真理、坚守理想，践行初心、担当使命，不怕牺牲、英勇斗争，对党忠诚、不负人民。&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id="10-中国新民主主义革命取得胜利的主要原因"&gt;(10) 中国新民主主义革命取得胜利的主要原因&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;党的领导&lt;/strong&gt;: 根本原因是有中国工人阶级的先锋队与中国人民和中华民族的先锋队——中国共产党作为坚强的领导核心带领人民不断奋斗。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;群众路线&lt;/strong&gt;: 工人、农民、城市小资产阶级和民族资产阶级共同走上了反帝反封建反官僚资本主义斗争的新民主主义革命道路。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;国际同盟&lt;/strong&gt;: 国际反法西斯战线、世界无产阶级阵营与各国人民的支持。&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id="1-试论述太平天国农民战争的历史地位以及失败教训"&gt;(1) 试论述太平天国农民战争的历史地位以及失败教训&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;撼动统治&lt;/strong&gt;: 该战争沉重打击了封建统治阶级, 撼动了清政府的统治根基, 加速了清王朝的衰败。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;农民战争&lt;/strong&gt;: 该战争是中国旧式农民战争的最高峰, 涌现了《天朝田亩制度》与《资政新篇》等代表性纲领。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;批判儒家&lt;/strong&gt;: 该战争对孔子及儒家经典予以严厉批判, 在一定程度上削弱了封建统治的精神支柱。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;打击侵略&lt;/strong&gt;: 该战争有力地打击了外国侵略势力。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;失败原因&lt;/strong&gt;: 太平天国失败的根本原因是缺乏先进阶级的领导, 没有科学理论的指导, 不能正确对待传统文化, 区分侵略者与人民群众。因此单纯的农民战争不可能为中国找到出路, 争取到民族独立与人民解放。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="5-中国革命为什么必须走农村包围城市-武装夺取政权的道路"&gt;(5) 中国革命为什么必须走农村包围城市, 武装夺取政权的道路&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;别无他法&lt;/strong&gt;: 近代中国半殖半封, 内无民主, 外无独立, 只得以武装革命对付武装反革命。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;力量缺口&lt;/strong&gt;: 近代中国政治经济发展极不平衡, 强大的敌人占据中心城市, 而广大农村则是其统治的薄弱环节, 这为农村根据地的建立提供了基本条件。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;斗争本质&lt;/strong&gt;: 半殖半封下的中国农村人口占大多数, 而中国的武装斗争实质是无产阶级领导的农民战争, 因此共产党必须深入农村, 发动、组织和武装农民进行土地革命。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="8-试论述中国共产党领导的新民主主义革命胜利的基本经验"&gt;(8) 试论述中国共产党领导的新民主主义革命胜利的基本经验&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;统一战线&lt;/strong&gt;: 建立广泛的统一战线, 包括国民革命统一战线、抗日民族统一战线和人民民主统一战线, 这是坚持和发展革命的政治基础。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;武装斗争&lt;/strong&gt;: 坚持革命的武装斗争。近代中国半殖半封, 内无民主, 外无独立, 要争取民族独立、人民解放必须进行武装斗争。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;党内建设&lt;/strong&gt;: 加强共产党自身的建设。首要是看重党的思想建设, 发扬理论与实际相结合、紧密联系群众和自我批评的作风。&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; 本卷及答案仅代表 CCA 个人猜测, 不保证期末考试题目与其的重合比例, 也不保证不在卷中的题目考到的概率小, 请合理使用。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;祝考试顺利！&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>随笔(2)</title><link>https://sichen-wang.github.io/blog/%E9%9A%8F%E7%AC%942/</link><pubDate>Tue, 24 Dec 2024 00:00:00 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E9%9A%8F%E7%AC%942/</guid><description>&lt;p&gt;无端地烦闷，又或是有所察觉但不愿面对，夜里想写点东西，以作大点声的自言自语。&lt;/p&gt;
&lt;p&gt;十四五岁那时候刚刚中考完，潜意识里觉得一切还有希望，尽管已经意识到了一些问题，是故前者实则是自己骗自己。&lt;/p&gt;
&lt;p&gt;我花了约莫 10 年的时间专注做题，抵制一切所谓不纯粹的事物，怕耽误做题大业，这也是假话，实则做题久了，已碰不得其它，笨手笨脚的，让人笑话。我那时觉得，题做好了自然引人尊敬，只管做好眼前的题，就会未来可期。&lt;/p&gt;
&lt;p&gt;过去那十几年，也不知道再要往后多少年，我自觉待人不太礼貌，不懂的思考别人的想法，有时偏执，也很无聊，像个不讨人喜欢的做题家。而等我意识到这一点，我已只会做题了，甚至对做不好题的人有了些偏见。抱着这些想法，我已然错过许多机会。&lt;/p&gt;
&lt;p&gt;我羡慕那些乐观进取的人，过去许多年我反复地处于麻木和自我欺骗的循环中，也没干成过什么事，只是拿出些无聊的把戏，也去欺骗一下他人，好叫人认为我是个有所成的做题家。欺骗久了我自己也就信了，还需接着当个混得过去的演员。&lt;/p&gt;
&lt;p&gt;经常看到些虚伪的长辈，讲着满满的的大道理，嘴边挂着不知从哪听的名言，其实自己都不信，须得以此才能标榜自己的成熟。我过去是愿意一条条拎出来讽刺的，不过现在已没什么关系，毕竟没人愿意听负能量，如果有类似处境的人听得进去，觉得自己不那么孤独，感到一丝慰藉，也很好。&lt;/p&gt;
&lt;p&gt;说这许多，仍不知道有什么用，还是做题家思维在作祟。当自言自语是非常好的，却不必去找寻什么作用。&lt;/p&gt;</description></item><item><title>散文(1)</title><link>https://sichen-wang.github.io/blog/%E6%95%A3%E6%96%871/</link><pubDate>Sat, 14 Dec 2024 00:00:00 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E6%95%A3%E6%96%871/</guid><description>&lt;p&gt;在这个暖洋洋的下午，我身旁无人，也无处可去。但趁着天光，总是想写点什么，于是我开窗，透彻的风贯穿了 7 年光阴，沁入脑海，记忆开始变得锐利，明亮……&lt;/p&gt;
&lt;p&gt;故事还要从 2017 年的秋天说起，许是寒风吹起的落叶在心中寂寥的潭面点起了涟漪，又或是新入初中的新鲜带来热切与憧憬，在听到学校”信息学社团”招人广播的当天我便提交了申请——怀着成为一名黑客的愿望。所幸文化课成绩尚可，不久后我便成了”社团”的一员。&lt;/p&gt;
&lt;p&gt;一开始确是很对劲的，王文武老师站在讲台前侃侃而谈——变量，运算，分支，循环…… 我们坐在台下似雾里看花，键盘都用不熟练的稚子写下一行行跑不通的代码。但这又何妨呢? 种子已经发了芽，一周一次的训练像一周一次的春梦，我小心翼翼地感受着，摸索着，向前走着。记忆像是断了的弦，强行接上只能奏出呕哑嘲哳，于是我说，算了，那就当作整个初一乘着美梦而行。&lt;/p&gt;
&lt;p&gt;故事总是需要突如其来的转折推动。考试，劝退，分快慢班。一百多人挤得满满当当的机房只留下十余人，“师大附中博才信息组”正式代替”信息学社团”，我们突然被赋予了明确的目标——参加 NOIp2018 普及组。接踵而至的便是一周两次的训练和半个月的暑假集训，我的模拟赛成绩从第一次的 60 分逐渐提高到最后几天的稳定 300+。但故事总是需要突如其来的转折推动。在 NOIp2018 普及组中，我第二题没有开 long long，第三题 freopen 写错，总计挂 30 分，最终距一等奖线 6 分。出成绩后，没拿到一等奖的同学们有一半退役了。我扪心自问: 我有天赋吗? 有的。我有努力吗? 有的。那便继续前进，无问西东。&lt;/p&gt;
&lt;p&gt;第一次普及组过后，我们仅存的几人便去到湖南师大附中跟着高中生一起训练——说是高中生，其实多数时间是跟初三的学长待在一块儿。高中的学长偶尔来讲课，除此之外便是日复一日的训练。承蒙此时的教练孙沅老师看重，我与另一名同班同学获得了停课训练的机会。那段时光想来十分梦幻，学会的算法一个接一个，做出的题目一道接一道，师长的关心，学长的帮助，同学的相互支持。我怀着被刻上攀登碑的梦想，一步步向前走去，此中艰辛不足为外人道也。&lt;/p&gt;
&lt;p&gt;一年时间转瞬即逝，NOIp2019 取消，我踏上 CSP-S2019 的考场。第一天上午挂了 50 分，这突如其来的变故瞬间击垮了我——那天中午我想了很多，不甘自是有的，更多的是过去一年日日夜夜的剪影与梦想破灭的恍惚。好在有父母的陪伴，他们没有过多言语，只是擦去我的眼泪: ”先吃饭吧。下午还有普及组。” 我当时没能理解，只是嘶哑地喊: ”这是我真正的中考啊!” 爸爸打开车内的空调，妈妈抱住了我。我哭累了，于是睡去。下午的 CSP-J2019 并没有因为我的悲伤或其它任何人的欣喜发生变化，我恍惚地走进考场，常年训练带来的考试状态让我在走进机房的一刻剥离了所有杂念。环视四周，似乎与上午相比，下午考生的平均年龄与我更为接近。试题发下来了，平凡，无趣，没有难度。不出意外地，我走出考场，得意地向父母说: ”感觉是满分。” 爸爸拍拍我的肩膀: ”你看，其实在初中生里你已经是顶尖水平了，明天认真打就行，不论什么成绩我和你妈都会一直支持你的。” 第二天如约走入考场，做题的记忆已经模糊，我只记得最后 13 秒，在老师提醒交卷的催促声和考生们临近结束的躁动声中，我平静地修改掉最后一处 BUG，拿下 50 分，起身收拾纸笔，走出考场。&lt;/p&gt;
&lt;p&gt;那天下午，我们信息组一起去爬了岳麓山，登临顶峰，天朗气清，一览众山小。&lt;/p&gt;
&lt;p&gt;而后我对初中阶段 OI 的记忆就基本结束了，我们只维持着基本的训练量，多数精力投入中考。一个多月后出成绩了，CSP-J(初中组)并未满分，但的确是一个远远超出一等奖线的高分和高位次，CSP-S(高中组) 236 分，拿下一等奖。当年湖南省仅有十余位初中生在 CSP-S 中获得一等，于是我也顺理成章拿下高中的”保送”资格，再加上我父亲在湖南师大教书带来的子弟优待给我上了双保险，在接下来的文化课时光里我和同学们打打闹闹，快乐地度过了初三剩下的半年。最终我中考成绩尚可，于是自然地进入了湖南师大附中。&lt;/p&gt;
&lt;p&gt;写到这儿有些累了，又或许是不愿再回忆高中时的一些痛苦，今天就在这停笔吧，等我想清楚了，伤口慢慢愈合了，再把那些陈年往事仔细拼起来，讲给你们听……&lt;/p&gt;</description></item><item><title>From Decoding to Meta-Generation：Inference-time Algorithms for Large Language Models</title><link>https://sichen-wang.github.io/blog/from-decoding-to-meta-generation-inference-time-algorithms-for-large-language-models/</link><pubDate>Thu, 05 Dec 2024 23:18:16 +0000</pubDate><guid>https://sichen-wang.github.io/blog/from-decoding-to-meta-generation-inference-time-algorithms-for-large-language-models/</guid><description>&lt;h2 id="生成的目标"&gt;生成的目标&lt;/h2&gt;
&lt;p&gt;记某个生成的结果集为 \(S\), 用户会对其打分为 \(A(S) \in \mathbb{R}\), 将其归一化处理后可以得到一个概率分布, 记作 \(q_{\ast}\), 显然有 \(q_{\ast}(S) \propto A(S)\). 设 \(\mathrm{d} (p, q) \in \mathbb{R}\) 是某评价两分布接近程度的函数, \(g\) 是生成器采样得到结果的分布, 我们不妨假定用户希望最小化 \(\mathrm{d} (q_{\ast}, g)\). 但往往 \(q_{\ast}\) 是几乎不可知的, 于是我们接下来考虑如何在不知道 \(q_{\ast}\) 的情况下最小化 \(\mathrm{d} (q_{\ast}, g)\).&lt;/p&gt;
&lt;p&gt;直觉上, 对于一个训练好的语言模型, 我们认为它只需要针对一个输入, 从模型的输出分布中选择一个即可, 但事实并非如此. 一般生成使用的都是&lt;strong&gt;自回归模型&lt;/strong&gt;, 每次根据上下文生成一个 token, 并将该 token 加入上下文中, 如此反复. 以下是几种生成的方式:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;最大化&lt;/strong&gt;: 考虑每次生成一个结果 \(S\), 使 \(v(S)\) 最大化, 其中 \(v\) 是某个近似估计当前输出与 \(q_{\ast}\) 拟合程度的函数.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;采样&lt;/strong&gt;: 每次从一个分布 \(p_\theta(\cdot | y_{:i-1})\) 中采样, 然后将其附加到上下文中.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;从指定的目标分布中采样&lt;/strong&gt;: 采样到某个结果的概率正比于其与分布 \(q_{\ast}\) 的拟合程度.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="token-级别的生成算法"&gt;Token 级别的生成算法&lt;/h2&gt;
&lt;h3 id="map-decoding-algorithm"&gt;MAP Decoding Algorithm&lt;/h3&gt;
&lt;p&gt;最简单的 MAP 解码就是贪心地选择使当前 \(p_{\theta}(y|x)\) 最大的 \(y\), 但显然其不一定取到整个序列的最优解.&lt;/p&gt;
&lt;p&gt;对 MAP 解码的一个优化是, 考虑保留排名前 \(k\) 的结果分别加入上下文中用于下次迭代.&lt;/p&gt;
&lt;p&gt;当然, MAP 解码有一些缺陷, 在实践中发现其倾向于产生较短的结果, 对于此, 可以通过将序列的对数概率除以其长度缓解, 但并不足以完全解决. 同时, 由于贪心算法本身的特性, 序列的生成也可能陷入循环. 而在误差方面, 由于最终结果空间中每条路径的概率都非常小, 一些偶然误差就会影响非常大, 结果就容易退化. 在一些情况下, 假设各个 token 的概率相近, 每次取概率最大的 token 可能导致最终结果路径偏离典型集非常远.&lt;/p&gt;
&lt;p&gt;尽管 MAP 解码有许多缺点, 其在翻译等输入输出问题上表现得仍然很好, 原因可能是其结构无意中符合了人的思维模式. 另一方面, MAP 解码会极大地限制输出的多样性, 而保留排名前 \(k\) 的结果又会导致极大的计算资源开销, 所以我们需要更高效从模型中进行采样的算法.&lt;/p&gt;
&lt;h3 id="采样和适配器"&gt;采样和适配器&lt;/h3&gt;
&lt;p&gt;MAP 解码的一个替代方法是不进行任何贪心操作, 直接从 \(y \sim y_{\theta}(y|x)\) 中采样, 各项分布正比于对数概率, 这被称为祖先采样.&lt;/p&gt;
&lt;p&gt;祖先采样避免了许多 MAP 解码的退化行为, 比如重复陷阱, 并为语言模型的生成引入了更丰富的多样性. 当然, 祖先采样也有一些缺陷, 比如可能会过度采样不太可能的 token. 对于此, 可以通过启发式方法在每个时间步骤选择一个阈值, 仅考虑采样概率高于该阈值的 token. 有些时候我们希望获得比祖先采样更高的多样性, 可以考虑在贪心采样和均匀采样之间进行插值.&lt;/p&gt;
&lt;p&gt;考虑用一个式子拟合以上方法&lt;/p&gt;
\[
q_t(y_t \mid y_{\lt t}, x; p_\theta, \tau) \propto \exp(s_\theta(y_{\lt t}, x) / \tau)
\]&lt;p&gt;将 \(\tau\) 设为 \(\to 0\) 即为贪心解码, 设 \(\tau\) 为 \(1\) 即为祖先采样, 设 \(\tau \gt 1\) 即接近于均匀采样.&lt;/p&gt;
&lt;h3 id="控制生成"&gt;控制生成&lt;/h3&gt;
&lt;p&gt;考虑将生成概率复合上一个调节序列 \(c(y)\), 即&lt;/p&gt;
\[
q_{\ast} \propto p_\theta(y|x)c(y)
\]&lt;p&gt;以下是基于 \(c(y)\) 结构的三个例子.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;分类器&lt;/strong&gt;: 设 \(c(y) = p(a|x, y)\), 它预测 \(y\) 包含一个属性 \(a\) 的概率, 比如某种风格. 目标从以下分布中采样&lt;/p&gt;
\[
q_{\ast} \propto p_\theta(y|x)p(a|x, y)^\beta
\]&lt;p&gt;其中 \(\beta\) 是一个超参数, 越大则给分类器分配更高的权重.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;提示器&lt;/strong&gt;: 设 \(c(y) = [y \in Y_{x}^{\ast}]\), 它确保生成的结果包含 \(Y_{x}^{\ast}\) 中的某个期望关键字, 例如 \(Y_{x}^{\ast}\) 是推理问题中的正确解决方案集合. 目标从以下分布中采样&lt;/p&gt;
\[
q_{\ast} \propto p_\theta(y|x)[y \in Y_x^{\ast}]
\]&lt;p&gt;&lt;strong&gt;奖励&lt;/strong&gt;: 一个重要的情况是, 当 \(c(y)\) 被奖励函数 \(r(x, y) \to \mathbb{R}\) 控制时, 目标从以下分布中采样&lt;/p&gt;
\[
q_{\ast} \propto p_\theta(y|x) \exp\left(\frac{1}{\beta} r(x, y)\right)
\]&lt;p&gt;其中 \(\beta \in \mathbb{R}\) 在从 \(p_{\theta}\) 取样 \((\beta \to \infty)\) 和最大化奖励 \((\beta \to 0)\) 之间进行插值.&lt;/p&gt;
&lt;h3 id="约束解码"&gt;约束解码&lt;/h3&gt;
&lt;p&gt;通常我们希望生成满足某些约束的结果, 这些标记可能是结构性的, 比如, 满足 &lt;code&gt;.json&lt;/code&gt; 格式; 或者包含特定的词, 比如, 必须包含「请」. 与&lt;strong&gt;控制生成&lt;/strong&gt;相比, 该约束是强制性的. 显然我们可以通过拒绝采样严格地执行约束, 但这种方法可能导致采样不终止.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;基于解析器的结构约束解码&lt;/strong&gt;: 该方法通过将语言模型与解析器配对来执行此类约束. 解析器只允许有效的拓展成为下一个 token 的候选项. 编写该解析器的难点在于, 如何识别有效的下一 token, 并将解析器与子词分词器连接. 解析器的效率取决于指定的输出集合形式的复杂性, 有些简单的要求可以使用有限状态自动机来实现; 而更复杂的约束需要使用更复杂, 计算开销更大的解析器.&lt;/p&gt;
&lt;p&gt;基于解析器的约束解码方法可以加速解码, 简单来说, 候选集只有一个元素的时候就不需要使用大模型向前传递了, 直接接受该 token 即可. 这启发我们约束性解码的一个缺点, 如果候选集为空怎么办呢? 几种解码方法通过一种名为 token healing 的方法处理这个问题, 将生成器回滚至倒数第二个 token, 然后再接着生成下一个 token.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;词汇约束解码&lt;/strong&gt;: 通常, 希望输出中不要包含某些词汇是简单的, 但想要输出特定词汇就比较困难了, 一般采用一些启发式搜索算法解决, 例如利用梯度指导搜索方向.&lt;/p&gt;
&lt;h2 id="元生成算法"&gt;元生成算法&lt;/h2&gt;
&lt;p&gt;考虑将前文「token 级别的生成器」作为一个黑盒, 讨论调用子生成器的算法, 也即&lt;/p&gt;
\[
y \sim g(\cdot | x, \{g_1, g_2, \cdots, g_G\}, \phi)
\]&lt;p&gt;其中 \(g\) 定义了元生成器的使用策略, \(\{g_{1}, g_{2}, \cdots, g_{G}\}\) 为子生成器, \(\phi\) 是其它任何输出和超参数.&lt;/p&gt;
&lt;p&gt;「元生成」作为一种对底层生成器模型实现无关的抽象, 需要澄清其与其它生成算法的关联.&lt;/p&gt;
&lt;h3 id="链式元生成器"&gt;链式元生成器&lt;/h3&gt;
&lt;p&gt;将生成器直接相接是很自然的, 例如通过以下方法生成一个故事&lt;/p&gt;
\[
y = f_1 \circ f_2 \circ f_3\left(f:=(x; p_\theta, \phi) \to y\right)
\]&lt;p&gt;其中 \(f_{1}\) 生成故事大纲, \(f_{2}\) 填充各部分, \(f_{3}\) 修改故事以润色和满足长度限制.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;问题分解&lt;/strong&gt;: 很多算法采用链模式, 以将输入–输出问题分解为多个步骤, 每个步骤由语言模型或外部函数实现. 例如: 首先调用生成器将问题分解为子问题, 然后连读调用生成器回复每个子问题; 注意力系统在生成之前重写输入以帮助模型避免关注不相关的信息.&lt;/p&gt;
&lt;h3 id="并行元生成器"&gt;并行元生成器&lt;/h3&gt;
&lt;p&gt;「并行元生成器」是并行生成多个轨迹, 然后合并生成的终止状态以获得最终生成的序列.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;重排序算法&lt;/strong&gt;: 其用于在 \(n\) 个候选列表中排序, 选择排名前 \(k\) 的序列. 其只会使得计算复杂度线性增长, 与贪心解码相比, 它更适合于黑箱生成器, 因为它不需要了解用于填充候选列表的生成器.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;噪声通道重排序&lt;/strong&gt;: 将输出的结果经过一些未知噪声模式的扭曲.&lt;/p&gt;</description></item><item><title>随笔(1)</title><link>https://sichen-wang.github.io/blog/%E9%9A%8F%E7%AC%941/</link><pubDate>Mon, 28 Oct 2024 00:00:00 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E9%9A%8F%E7%AC%941/</guid><description>&lt;p&gt;你把权衡，理智，成长等等因素一股脑地扔进一份真挚而纯粹的情感中，把它包装得光鲜，正能量，充满了活力，你说这是属于你的真爱，你爱得好清醒，好理智。但我要说，你爱得好幸苦，好懦弱。&lt;/p&gt;
&lt;p&gt;在你产生权衡想法的那一刻，这份爱已然变得浑浊，它的核心承载着你对自己的要求和社会对你的期许。你把它装进名为真爱的外壳，然而，这个冰冷的外壳杀死了你炽烈的爱，杀死了你的英勇与义无反顾，杀死了你爱下去的可能性。&lt;/p&gt;
&lt;p&gt;我说，你就算不顾一切又能如何呢？抛弃理智，狂热地爱上她，爱上她的一切。你会产生错误的思想，做出错误的举动，这当然不一定能导出正确的结果，但从始至终，谁又能保证结果呢？爱，从来都不单是结果，也不纯粹是为了结果。&lt;/p&gt;
&lt;p&gt;但至少我清楚地知道，自己曾那样疯狂地爱过，抛弃了思考，抛弃了成败，抛弃了从中获得任何成长的想法。只剩下一个念头：我爱她，只会有爱，只能是她。在那一刻，这是多么一份真诚的，炽热的，在心中义无反顾跳动着的——纯粹的爱。&lt;/p&gt;</description></item><item><title>多次取 (0, 1) 之间的随机实数, 期望多少次后其和恰不小于 1</title><link>https://sichen-wang.github.io/blog/%E5%A4%9A%E6%AC%A1%E5%8F%96-0-1-%E4%B9%8B%E9%97%B4%E7%9A%84%E9%9A%8F%E6%9C%BA%E5%AE%9E%E6%95%B0-%E6%9C%9F%E6%9C%9B%E5%A4%9A%E5%B0%91%E6%AC%A1%E5%90%8E%E5%85%B6%E5%92%8C%E6%81%B0%E4%B8%8D%E5%B0%8F%E4%BA%8E-1/</link><pubDate>Tue, 27 Aug 2024 19:42:49 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E5%A4%9A%E6%AC%A1%E5%8F%96-0-1-%E4%B9%8B%E9%97%B4%E7%9A%84%E9%9A%8F%E6%9C%BA%E5%AE%9E%E6%95%B0-%E6%9C%9F%E6%9C%9B%E5%A4%9A%E5%B0%91%E6%AC%A1%E5%90%8E%E5%85%B6%E5%92%8C%E6%81%B0%E4%B8%8D%E5%B0%8F%E4%BA%8E-1/</guid><description>&lt;p&gt;设事件 \(\omega_{n}\) 表示随机取 \(n\) 个 \((0, 1)\) 中的实数, 其和小于 \(1\).&lt;/p&gt;
\[
\begin{aligned}
E &amp;= \sum_{n = 1}^{\infty} n P(\omega_{n - 1} \overline{\omega_n}) \\
&amp;= \sum_{n = 1}^{\infty} n \left[ P(\omega_{n - 1}) - P(\omega_{n - 1}\omega_n) \right] \\
&amp;= \sum_{n = 1}^{\infty} n \left[ P(\omega_{n - 1}) - P(\omega_n) \right] \\
&amp;= 1 + \sum_{n = 1}^{\infty} P(\omega_n)
\end{aligned}
\]&lt;p&gt;考虑根据定义求 \(\omega_{n}\):&lt;/p&gt;
\[
\omega_n = \int_{0}^1 \mathrm{d}x_1 \int_{0}^{1 - x_1} \mathrm{d}x_2 \int_{0}^{1 - x_1 -x_2} \mathrm{d}x_3 \cdots \int_{0}^{1 - \sum_{i \lt n} x_i} \mathrm{d}x_n
\]&lt;p&gt;将 \(1\) 用形式变量 \(x\) 代替, 即得&lt;/p&gt;
\[
\omega_n(x) = \int_{0}^x \mathrm{d}x_1 \int_{0}^{x - x_1} \mathrm{d}x_2 \int_{0}^{x - x_1 -x_2} \mathrm{d}x_3 \cdots \int_{0}^{x - \sum_{i \lt n} x_i} \mathrm{d}x_n
\]&lt;p&gt;考虑寻找 \(\omega_{n + 1}\) 和 \(\omega_{n}\) 之间的关系, 有&lt;/p&gt;
\[
\omega_{n + 1}(x) = \int_{0}^{x} \omega_n(x - x_{n + 1}) \mathrm{d}x_{n + 1}
\]&lt;p&gt;注意到在积分内部, \(\mathrm{d}(x - x_{n + 1})\) 与 \(\mathrm{d}x_{n + 1}\) 实际上是等价的, 于是得到递推式&lt;/p&gt;
\[
\omega_{n + 1}(x) = \int_{0}^{x} \omega_n(t) \mathrm{d}t
\]&lt;p&gt;根据定义 \(\omega_{1}(x) = x\), 于是归纳得&lt;/p&gt;
\[
\omega_{n}(x) = \int_{0}^{x} \frac{t^{n - 1}}{(n - 1)!} \mathrm{d}t = \frac{x^n}{n!}
\]&lt;p&gt;将 \(x\) 换回 \(1\), 回代得&lt;/p&gt;
\[
E = 1 + \sum_{n = 1}^{\infty} \frac{1}{n!} = \mathrm{e}
\]</description></item><item><title>「ABC356F」Distance Component Size Query</title><link>https://sichen-wang.github.io/blog/abc356f-distance-component-size-query/</link><pubDate>Thu, 22 Aug 2024 16:21:46 +0000</pubDate><guid>https://sichen-wang.github.io/blog/abc356f-distance-component-size-query/</guid><description>&lt;p&gt;存在初始为空的点集 \(S\), 进行 \(n\) 次操作, 形如:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;\(1\ \ u:\) 若 \(u \in S\) 则令 \(u \notin S\), 否则令 \(u \in S\).&lt;/li&gt;
&lt;li&gt;\(2\ \ u:\) 对 \(S\) 中的结点连无向边, \(x, y\) 之间有边当且仅当 \(|x - y| \leqslant k\). 求 \(u\) 所在的连通块大小.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;\(n \leqslant 2 \times 10^{5}, k, u \leqslant 10^{18}\).&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;对于一个固定的点集 \(S\), 在只需要维护连通块的情况下对所有点对两两判断是否需要连边是没有必要的, 注意到 \(\forall a, b, c \in S(a \leqslant b \leqslant c)\), 若 \(|a - c| \leqslant k\), 则 \(|a - b|, |b - c| \leqslant k\), 所以只对 \(a, b\) 和 \(b, c\) 连边同样可以维护 \(a, b, c\) 两两之间的连通性, 此时边数降到与 \(|S|\) 同阶.&lt;/p&gt;
&lt;p&gt;有了上面的结论, 加点是简单的, 只需要求出 \(u\) 在 \(S\) 中的前驱和后继, 判断它们与 \(u\) 是否满足连边条件即可. 连通性用并查集维护, 单次加点的时间复杂度为 \(\log n\).&lt;/p&gt;
&lt;p&gt;而对于删点, 我们希望尽可能避免它, 于是求出每个点存在的时间段 \([l, r]\), 将其挂在线段树上覆盖了 \([l, r]\) 的结点上. 遍历线段树时进入结点则加, 退出结点则减, 容易发现这样做只需要处理叶的撤销, 是简单的. 于是我们 \(\Theta(n\log^{2} n)\) 求出了每个时刻询问的答案.&lt;/p&gt;</description></item><item><title>数据结构典中典</title><link>https://sichen-wang.github.io/blog/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E5%85%B8%E4%B8%AD%E5%85%B8/</link><pubDate>Fri, 09 Aug 2024 12:16:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E5%85%B8%E4%B8%AD%E5%85%B8/</guid><description/></item><item><title>树上背包</title><link>https://sichen-wang.github.io/blog/%E6%A0%91%E4%B8%8A%E8%83%8C%E5%8C%85/</link><pubDate>Sat, 22 Jun 2024 15:11:24 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E6%A0%91%E4%B8%8A%E8%83%8C%E5%8C%85/</guid><description>&lt;h2 id="选取-m-个结点"&gt;选取 m 个结点&lt;/h2&gt;
&lt;p&gt;这是最普遍的情况, 从树中选取 \(m\) 个结点, 最大化它们的价值之和.&lt;/p&gt;
&lt;p&gt;符合直觉地, 设 \(f_{u, i}\) 表示从以 \(u\) 为根的子树中选取了 \(i\) 个结点的最大价值之和. 转移是显然的:&lt;/p&gt;
\[
f_{u, i + j} = \max\{f_{u, i} + f_{v, j}\}
\]&lt;p&gt;其中 \(i\), \(j\) 的范围应当分别为 \(u\) 此前枚举的子树大小和, 以 \(v\) 为根的子树大小.&lt;/p&gt;
&lt;p&gt;其最优性和可行性都是显然的, 我们考虑这个算法的复杂度. 看起来似乎是 \(\Theta(n^{3})\), 但事实上对于任意点对 \((i \in S_{u}, j \in S_{v})\), 它只会在 \(u\) 处被枚举一次. 于是时间复杂度实际上是 \(\Theta(n^{2})\).&lt;/p&gt;
&lt;h2 id="选取结点的代价之和至多为-m"&gt;选取结点的代价之和至多为 m&lt;/h2&gt;
&lt;p&gt;在这个问题中为每个结点引入了代价, 此时上述的复杂度分析不再适用.&lt;/p&gt;
&lt;p&gt;我们不妨考虑换一种思路, 正常的 \(0/1\) 背包复杂度之所以为 \(\Theta(nm)\), 是因为每次只需要对一个物品做是否选取的决策. 在这里, 我们同样考虑将物品独立起来, 只考虑当前物品选或不选. 为了保证无后效性, 接下来的结点编号都被重新设为其在后序遍历中的时间戳.&lt;/p&gt;
&lt;p&gt;设 \(f_{i, j}\) 表示考虑了前 \(i\) 个物品, 背包大小为 \(j\), 能取到的最大价值和.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;若选该物品, 则可以选择它子树中的物品, \(f_{i, j} \leftarrow f_{i - 1, j - w_{i}} + v_{i}\).&lt;/li&gt;
&lt;li&gt;若不选该物品, 则它子树内的物品都不可以选, 而子树中的编号恰好是连续的, 于是 \(f_{i, j} \leftarrow f_{i - siz_{i}, j}\).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;这样转移时间复杂度即为 \(\Theta(nm)\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dfn&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;siz&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;dfs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nl"&gt;v&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;dfs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;siz&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;siz&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dfn&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dfn&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dfn&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;siz&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dfn&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dfn&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dfn&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;knapsack_on_tree&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;siz&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dfs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>某 0/1 背包 Trick</title><link>https://sichen-wang.github.io/blog/%E6%9F%90-01-%E8%83%8C%E5%8C%85-trick/</link><pubDate>Sat, 22 Jun 2024 15:07:48 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E6%9F%90-01-%E8%83%8C%E5%8C%85-trick/</guid><description>&lt;p&gt;有 \(n\) 个物品, 第 \(i\) 个重量为 \(a_{i}\), 求重量不大于 \(c\) 的情况下能够装下的最大重量.&lt;/p&gt;
&lt;p&gt;\(n, m = \max\{a_{i}\} \leqslant 2 \times 10^{4}, c \leqslant 10^{9}.\)&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;考虑随便贪心出来一组解 \(y\), 设正确答案为 \(x\), 显然 \(0 \leqslant x - y \leqslant m\).&lt;/p&gt;
&lt;p&gt;考虑求最大的 \(k \leqslant c - y\), 满足存在一种方案, 删除一些贪心方案中选择的物品, 放入一些贪心方案中没有选择的物品, 总重量的变化量为 \(k\). \(y + k\) 即为正确答案.&lt;/p&gt;
&lt;p&gt;设数列 \(\{s_{i}\}\) 为贪心方案中未选的, 数列 \(\{t_{i}\}\) 为贪心方案中选择了的数的相反数, 其中选择 \(t_{i}\) 用以刻画从原方案中删除 \(-t_{i}\).&lt;/p&gt;
&lt;p&gt;注意到以下策略：当且仅当 \(k + s_{i} \leqslant m\) 时才考虑是否选择 \(s_{i}\), 当且仅当 \(k \gt 0\) 时, 才考虑是否从 \(\{t_{i}\}\) 中选数. 容易发现, 不论最终答案如何分布, 一定可以用这种策略刻画出来.&lt;/p&gt;
&lt;p&gt;于是我们发现在转移的过程中, \(|k| \leqslant m\) 始终成立. 因此可以导出一个简单的 \(\rm DP\)：设 \(f_{i, j, k} = 0/1\) 表示当前考虑了 \(s_{1 \sim i}\) 和 \(t_{1 \sim j}\) 中的数, 能否表示 \(k\). 据前文所述策略, 转移是显然的, 时间复杂度为 \(\Theta(n^{2} m)\).&lt;/p&gt;
&lt;p&gt;考虑继续优化, 注意到 \(0/1\) 单独占一个状态表示位非常浪费, 于是设 \(f_{i, k} = j\) 表示在考虑 \(s_{1 \sim i}\) 的情况下, 想要表示 \(k\), 至少还需要考虑 \(t_{1 \sim j}\).&lt;/p&gt;
&lt;p&gt;依据前文策略, 考虑两种转移：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;若 \(k + a_{i + 1} \leqslant m\), 则考虑是否选择 \(a_{i + 1}\), 转移到 \(f_{i + 1, k + a_{i + 1}}\) 和 \(f_{i + 1, k}\).&lt;/li&gt;
&lt;li&gt;若 \(k \gt 0\), 则考虑从 \(\{t_{i}\}\) 中选择一个数进行转移, 注意到该下标 \(p \in [f_{i, k} + 1, f_{i - 1, k}]\).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;关于 \(p\) 的范围, 首先下界是显然的, 因为如果使用 \(t_{f_{i, k}}\) 及之前的数可能会算重. 对于上界, \(f_{i - 1, k}\) 进行同样转移时的下界即为 \(f_{i - 1, k} + 1\), 又因为表示 \(k\) 只需要 \(s_{1 \sim i - 1}\) 中的数即可, 若 \(f_{i, k}\) 进行转移时使用了 \(f_{i - 1, k}\) 转移时使用的同样的 \(\{t_{i}\}\) 中的数, 那么一定是不优的, 故没有必要.&lt;/p&gt;
&lt;p&gt;关于时间复杂度：第一种转移带来的时间复杂度为 \(\Theta(nm)\). 第二种转移中, 对于一个固定的 \(k\), \(p\) 的枚举至多遍历 \(1 \sim |\{t_{i}\}|\) 中每个数至多一遍, 于是该部分时间复杂度也为 \(\Theta(nm)\).&lt;/p&gt;
&lt;p&gt;总时间复杂度为 \(\Theta(nm)\).&lt;/p&gt;</description></item><item><title>The 2024 ICPC St. Petersburg</title><link>https://sichen-wang.github.io/blog/the-2024-icpc-st.petersburg/</link><pubDate>Tue, 18 Jun 2024 15:32:06 +0000</pubDate><guid>https://sichen-wang.github.io/blog/the-2024-icpc-st.petersburg/</guid><description>&lt;p&gt;Solution of “The 2024 ICPC St. Petersburg”, and it also be kown as “
”.&lt;/p&gt;
&lt;h2 id="h"&gt;H&lt;/h2&gt;
&lt;p&gt;记 \(f(x)\) 为将 \(x\) 翻转后的数, 如 \(f(123) = 321\).&lt;/p&gt;
&lt;p&gt;给定 \(n\), 求集合 \(\{f(1), f(2), \cdots, f(n)\}\) 中第一个没出现过的正整数.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;显然为 \(n + 1\) 和 \(10\) 中的较小值.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="k"&gt;K&lt;/h2&gt;
&lt;p&gt;将字符串的对应关系反过来, 按数字从小到大输出, 详见样例.&lt;/p&gt;
&lt;hr&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;link&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;: &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;values&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;, &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;link&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="ne"&gt;EOFError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;rev&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;link&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;-&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;values&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;-&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;{}&lt;/span&gt;&lt;span class="s2"&gt;: &lt;/span&gt;&lt;span class="si"&gt;{}&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;, &amp;#34;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="o"&gt;O&lt;/h2&gt;
&lt;p&gt;长度为 \(n\) 的序列 \(\{x_{n}\}\) 存在递推关系 \(x_{i+2} = ax_{i+1} + bx_{i}\), 给定 \(a, b, n, x_{1}, x_{n}\), 要求还原这个序列.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;注意到 \(x_{n}\) 可以被表示为 \(px_{1} + qx_{2}\), 于是可以解出 \(x_{2}\) 关于 \(x_{1}\) 和 \(x_{n}\) 的表达式.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;eval&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;tuple&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;])))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="c"&gt;C&lt;/h2&gt;
&lt;p&gt;给定长度为 \(n\) 的序列 \(\{a_{n}\}\) 和 \(0/1\) 串 \(s\).&lt;/p&gt;
&lt;p&gt;求最大的 \(x\), 满足仅保留 \(s\) 中对应位 \(a\) 值不小于 \(x\) 的位后, \(0/1\) 串中存在 \(k\) 个连续的 &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;考虑从大到小将数加入, 用一棵线段树维护最大子段和, 若 \(s_{i} = 1\) 则将该位设为 \(1\), 否则设为 \(-\infty\).&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n \log n)\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SegmentTree&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;private&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Node&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;public&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Node&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lmax&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rmax&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Node&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;lmax&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;rmax&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;limL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;limR&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;pushup&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Node&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;Node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;Node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lmax&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lmax&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lmax&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rmax&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rmax&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rmax&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rmax&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lmax&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;upd&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Node&lt;/span&gt; &lt;span class="o"&gt;*&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;Node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lmax&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rmax&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;upd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;upd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;pushup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;del&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Node&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;del&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;del&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;public&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;SegmentTree&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;limL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;limR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;upd&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;upd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;limL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;limR&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;qry&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="n"&gt;SegmentTree&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;del&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39; &amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;SegmentTree&lt;/span&gt; &lt;span class="n"&gt;tree&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;1&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;tree&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;upd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;tree&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;upd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1e9&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;tree&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;qry&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="d"&gt;D&lt;/h2&gt;
&lt;p&gt;这是一个交互题, 有 \(n\) 个独立的问题.&lt;/p&gt;
&lt;p&gt;每个问题形如: 有一个人在每天的 \(1440\) 分钟中恰好睡固定的 \(720\) 分钟, 你想知道他从什么时候开始睡觉. 你每次可以询问一个时刻, 并知道他在这一刻是醒着的还是睡着的. 在每个问题中最多进行 \(50\) 次询问.&lt;/p&gt;
&lt;hr&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;%=&lt;/span&gt; &lt;span class="mi"&gt;1440&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ho&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;mi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;ho&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="s1"&gt;02d&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s1"&gt;:&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;mi&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="s1"&gt;02d&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;ask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;at &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s1"&gt; check &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;flush&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;awake&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="vm"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;__main__&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;T&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;resori&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;720&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;resori&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;resori&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;720&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;answer&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;以上是一份错误的代码, 提交上去会有莫名其妙的 &lt;code&gt;RE&lt;/code&gt;, 在此仅作记录.&lt;/p&gt;
&lt;h2 id="j"&gt;J&lt;/h2&gt;
&lt;p&gt;给定 \(2n\) 个正整数, 选出其中的一些使它们的和恰好为 \(10^{9}\).&lt;/p&gt;
&lt;p&gt;请注意, 数据用以下方式生成:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;生成有 \(n\) 个元素的正整数集 \(\mathbb{S}\), 其元素和为 \(10^{9}\), 且对于所有元素集服从随机分布.&lt;/li&gt;
&lt;li&gt;用相同的方式生成 \(\mathbb{T}\), 将两个集合合并为一个可重集作为最终输入.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;该题的一个经典做法为, 随意将所有数分为两半, 求出其中一半能组合出的所有和存入 &lt;code&gt;map&lt;/code&gt;. 然后枚举另一半能组合出的所有和 \(s\), 在 &lt;code&gt;map&lt;/code&gt; 中查询是否存在 \(10^{9} - s\) 即可. 该做法又被称为 meet in the middle.&lt;/p&gt;
&lt;p&gt;容易发现, 上述做法最多处理到 \(n\) 约为 \(20\) 的情况, 于是我们不妨将所有数随机打包成至多 \(40\) 个组, 每组中的数同时选择, 在这种情况下使用 meet in the middle. 考虑该做法的正确性: 由于本题特别的数据生成方式, 这 \(40\) 个数能组合出的和差不多是在 \([n, 2 \times 10^{9}]\) 内以某种中心集中的方式随机的. 注意到 \(2^{40} \gg 2 \times 10^{9}\), 于是打包以后也几乎必然能找到一个解.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;constexpr&lt;/span&gt; &lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;aim&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e9&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;mt19937&lt;/span&gt; &lt;span class="n"&gt;gen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;chrono&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;system_clock&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="n"&gt;time_since_epoch&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;map&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;exi&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;opt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gen&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;gen&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;opt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;exi&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;contains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;aim&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;P&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;exi&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;aim&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;P&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34; &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nl"&gt;x&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34; &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>The 2024 ICPC North America Championship</title><link>https://sichen-wang.github.io/blog/the-2024-icpc-north-america-championship/</link><pubDate>Mon, 17 Jun 2024 21:40:57 +0000</pubDate><guid>https://sichen-wang.github.io/blog/the-2024-icpc-north-america-championship/</guid><description>&lt;p&gt;Solution of “The 2024 ICPC North America Championship”, and it also be kown as “
”.&lt;/p&gt;
&lt;h2 id="d"&gt;D&lt;/h2&gt;
&lt;p&gt;给定一个长度为 \(n\) 的环, 其能进行翻转和旋转, 问另一个长度为 \(m\) 的串能否成为它的子串.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;注意到最多翻转一次, 且等价于将原序列逆序.&lt;/p&gt;
&lt;p&gt;于是定位 \(b_{1}\) 在 \(\{a_{n}\}\) 中的位置然后分别向左向右查找即可.&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n)\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;check&lt;/span&gt; &lt;span class="p"&gt;():&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;break&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="vm"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;__main__&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;()))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;()))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;1&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;reverse&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;1&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;0&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="a"&gt;A&lt;/h2&gt;
&lt;p&gt;有 \(n\) 个物品, 每个物品在 \(A\) 手中有 \(a_{i}\) 的价值, 在 \(B\) 手中有 \(b_{i}\) 的价值, 最小化 \(A, B\) 手中价值和的较大值.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;设 \(f_{i, j}\) 表示考虑前 \(i\) 个物品, 此时 \(A\) 手中的价值和为 \(j\), \(B\) 手中价值和的最小值.&lt;/p&gt;
&lt;p&gt;转移考虑第 \(i\) 个物品给 \(A\) 还是 \(B\) 即可.&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n^{2}\max\{a_{i}, b_{i}\})\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;52&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;M&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;suma&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sumb&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;suma&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;sumb&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;suma&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;suma&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;suma&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;suma&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;suma&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="j"&gt;J&lt;/h2&gt;
&lt;p&gt;有 \(n\) 个物品, 第 \(i\) 个物品占据一个长度为 \(a_{i}\) 的区间. 一开始空白区间长度为 \(p\), 从第 \(1\) 个物品开始, 依次令每个物品选择一个完全空白的区间并占据, 问最坏情况下到第几个物品无法找到可以占据的区间.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;注意到若答案为 \(i\), 则至多需要 \(i(a_{i} - 1) + \sum\limits_{j \lt i}a_{j} + 1\) 的空间. 若 \(p\) 小于这个值则到第 \(i\) 个物品放不下.&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n)\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="vm"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;__main__&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="n"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="g"&gt;G&lt;/h2&gt;
&lt;p&gt;存在 \(n \times m\) 的网格, 每个格子一开始随机等概率指向右或下, 且每个格子上都有一个计时器, 其值随机等概率取 \([0, p]\) 中的实数, 计时器归零时指向会改变, 然后其值重新变为 \(p\).&lt;/p&gt;
&lt;p&gt;现在你要从 \((1, 1)\) 走到 \((n, m)\), 每走到一个格子可以选择沿着它的指向前进或等待计时器归零再前往另一个方向, 需要注意的是你只有到达一个格子的时候才能知道格子的指向和计时器值, 求最优策略下走完的期望等待时间.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;设 \(f_{i, j}\) 表示从 \((i, j)\) 出发的期望时间.&lt;/p&gt;
&lt;p&gt;注意到所有格子的决策都是独立的, 于是考虑求 \(f_{i, j}\). 设 \(f_{i + 1, j}\) 和 \(f_{i, j + 1}\) 是 \(a, b(a \leqslant b)\).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;若 \(b \geqslant a + p\), 则一定选择走 \(a\) 的方向, 有 \(f_{i, j} = a + \frac{p}{4}\).&lt;/li&gt;
&lt;li&gt;若 \(b \lt a + p\), 有 \(f_{i, j} = \frac{a}{2} + \frac{(p - b + a)b}{2p} + \frac{(b - a)(a + b)}{4p}\).
&lt;ul&gt;
&lt;li&gt;若当前指向 \(a\), 则走 \(a\), 概率为 \(\frac{1}{2}\), 贡献为 \(a\).&lt;/li&gt;
&lt;li&gt;若到 \(a\) 的计时器大于 \(b - a\), 则走 \(b\), 概率为 \(\frac{p - (b - a)}{2p}\), 贡献为 \(b\).&lt;/li&gt;
&lt;li&gt;若到 \(a\) 的计时器不大于 \(b - a\), 则走 \(a\), 概率为 \(\frac{b - a}{2p}\), 贡献为 \(a + \frac{b - a}{2}\).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;特别的, 若 \(i = n\) 或 \(j = m\), 则只有一个方向可以转移, 设其期望为 \(e\), 有 \(f_{i, j} = e + \frac{p}{4}\).&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(nm)\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="h"&gt;H&lt;/h2&gt;
&lt;p&gt;如图所示, 每座山都是三角形, 用其顶点坐标代替.&lt;/p&gt;
&lt;p&gt;有 \(q\) 次操作, 每次加入或者删除一座山, 动态维护从上到下能看到的线条长度.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;注意到线条长度等于 \(\sqrt 2\) 倍的横坐标长度, 于是一座山 \((x, y)\) 转化为一个区间 \([x - y, x + y]\), 用动态开点线段树维护区间最小值和其数量即可.&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(q\log w)\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SegmentTree&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;private&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Node&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;public&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Node&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lazy&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Node&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;lazy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;limL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;limR&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;pushdown&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Node&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lazy&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;Node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lazy&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lazy&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lazy&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;Node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lazy&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lazy&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lazy&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lazy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;pair&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;merge&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;pair&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;pair&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;upd&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Node&lt;/span&gt; &lt;span class="o"&gt;*&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;Node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lazy&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;pushdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;upd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;upd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;nullptr&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;tie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;cnt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;tie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;cnt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;cnt&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;tie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;cnt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;cnt&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;tie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;cnt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;merge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;cnt&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;cnt&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;pair&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;qry&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Node&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;cnt&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;pushdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;auto&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;INT_MAX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;merge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;qry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;merge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;qry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;public&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;SegmentTree&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;limL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;limR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;upd&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;upd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;limL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;limR&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;pair&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;qry&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;qry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;limL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;limR&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;pair&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;SegmentTree&lt;/span&gt; &lt;span class="n"&gt;tree&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tree&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;upd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;erase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tree&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;upd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;insert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;auto&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tree&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;qry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;fixed&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;setprecision&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="i"&gt;I&lt;/h2&gt;
&lt;p&gt;给定长度为 \(n\) 的字符串, 你需要将其中的 &lt;code&gt;?&lt;/code&gt; 改成 &lt;code&gt;N&lt;/code&gt;/&lt;code&gt;A&lt;/code&gt;/&lt;code&gt;C&lt;/code&gt; 之一, 使最终的字符串中恰好存在 \(k\) 个 &lt;code&gt;NAC&lt;/code&gt; 作为子序列.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;设 \(f_{i, N, C, k}\) 表示考虑了长度为 \(i\) 的前缀中的 &lt;code&gt;A&lt;/code&gt; 的贡献, 前缀中 &lt;code&gt;N&lt;/code&gt; 的数量为 \(N\), 后缀中 &lt;code&gt;C&lt;/code&gt; 的数量为 \(C\) 时, 能否恰有 \(k\) 个 &lt;code&gt;NAC&lt;/code&gt; 作为子序列. 转移时枚举变成什么即可, 可以用 &lt;code&gt;bitset&lt;/code&gt; 优化. 时间复杂度 \(\Theta(\frac{n^{3k}}{\omega})\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;bitset&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;2600&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d%d%s&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;N&amp;#39;&lt;/span&gt; &lt;span class="n"&gt;or&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;?&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;|=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;A&amp;#39;&lt;/span&gt; &lt;span class="n"&gt;or&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;?&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;|=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;C&amp;#39;&lt;/span&gt; &lt;span class="n"&gt;or&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;?&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;|=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;N&amp;#39;&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;A&amp;#39;&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;C&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;or&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;?&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;|=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;N&amp;#39;&lt;/span&gt; &lt;span class="n"&gt;or&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;?&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;N&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;A&amp;#39;&lt;/span&gt; &lt;span class="n"&gt;or&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;?&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;A&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;C&amp;#39;&lt;/span&gt; &lt;span class="n"&gt;or&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;?&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;C&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;?&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;B&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;-1&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="m"&gt;M&lt;/h2&gt;
&lt;p&gt;存在 \(n\) 个任务, 每个任务包含两个区间. 一开始有能力值 \(a\) 和 \(b\), 按顺序遍历 \(n\) 个任务, 对每个任务可以选择跳过, 或解决后使 &lt;code&gt;a++&lt;/code&gt; 或 &lt;code&gt;b++&lt;/code&gt;. 问最多能解决多少个任务.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;一个自然的想法是设 \(f_{i, j}\) 表示能否恰好执行 \(i\) 次 &lt;code&gt;a++&lt;/code&gt; 和 \(j\) 次 &lt;code&gt;b++&lt;/code&gt;. 转移时枚举每个任务, 枚举每个值为 \(1\) 的 \(f_{i \in [a_{l} - a, a_{r} - a], j \in [b_{l} - b, b_{r} - b]}\), 将 \(f_{i + 1, j}\) 和 \(f_{i, j + 1}\) 置为 \(1\). 答案为最大的 \(i + j\), 满足 \(f_{i, j} = 1\). 时间复杂度 \(\Theta(n^{3})\).&lt;/p&gt;
&lt;p&gt;注意到一个二元组 \((i, j)\) 对应的 \(f_{i, j}\) 被置为 \(1\) 后就不会变了, 于是考虑利用这个势能限制复杂度. 维护已经被置为 \(1\) 但还未用其更新其它 \(f\) 值的二元组集 \(S\), 每次更新将满足 \(i \in [a_{l} - a, a_{r} - a]\) 和 \(j \in [b_{l} - b, b_{r} - b]\) 的二元组从 \(S\) 中取出, 然后将它们能更新到的二元组置为 \(1\) 并加入 \(S\).&lt;/p&gt;
&lt;p&gt;对于每个二元组, 它最多加入 \(S\) 一次, 从 \(S\) 中被删除一次, 单次操作的时间复杂度为 \(\Theta(\log n)\), 于是总时间复杂度为 \(\Theta(n^{2}\log n)\), 具体实现可以对每个 \(i\) 维护它对应的 \(j\) 的集合.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;5e3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;pair&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;upd&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;insert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;al&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ar&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;br&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;al&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ar&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;bl&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;br&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;upd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;clear&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;al&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ar&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;auto&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;lower_bound&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bl&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;auto&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;upper_bound&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;br&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;auto&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;not&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;upd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;not&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;upd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;erase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;auto&lt;/span&gt; &lt;span class="nl"&gt;x&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;upd&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;insert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>24 高考新 I 卷数学 19(3)</title><link>https://sichen-wang.github.io/blog/24-%E9%AB%98%E8%80%83%E6%96%B0-i-%E5%8D%B7%E6%95%B0%E5%AD%A6-193/</link><pubDate>Sat, 08 Jun 2024 16:03:33 +0000</pubDate><guid>https://sichen-wang.github.io/blog/24-%E9%AB%98%E8%80%83%E6%96%B0-i-%E5%8D%B7%E6%95%B0%E5%AD%A6-193/</guid><description>&lt;p&gt;对 \(m = 1, 2\), 取几组合法 \((i, j)\) 即证.&lt;/p&gt;
&lt;p&gt;对 \(m \geqslant 3\), 设 \(f_{m}\) 表示 \(a_{1 \sim 4m + 2}\) 中能取出的合法数对数量.&lt;/p&gt;
&lt;p&gt;注意到 \(a_{1 \sim 4m + 2}\) 中任意长度为 \(4l + 2\) 的子区间对应的答案均为 \(f_{l}\), 则取分界点 \(p_{1} = 4, p_{2} = 4m - 2\) 进行容斥.&lt;/p&gt;
\[
\begin{aligned}
f_m &amp;= f_m[i \not\in [1, p_1]~\textrm{or}~j \not\in [p_2 + 1, 4m + 2]] + f_m[i \in [1, p_1]~\textrm{and}~j \in [p_2 + 1, 4m + 2]]\\
&amp;= f_m[i, j \in [p_1 + 1, 4m + 2]] + f_m[i, j \in [1, p_2]] - f_m[i, j \in [p_1 + 1, p_2]] \\
&amp;~~~~+ f_m[i \in [1, p_1]~\textrm{and}~j \in [p_2 + 1, 4m + 2]]\\
&amp;= 2f_{m - 1} - f_{m - 2} + f_m[i \in [1, p_1]~\textrm{and}~j \in [p_2 + 1, 4m + 2]]
\end{aligned}
\]&lt;p&gt;考虑求 \(f_{m}[i \in [1, p_{1}]\ \textrm{and}\ j \in [p_{2} + 1, 4m + 2]]\) 的下界.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;显然 \((i, j) = (1, 4m + 2)\) 是合法的.&lt;/li&gt;
&lt;li&gt;对于 \((i, j) = (2, 4m + 1)\), 当 \(m = 3\) 时其合法性在第 \((2)\) 问中已证. 当 \(m \gt 3\) 时, 从前后各取 \(2\) 个下标公差为 \(2\) 的子序列, 注意到只看子区间 \([9, 4m - 6]\), 其中 \(10\) 和 \(4m - 7\) 已经被取过了, 于是变成了等价的子问题. 故归纳可证 \((i, j) = (2, 4m + 1)\) 是合法的.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;此时有 \(f_{m}[i \in [1, p_{1}]\ \textrm{and}\ j \in [p_{2} + 1, 4m + 2]] \geqslant 2\), 于是 \(f_{m} \geqslant 2f_{m - 1} - f_{m - 2} + 2\).&lt;/p&gt;
&lt;p&gt;取 \(f^{\prime}_{m} = 2f^{\prime}_{m - 1} - f^{\prime}_{m - 2} + 2 \leqslant f_{m}, f^{\prime}_{1} = 3, f^{\prime}_{2} = 7\).&lt;/p&gt;
&lt;p&gt;变换得 \((f^{\prime}_{m} - f^{\prime}_{m - 1}) = (f^{\prime}_{m - 1} - f^{\prime}_{m - 2}) + 2\), 由熟知的方法解得 \(f_{m} \geqslant f^{\prime}_{m} = m^{2} + m + 1\).&lt;/p&gt;
&lt;p&gt;于是 \(P_{m} = \frac{f_{m}}{\binom{4m + 2}{2}} \geqslant \frac{f^{\prime}_{m}}{\binom{4m + 2}{2}} = \frac{m^{2} + m + 1}{8m^{2} + 6m + 1} \gt \frac{1}{8}\), 原命题得证.&lt;/p&gt;</description></item><item><title>评论(2)</title><link>https://sichen-wang.github.io/blog/%E8%AF%84%E8%AE%BA2/</link><pubDate>Tue, 30 Apr 2024 00:00:00 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E8%AF%84%E8%AE%BA2/</guid><description>&lt;p&gt;最近发生了一件事:“某体育生在跑步考试快结束时摔断了腿, 但仍艰难地爬过了终点.” 我看到各路媒体铺天盖地的评价: “这才是真正的体育精神.” 当第 4 次看到持此观点的评论时, 我意识到: 这个社会的价值观病了.&lt;/p&gt;
&lt;p&gt;此病之表征为, 这个社会变得特别善于歌颂苦难, 其中的逻辑并不难以理解: 努力到成功的过程往往过长, 人们需要一个足够有冲击力的标志来刻画这个过程. 出于中国人骨子里的谦逊, 这个标志不能是捧起奖杯那刻的欣喜若狂, 只能是遍体鳞伤时的绝望与无助.&lt;/p&gt;
&lt;p&gt;但, 这真的对吗? 我以为, 苦难从来都不应当作为成长的一部分. 苦难就是苦难, 哪怕我因此获益良多, 那也是因为我在苦难面前保持了一颗学徒的心, 我的收获不来自于苦难. 若有一位良师引导, 我能学到的恐怕远胜于此.&lt;/p&gt;
&lt;p&gt;我可以忍受苦难, 但并不代表我热爱苦难. 诚然, 走向终点的路上会遇到很多挫折, 但他不应当被提取出来, 作为我所热爱之事物的标志被反复歌颂. 这其中的逻辑是: 我能为了自己的理想忍受一定程度的苦难, 但如果没有这些苦难, 我会更快达到理想的终点. 所以这些苦难应当被定义为坏的, 而非值得歌颂的. 上天为我降下苦难, 从来都不是因为祂想历练我, 而是因为祂恐惧一番风顺的我.&lt;/p&gt;
&lt;p&gt;若是认为别人经历苦难又被广为宣传, 而我能从中获益, 该观点则更是荒谬. 我不需要看到别人比我更累, 我也不会因此而感到开心, 我会难过: 我所追寻的理想, 很难说其中没有崇高的一小部分, 是希望这个世界变得更好.&lt;/p&gt;
&lt;p&gt;所以,&lt;br&gt;
如果我们累了，&lt;br&gt;
那就应该去休息。&lt;/p&gt;</description></item><item><title>关于「顺序遍历随机排列取尽可能大的值」问题的一些思考</title><link>https://sichen-wang.github.io/blog/%E5%85%B3%E4%BA%8E%E9%A1%BA%E5%BA%8F%E9%81%8D%E5%8E%86%E9%9A%8F%E6%9C%BA%E6%8E%92%E5%88%97%E5%8F%96%E5%B0%BD%E5%8F%AF%E8%83%BD%E5%A4%A7%E7%9A%84%E5%80%BC%E9%97%AE%E9%A2%98%E7%9A%84%E4%B8%80%E4%BA%9B%E6%80%9D%E8%80%83/</link><pubDate>Thu, 11 Apr 2024 17:23:40 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E5%85%B3%E4%BA%8E%E9%A1%BA%E5%BA%8F%E9%81%8D%E5%8E%86%E9%9A%8F%E6%9C%BA%E6%8E%92%E5%88%97%E5%8F%96%E5%B0%BD%E5%8F%AF%E8%83%BD%E5%A4%A7%E7%9A%84%E5%80%BC%E9%97%AE%E9%A2%98%E7%9A%84%E4%B8%80%E4%BA%9B%E6%80%9D%E8%80%83/</guid><description>&lt;p&gt;一个广为流传的结论是: 从前往后遍历 \(37\%\) 的元素(事实上是 \(\frac{1}{e}\)), 称其中最大的为 \(\max\), 继续往后遍历, 一旦一个元素大于 \(\max\) 就立刻选择, 找不到则选最后一个元素 .&lt;/p&gt;
&lt;p&gt;写了一个程序来验证这个结论:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;random&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;draw&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="c1"&gt;# n, t = 1000, 100000&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;aveval&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;maxval&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;calcave&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Max&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="n"&gt;Max&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Max&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Max&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;calcmax&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Max&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="n"&gt;Max&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Max&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Max&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shuffle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="n"&gt;aveval&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;calcave&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="n"&gt;maxval&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;calcmax&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;aveval&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;aveval&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;maxval&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;maxval&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt; &lt;span class="n"&gt;aveval&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt; &lt;span class="n"&gt;maxval&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;aveval&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;aveval&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;or&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;(&lt;/span&gt;&lt;span class="si"&gt;{:.1f}&lt;/span&gt;&lt;span class="s2"&gt;%, &lt;/span&gt;&lt;span class="si"&gt;{:.2f}&lt;/span&gt;&lt;span class="s2"&gt;)&amp;#34;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;r&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;maxval&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;maxval&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;or&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;(&lt;/span&gt;&lt;span class="si"&gt;{:.1f}&lt;/span&gt;&lt;span class="s2"&gt;%, &lt;/span&gt;&lt;span class="si"&gt;{:.2f}&lt;/span&gt;&lt;span class="s2"&gt;)&amp;#34;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;r&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;show&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;得到结果如下:&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="https://s21.ax1x.com/2024/04/11/pFXdXyd.png" alt="pFXdXyd.png" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;其中蓝线为这种策略取到的元素大小期望除以 \(n\) 的值, 也即取到的元素占最大值百分比的期望. 橙线表示取到最大值的概率. 横坐标为观察的元素数量占总元素数量的比例.&lt;/p&gt;
&lt;p&gt;可以发现, 虽然观察 \(37.1\%\) 的元素有最大的概率取到最大值, 但只观察 \(3.1\%\) 的元素就出手获得的元素期望是最大的, 这启发我们, 直接取某一个位置之后的第一个前缀最大值是否有些呆板了呢? 我们是否可以做一些更加动态的决策呢?&lt;/p&gt;
&lt;p&gt;接下来会尝试训练一个神经网络用以决策, 未完待续……&lt;/p&gt;</description></item><item><title>一类贝叶斯定理相关积分的变换技巧</title><link>https://sichen-wang.github.io/blog/%E4%B8%80%E7%B1%BB%E8%B4%9D%E5%8F%B6%E6%96%AF%E5%AE%9A%E7%90%86%E7%9B%B8%E5%85%B3%E7%A7%AF%E5%88%86%E7%9A%84%E5%8F%98%E6%8D%A2%E6%8A%80%E5%B7%A7/</link><pubDate>Tue, 09 Apr 2024 16:43:16 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E4%B8%80%E7%B1%BB%E8%B4%9D%E5%8F%B6%E6%96%AF%E5%AE%9A%E7%90%86%E7%9B%B8%E5%85%B3%E7%A7%AF%E5%88%86%E7%9A%84%E5%8F%98%E6%8D%A2%E6%8A%80%E5%B7%A7/</guid><description>&lt;p&gt;考虑非负实数域上某可用条件概率刻画的期望：&lt;/p&gt;
\[
E(x) = \int_{0}^{+\infty} xP(t = x|q) \mathrm{d}x
\]&lt;p&gt;其中 \(q\) 为已知，且 \(P(q|t = x)\) 是可用初等函数刻画的，于是：&lt;/p&gt;
&lt;p&gt;考虑贝叶斯定理：&lt;/p&gt;
\[
E(x) = \int_{0}^{+\infty} x\frac{P(q|t = x)P(t = x)}{P(q)} \mathrm{d}x
\]&lt;p&gt;观察发现对 \(x\) 微分本质上就是在枚举每个 \(t = x\) 的情况，于是 \(P(t = x)\) 已经被 \(\mathrm{d}x\) 包含，可以看作 \(1\)，故&lt;/p&gt;
\[
E(x) = \int_{0}^{+\infty} x\frac{P(q|t = x)}{P(q)} \mathrm{d}x
\]&lt;p&gt;大多数情况下，哪怕 \(P(q)\) 可以用初等函数刻画，整个式子也会难以化简，于是考虑拆 \(P(q)\)：&lt;/p&gt;
\[
E(x) = \int_{0}^{+\infty} x\frac{P(q|t = x)}{\int_{0}^{+\infty} P(q|t = y) \mathrm{d}y } \mathrm{d}x
\]&lt;p&gt;整理可得&lt;/p&gt;
\[
E(x) = \frac{\int_{0}^{+\infty} xP(q|t = x) \mathrm{d}x}{\int_{0}^{+\infty} P(q|t = x) \mathrm{d}x }
\]&lt;p&gt;设 \(P(q|t = x) = f(x)\)，其中 \(f(x)\) 是初等函数，又设 \(\delta\) 为积分算子（即 \([\delta f(x)]' = f(x)\) ），即得&lt;/p&gt;
\[
E(x) = \frac{\int_{0}^{+\infty} xf(x) \mathrm{d}x}{\int_{0}^{+\infty} f(x) \mathrm{d}x } = \lim_{\varepsilon \to 0^+}^{m \to +\infty}\frac{\delta mf(m) - \delta \varepsilon f(\varepsilon)}{\delta f(m) - \delta f(\varepsilon)}
\]</description></item><item><title>整除性校验的本质</title><link>https://sichen-wang.github.io/blog/%E6%95%B4%E9%99%A4%E6%80%A7%E6%A0%A1%E9%AA%8C%E7%9A%84%E6%9C%AC%E8%B4%A8/</link><pubDate>Tue, 09 Apr 2024 16:43:16 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E6%95%B4%E9%99%A4%E6%80%A7%E6%A0%A1%E9%AA%8C%E7%9A%84%E6%9C%AC%E8%B4%A8/</guid><description>&lt;p&gt;从小学开始我们就知道, 一个数能被 \(3\) 整除当且仅当其各位数字之和能被 \(3\) 整除. 一个数能被 \(4\) 整除, 当且仅当其最后 \(2\) 位数能被 \(4\) 整除. 一个数能被 \(11\) 整除, 当且仅当其奇数位减去偶数位数字之和能被 \(11\) 整除(个位数记为第 \(1\) 位).&lt;/p&gt;
&lt;p&gt;长大一点后, 我们可以用数学语言来刻画这个规律 :&lt;/p&gt;
\[
\begin{cases}
\overline{a_ta_{t - 1}\cdots a_2a_1} \equiv a_1 + a_2 + \cdots + a_t \pmod 3 \\
\overline{a_ta_{t - 1}\cdots a_2a_1} \equiv \overline{a_2a_2} \pmod 4 \\
\overline{a_ta_{t - 1}\cdots a_2a_1} \equiv a_1 - a_2 + a_3 - \cdots + (-1)^{t - 1} a_t \pmod {11} \\
\overline{a_ta_{t - 1}\cdots a_2a_1} \equiv \overline{a_3a_2a_1} - \overline{a_6a_5a_4} + \cdots + (-1)^{\frac{t}{3} - 1} \overline{a_ta_{t - 1}a_{t - 2}} \pmod 7
\end{cases}
\]&lt;p&gt;容易发现, 其分为 \(3\) 类 :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;第一类: \(x\) 与 \(x\) 的末 \(k\) 位在模 \(n\) 意义下同余.&lt;/li&gt;
&lt;li&gt;第二类: \(x\) 与 \(x\) 每 \(k\) 位一段求和得到的数在模 \(n\) 意义下同余.&lt;/li&gt;
&lt;li&gt;第三类: \(x\) 与 \(x\) 每 \(k\) 位一段正负交替求和得到的数在模 \(n\) 意义下同余.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;现在我们来探寻 \(b\) 进制数在模 \(n\) 意义下可以使用哪种同余化简方式(或不满足三类中任意一种).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;若存在 \(k\) 满足 \(b^{k} \equiv 0 \pmod n\), 那么 \(\overline{a_{t}a_{t - 1}\cdots a_{k + 1}00 \cdots 0} \equiv 0 \pmod n\), 则 \(\overline{a_{t}a_{t - 1}\cdots a_{2}a_{1}} \equiv \overline{a_{k}a_{k - 1}\cdots a_{2}a_{1}} \pmod n\), 可以使用第一类化简方式.&lt;/li&gt;
&lt;li&gt;若存在 \(k\) 满足 \(b^{k} \equiv 1 \pmod n\), 那么 \(\overline{a_{t}a_{t - 1}\cdots a_{k + 1}00 \cdots 0} \equiv \overline{a_{t}a_{t - 1}\cdots a_{k + 1}} \pmod n\), 则 \(\overline{a_{t}a_{t - 1}\cdots a_{2}a_{1}} \equiv \overline{a_{k}a_{k - 1}\cdots a_{1}} + \overline{a_{2k}a_{2k - 1}\cdots a_{k + 1}} + \cdots \pmod n\), 可以使用第二类化简方式.&lt;/li&gt;
&lt;li&gt;若存在 \(k\) 满足 \(b^{k} \equiv -1 \pmod n\), 那么 \(\overline{a_{pk}a_{pk - 1}\cdots a_{(p - 1)k + 1} 00\cdots 0} \equiv (-1)^{p}\overline{a_{pk}a_{pk - 1}\cdots a_{(p - 1)k + 1}}\), 则 \(\overline{a_{t}a_{t - 1}\cdots a_{2}a_{1}} \equiv \overline{a_{k}a_{k - 1}\cdots a_{1}} - \overline{a_{2k}a_{2k - 1}\cdots a_{k + 1}} + \cdots \pmod n\), 可以使用第三类化简方式.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;于是想找到 \(b\) 进制数在模 \(n\) 意义下的化简方式, 只需要找到最小的 \(k\) 满足 \(b^{k} \equiv 0\ \textrm{or}\ 1\ \textrm{or}- 1\) 即对应第 \(1/2/3\) 类化简方式. 若直到 \(k\) 等于 \(b\) 的幂在模 \(n\) 意义下的循环节长度仍未找到满足条件的 \(k\), 则 \(b\) 进制数在模 \(n\) 意义下不能使用这 \(3\) 种方式化简.&lt;/p&gt;
&lt;p&gt;一种找最小 \(k\) 的代码实现如下 :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;unordered_map&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;vis&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;%=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;vis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;kind = %d, k = %d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;clear&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>2024 年 2~3 月趣题记录</title><link>https://sichen-wang.github.io/blog/2024-%E5%B9%B4-2~3-%E6%9C%88%E8%B6%A3%E9%A2%98%E8%AE%B0%E5%BD%95/</link><pubDate>Tue, 09 Apr 2024 16:37:05 +0000</pubDate><guid>https://sichen-wang.github.io/blog/2024-%E5%B9%B4-2~3-%E6%9C%88%E8%B6%A3%E9%A2%98%E8%AE%B0%E5%BD%95/</guid><description>&lt;h1 id="cf1929d-1974"&gt;
(*1974)&lt;/h1&gt;
&lt;p&gt;给定一颗 \(n\) 个点的树, 求黑白染色的方案数, 使任意一条路径上的黑点数量不超过 \(2\).&lt;/p&gt;
&lt;p&gt;\(2 \leqslant n \leqslant 3 \times 10^{5}, \mathrm{mod} = 998244353\).&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;最自然的想法肯定是设 \(f_{u, 0/1/2}\) 表示考虑以 \(u\) 为根的子树, 所有从 \(u\) 到叶子的链中, 包含黑点数量最大的恰好为 \(0/1/2\) 的方案数. 转移考虑 \(u\) 是否为黑点进行分类讨论即可.&lt;/p&gt;
&lt;p&gt;但出题人给出了一种另辟蹊径的做法, 设 \(f_{u}\) 表示考虑以 \(u\) 为根的子树, 所有从 \(u\) 到叶子的链中, 包含黑点数量最大的&lt;strong&gt;恰好&lt;/strong&gt;为 \(1\) 的方案数. 设 \(v \in son_{u}\), 则所有 \(v\) 的染色方案互不干扰, 故有 \(f_{u} = \prod (f_{v} + 1)\).&lt;/p&gt;
&lt;p&gt;考虑如何计算被漏掉的, 存在黑色点对 \((u, v)\) 满足 \(u\) 是 \(v\) 的祖先的情况. 我们发现如果枚举 \(u\), \(\sum_{v \in son_{u}} f_{v}\) 即为点对 \((u, v)\) 的数量, 若枚举所有 \(u\), 则 \(2 \sim n\) 号结点恰好均被计算一次. 再加上不存在黑色点对 \((u, v)\) 满足 \(u\) 是 \(v\) 的祖先的情况 \(f_{1} + 1\), 答案即为 \(1 + \sum f_{u}\).&lt;/p&gt;
&lt;p&gt;该算法时间复杂度 \(\Theta(n)\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;3e5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;998244353&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vector&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;dfs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nl"&gt;v&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dfs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ios&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sync_with_stdio&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;cout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dfs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;clear&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id="cf1929e-2414"&gt;
(*2414)&lt;/h1&gt;
&lt;p&gt;有一棵 \(n\) 个顶点的树, 对于其上 \(k\) 对顶点 \((a_{1}, b_{1}), \ldots, (a_{k}, b_{k})\) 中的任意一对, 在顶点 \(a_{i}\) 与 \(b_{i}\) 之间的简单路径上至少有一条边为黑色. 为了满足该条件, 求树上最少有多少条黑色边.&lt;/p&gt;
&lt;p&gt;\(n \leqslant 10^{5}, k \leqslant 20\).&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;注意到选择的边一定是至少一条路径上深度最浅的边&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;证明: 选深度最浅的边更劣, 当且仅当可以构造出两条路径 \(L_{1},L_{2}\) 在某条边 \(e\) 处相交, 且满足:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;\(e\) 不是 \(L_{1}, L_{2}\) 最浅的边.&lt;/li&gt;
&lt;li&gt;\(e\) 的父边不同时属于 \(L_{1}, L_{2}\).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;否则 \(e\) 用其父边替换一定不劣.&lt;/p&gt;
&lt;p&gt;但是, 若 \(e\) 不是 \(L\) 最浅的边, 则 \(e\) 的父边一定属于 \(L\), 故 \(e\) 的父边同时属于 \(L_{1}, L_{2}\), 产生矛盾, 故原命题得证.&lt;/p&gt;
&lt;p&gt;因此我们发现, 该树中可能成为答案的边最多 \(2k\) 条, 且每条边 \(e\) 分别对应了一个集合 \(S\), 满足 \(\forall L \in S, e \in L\).&lt;/p&gt;
&lt;p&gt;考虑记 \(T_{i}\) 表示第 \(i\) 条有可能成为答案的边属于哪些路径, \(f_{S}\) 表示将 \(S\) 表示的路径全部覆盖至少需要选择多少条边, 转移时枚举选择哪条边加入即可, 方程为 \(f_{S | T_{i}} = \min\{f_{S} + 1\}\).&lt;/p&gt;
&lt;p&gt;总时间复杂度 \(\Theta(nk + k2^{k})\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;K&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;K&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;K&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;K&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vector&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;map&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;pair&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;dfs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nl"&gt;v&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;dfs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ios&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sync_with_stdio&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;cout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dfs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;|=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;|=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;|=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;|=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;|=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;|=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;|=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;|=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]){&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;|=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;|=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;|=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;make_pair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;|=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;lim&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;lim&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e9&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;lim&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;auto&lt;/span&gt; &lt;span class="nl"&gt;it&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;lim&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;clear&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;clear&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id="abc341g-2208"&gt;
(*2208)&lt;/h1&gt;
&lt;p&gt;给定长度为 \(n\) 的序列 \(\{a_{n}\}\), 对每个整数 \(k \in [1, n]\), 求 \(\max_{r \geqslant k} \left\{\frac{1}{r - k + 1}\sum_{i = k}^{r} a_{i}\right\}\).&lt;/p&gt;
&lt;p&gt;\(n \leqslant 2 \times 10^{5}, \forall i, a_{i} \leqslant 10^{6}\).&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;考虑将平均数转化为直线的斜率, 构造平面上如下 \(n + 1\) 个点 :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;编号为 \(0\) 的点为 \((0, 0)\).&lt;/li&gt;
&lt;li&gt;编号为 \(i (i \in [1, n] \cup \mathbb{Z})\) 的点为 \((i, a_{1} + a_{2} + \cdots + a_{i})\).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;注意到 \(l \to r\) 的平均数即为点 \(l - 1\) 和 \(r\) 之间的斜率, 于是从右往左用单调栈维护一个上凸壳转移即可.&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n)\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;2e5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ios&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sync_with_stdio&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;cout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;fixed&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;setprecision&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id="arc172e-2358"&gt;
(*2358)&lt;/h1&gt;
&lt;p&gt;有 \(q\) 次询问, 每次询问给定正整数 \(x\), 求最小的 \(n\) 满足 \(n^{n} \equiv x \pmod p\).&lt;/p&gt;
&lt;p&gt;\(q \leqslant 10^{4}, 1 \leqslant x \lt p = 10^{9}, 2, 5 \nmid x\).&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;引理&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;设集合 \(U_{k}\) 为 \(10^{k} (k \in \mathbb{Z^{+}})\) 的简化剩余系, 命题 \(P_{k} : \{n^{n} \mid n \in U_{k}\} = U_{k}\) 成立.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;证明&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;对于 \(P_{1}\), \(U_{1} = \{1, 3, 7, 9\}\). 注意到 \(1^{1} \equiv 1, 3^{3} \equiv 7, 7^{7} \equiv 3, 9^{9} \equiv 9 \pmod {10}\), 于是 \(P_{1}\) 成立.&lt;/p&gt;
&lt;p&gt;对于 \(P_{2}\), 与 \(P_{1}\) 类似的, 同样注意到 \(n \in U_{2}\) 时, \(n\) 与 \(n^{n}\) 在模 \(10^{2}\) 意义下一一对应, 于是 \(P_{2}\) 成立.&lt;/p&gt;
&lt;p&gt;假设 \(P_{k} (k \geqslant 2)\) 成立, 即 \(\{n^{n} \mid n \in U_{k}\} = U_{k}\).&lt;/p&gt;
&lt;p&gt;注意到二项式定理 : \((a + b)^{k} = \sum_{i = 0}^{k} \binom{k}{i} a^{i} b^{k - i}\), 代入得&lt;/p&gt;
\[
(n+t \cdot10 ^ k)^{n+t \cdot10 ^ k} = \sum _ {i = 0} ^ {n+t \cdot10 ^ k} \dbinom{n+t \cdot10 ^ k}{i} (t \cdot10 ^ k) ^ i n ^ {n+t \cdot10 ^ k - i}
\]&lt;p&gt;注意到 \((t \cdot10^{k})^{2} \equiv 0 \pmod {10^{k + 1}}\), 于是&lt;/p&gt;
\[
\begin{aligned}
&amp;\quad\sum _ {i = 0} ^ {n+t \cdot10 ^ k} \dbinom{n+t \cdot10 ^ k}{i} (t \cdot10 ^ k) ^ i n ^ {n+t \cdot10 ^ k - i}\\
&amp;\equiv n ^ {n+t \cdot10 ^ k} + (n+t \cdot10 ^ k) \cdot n ^ {n+t \cdot10 ^ k - 1} \cdot t \cdot10 ^ k \pmod {10 ^ {k + 1}} \\
&amp;\equiv n ^ {n+t \cdot10 ^ k} + n ^ {n+t \cdot10 ^ k} \cdot t \cdot10 ^ k \pmod {10 ^ {k + 1}} \\
&amp;\equiv (n ^ n + n ^ n \cdot t \cdot10 ^ k) (n ^ {10 ^ k}) ^ t \pmod {10 ^ {k + 1}}
\end{aligned}
\]&lt;p&gt;注意到欧拉定理 : 若 \(a \perp m\), 则 \(a^{\varphi(m)} \equiv 1 \pmod m\), 其中 \(\varphi(x)\) 表示 \([1, x]\) 中与 \(x\) 互质的整数数量.&lt;/p&gt;
&lt;p&gt;因为 \(\varphi(2^{k + 1}) = 2^{k}\), 且 \(n \perp 2^{k + 1}\), 故 \(n^{2^{k}} \equiv 1 \pmod {2^{k + 1}}\), 进而 \(n^{10^{k}}\equiv (n^{2^{k}})^{5^{k}} \equiv 1 \pmod {2^{k + 1}}\). 因为 \(\varphi (5^{k + 1}) = 4 \times 5^{k}\), 且 \(n \perp 5^{k + 1}\), 故 \(n^{4 \times 5^{k}} \equiv 1 \pmod {5^{k + 1}}\), 进而 \(n^{10^{k}} \equiv (n^{4 \times 5^{k}})^{2^{k - 2}} \equiv 1 \pmod {5^{k + 1}}\). 又因为 \(2^{k + 1} \perp 5^{k + 1}\), 因此 \(n^{10^{k}} \equiv 1 \pmod {10^{k + 1}}\). 代入得&lt;/p&gt;
\[
(n ^ n + n ^ n \cdot t \cdot10 ^ k) (n ^ {10 ^ k}) ^ t \equiv n ^ n \cdot (t \cdot 10 ^ k + 1) \pmod {10 ^ {k + 1}}
\]&lt;p&gt;于是 \(\{n^{n} \mid n \in U_{k + 1}\}\) 中的每个数 \((n+t \cdot10^{k})^{n+t \cdot10^{k}} \equiv n^{n} \cdot (t \cdot 10^{k} + 1) \pmod {10^{k + 1}}\).&lt;/p&gt;
&lt;p&gt;假设存在 \(t_{i} \not= t_{j}\), 满足 \(n^{n} (t_{i} \cdot 10^{k} + 1) \equiv n^{n} (t_{j} \cdot 10^{k} + 1) \pmod {10^{k + 1}}\), 因为 \(n^{n} \perp 10^{k + 1}\), 所以 \(n^{n}\) 存在逆元(可除), 故解得 \(t_{i} = t_{j}\), 矛盾. 于是 \(\forall i \not= j, n^{n} (i \cdot 10^{k} + 1) \not\equiv n^{n} (j \cdot 10^{k} + 1) \pmod {10^{k + 1}}\).&lt;/p&gt;
&lt;p&gt;于是 \(\{n^{n} \mid n \in U_{k + 1}\}\) 是个不重集得证, 即 \(\textrm{card}\{n^{n} \mid n \in U_{k + 1}\} = U_{k + 1}\).&lt;/p&gt;
&lt;p&gt;因为我们构造 \(n^{n}\) 构成的集合的方式为, 令其尾数为 \(\{1, 3, 7, 9\}\) 其中之一, 不断向首位前添加 \(\{0, 1, \cdots, 9\}\), 于是 \(n^{n}\) 的尾数一定是 \(\{1, 3, 7, 9\}\) 其中之一. 又因为 \(U_{k + 1}\) 包含了所有小于 \(10^{k + 1}\) 且尾数为 \(\{1, 3, 7, 9\}\) 其中之一的正整数, 所以 \(\{n^{n} \mid n \in U_{k + 1}\} \subseteq U_{k + 1}\).&lt;/p&gt;
&lt;p&gt;综上, \(P_{k} : \{n^{n} \mid n \in U_{k + 1}\} = U_{k + 1}\) 也即 \(P_{k + 1}\) 得证.&lt;/p&gt;
&lt;p&gt;归纳可证原命题.&lt;/p&gt;
&lt;p&gt;回到原问题, 显然 \(n^{n} \to x\) 的映射是可以 \(\Theta(\log n)\) 确定的, 于是我们考虑一位位确定 \(x \to n\) 的映射.&lt;/p&gt;
&lt;p&gt;对于最后两位, 可以直接枚举 \(n\) 检验 \(n^{n} \equiv x \pmod {100}\) 是否成立.&lt;/p&gt;
&lt;p&gt;假设后 \(k\) 位已经确定, 我们有 \(n^{n} \equiv x \pmod {10^{k}}\), 且 \((t \cdot 10^{k} + n)^{t \cdot 10^{k} + n} \equiv x \pmod {x^{k + 1}}\) 对且仅对一个 \(t \in \{0, 1, \cdots, 9\}\) 成立, 于是可以枚举 \(t\) 检验是否成立.&lt;/p&gt;
&lt;p&gt;综上我们找到了一个 \(\Theta(k^{2})\) 单次查询 \(x \to n\) 的映射满足 \(n^{n} \equiv x \pmod {x^{k}}\) 的算法.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Pow&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;99&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id="cf1864f-2415"&gt;
(*2415)&lt;/h1&gt;
&lt;p&gt;存在一个长度为 \(n\) 的整数序列 \(\{a_{n}\}\), 有 \(q\) 个独立的查询, 每次给出 \(l, r\).&lt;/p&gt;
&lt;p&gt;求最小的操作次数 \(m\), 将&lt;strong&gt;值&lt;/strong&gt;在 \([l, r]\) 内的所有数字变成 \(0\). 单次操作被定义为 :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;选择一个区间 \([x, y]\), 满足这个区间与之前的所有区间不相交或包含或被包含于之前的某个区间.&lt;/li&gt;
&lt;li&gt;选择一个非负整数 \(z\), 将区间 \([x, y]\) 中的所有数减去 \(z\).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;\(n, q \leqslant 10^{6}, \forall i, 1 \leqslant a_{i} \leqslant n\).&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;首先, 对于询问 \(l, r\), 我们可以只考虑满足 \(a_{i} \in [l, r]\) 的数.&lt;/p&gt;
&lt;p&gt;注意到我们每次必将至少一个数减成 \(0\), 若这个数不是序列中的非 \(0\) 最小值 \(a_{p}\), 那么\(a_{p}\)之后还是要单独再减一次, 于是取 \(z = a_{p}\) 是不劣的. 另外, 将 \(a_{p}\) 置为 \(0\) 的同时给以 \(0\) 划分的联通区间内所有的数减去 \(z\) 一定是不劣的. 减完后, 序列又以 \(p\) 为分界点被划分为两个区间分别考虑.&lt;/p&gt;
&lt;p&gt;对于朴素的策略, 每次只删一个数, 我们发现所需操作次数即为值在 \([l, r]\) 之间的元素数量 \(\ell\). 而若采取上述策略, 两个数 \(a_{i}, a_{j}\) 可能同时被删, 当且仅当 \(\forall k \in [i + 1, j - 1], a_{k} \geqslant a_{i} = a_{j}\ \textrm{or}\ a_{k} \lt l\), 记满足该条件的二元组 \((i, j)\) 数量为 \(\tau\), 最终所需操作次数即为 \(\ell - \tau\).&lt;/p&gt;
&lt;p&gt;考虑将询问按 \(r\) 排序, 从小到大加入数, 那 \(\exists k \in [i + 1, j - 1], a_{k} \geqslant a_{i} = a_{j}\) 就不可能成立了, 于是仅需考虑 \(a_{k} \lt l\), 也即 \(\max_{k \in [i + 1, j - 1]} \lt l\). 这个是好维护的, 只需要一棵支持单点修改, 区间查询最大值的线段树.&lt;/p&gt;
&lt;p&gt;而对于 \(l\) 的查询, 可以将线段树上查出的最大值插入值域树状数组, 查询小于 \(l\) 的数有多少个即为 \(\tau\). 注意, 由于我们只想求值域在 \([l, r]\) 中数对应的最大值小于 \(l\) 的数量, 所以要减去 \([1, l - 1]\) 中数对应的最大值小于 \(l\) 的数量, 可以发现就是 \([1, l - 1]\) 中数的数量减去不同的小于 \(l\) 的数的数量. 于是最终每个询问的答案就是已经插入线段树中数的数量减去当前树状数组中 \(1 \sim l - 1\) 的值, 再减去本质不同的小于 \(l\) 的数的数量.&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n \log n)\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e6&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dif&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vector&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;pair&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pair&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;ST&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="cp"&gt;#define ls (p &amp;lt;&amp;lt; 1)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="cp"&gt;#define rs (p &amp;lt;&amp;lt; 1 | 1)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Max&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Build&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Max&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Modify&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Max&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;Modify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Modify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Max&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Max&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;Max&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Query&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Max&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;BIT&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="cp"&gt;#define lowbit(x) (x &amp;amp; (-x))
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(;&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;lowbit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Query&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(;&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="n"&gt;lowbit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ios&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sync_with_stdio&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;cout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;dif&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;dif&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;dif&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ST&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;empty&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;BIT&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ST&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nl"&gt;i&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;ST&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Modify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;BIT&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;dif&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id="arc172d-2936"&gt;
(*2936)&lt;/h1&gt;
&lt;p&gt;给定 \(n\) 和 \(\frac{n(n - 1)}{2}\) 组条件 \((a_{i}, b_{i})\), 要求在 \(n\) 维空间中放置 \(n\) 个坐标在 \([0, 10^{8}]\) 内的整点, 满足 \(\textrm{dis}(p_{a_{i}}, p_{b_{i}})\) 按照给出条件的顺序从小到大排序.&lt;/p&gt;
&lt;p&gt;\(3 \leqslant n \leqslant 20\).&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;考虑先构造任意两点之间距离相等, 再细微调整使其满足条件.&lt;/p&gt;
&lt;p&gt;不妨令&lt;/p&gt;
\[
\begin{pmatrix}
p_1 = [1, 0, 0, \cdots, 0] \\
p_2 = [0, 1, 0, \cdots, 0] \\
\cdots \\
p_n = [0, 0, 0, \cdots, 1] \\
\end{pmatrix}
\]&lt;p&gt;这样就能使任意两点之间距离为 \(\sqrt2\), 然后给每个点的每个维度加上一个极小量&lt;/p&gt;
\[
\begin{pmatrix}
p_1 = [1 + \varepsilon_{1, 1},\varepsilon_{1, 2} , \varepsilon_{1, 3}, \cdots, \varepsilon_{1, n}] \\
p_2 = [\varepsilon_{2, 1}, 1 + \varepsilon_{2, 2},\varepsilon_{2, 3} , \cdots, \varepsilon_{3, 3}] \\
\cdots \\
p_n = [\varepsilon_{n, 1}, \varepsilon_{n, 2},\varepsilon_{n, 3} , \cdots, 1 + \varepsilon_{n, n}] \\
\end{pmatrix}
\]&lt;p&gt;此时两点距离为&lt;/p&gt;
\[
\textrm{dis} ^ 2(p_i, p_j) = \sum_{k \not= i, j} (\varepsilon_{i, k} - \varepsilon_{j, k}) ^ 2 + (1 + \varepsilon_{i, i} - \varepsilon_{j, i}) ^ 2 + (\varepsilon_{i, j} - 1 - \varepsilon_{j, j}) ^ 2
\]&lt;p&gt;注意到二阶小量对构造结果的影响很小, 于是消去, 得&lt;/p&gt;
\[
\textrm{dis}(p_i, p_j) = \sqrt{1 + \varepsilon_{i, i} + \varepsilon_{j, j} - \varepsilon_{i, j} - \varepsilon_{j, i}} \cdot \sqrt2
\]&lt;p&gt;我们不妨设 \(i \lt j\) 且 \(\varepsilon_{i, i}, \varepsilon_{j, j}, \varepsilon_{j, i} = 0\), 则原命题转化为&lt;/p&gt;
\[
\sqrt{1 - \varepsilon_{a_1, b_1}} \lt \sqrt{1 - \varepsilon_{a_2, b_2}} \lt \cdots \lt \sqrt{1 - \varepsilon_{a_n, b_n}}
\]&lt;p&gt;将坐标等比例放大 \(L\) 倍, 可设 \(\varepsilon_{a_{i}, b_{i}}\) 为 \(-i\), 考虑到坐标不能为负数, 于是再将所有点的坐标加上 \(l\).&lt;/p&gt;
&lt;p&gt;此题可取 \(L = 9 \times 10^{7}, l = \frac{n(n - 1)}{2}\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;9e7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d%c&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="s"&gt;&amp;#34; &lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id="cf1905e-2484"&gt;
(*2484)&lt;/h1&gt;
&lt;p&gt;递归定义长度为 \(n\) 的线段树. 根节点为 \(1\), 代表区间 \([1, n]\). 若一个结点 \(p\) 代表的区间为 \([l, r]\), 那么当且仅当 \(l \not= r\) 时它存在两个子节点 \(2p\) 和 \(2p + 1\), 分别代表区间 \([l, \lceil\frac{l + r}{2}\rceil]\) 和 \([\lceil\frac{l + r}{2}\rceil + 1, r]\).&lt;/p&gt;
&lt;p&gt;共 \(T\) 组询问, 每次给定 \(n\), 求长度为 \(n\) 的线段树对应的 \(\sum \textrm{LCA}(S)\), 其中 \(S\) 表示任意一个叶子节点的非空集合, \(\textrm{LCA}(S)\) 表示 \(S\) 中所有结点的最近公共祖先的编号. 答案对 \(998244353\) 取模.&lt;/p&gt;
&lt;p&gt;\(T \leqslant 10^{3}, 2 \leqslant n \leqslant 10^{18}\).&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;首先考察结点 \((p, l, r)\) 的贡献, 其作为最近公共祖先当且仅当 \(2p\) 和 \(2p + 1\) 内均至少存在一个结点被选择, 且 \([l, r]\) 之外没有结点被选择. 故其贡献为 :&lt;/p&gt;
\[
p(2 ^ {\lceil\frac{l + r}{2}\rceil - l + 1} - 1)(2 ^ {r - \lceil\frac{l + r}{2}\rceil} - 1)
\]&lt;p&gt;注意到线段树每层最多存在两种长度的区间, 且相同长度的区间被算进贡献的次数是相同的, 于是考虑合并计算. 递归时维护当前长度 \(l\) 对应的结点编号和 \(s\), 数量 \(c\) 即可, 用 &lt;code&gt;map&lt;/code&gt; 存储.&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(T\log^{2} n)\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;998244353&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;map&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Build&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;insert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="n"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="n"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Pow&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;clear&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;clear&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;clear&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;auto&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rbegin&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rend&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ly&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ly&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;lx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;lx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;lx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;lx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ly&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ly&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ly&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ly&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id="cf1923e-2044"&gt;
(*2044)&lt;/h1&gt;
&lt;p&gt;给定一棵 \(n\) 个结点的树, 每个结点有一个 \([1, n]\) 中的颜色, 求满足以下条件的路径的数量 :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;至少由 \(2\) 个结点组成.&lt;/li&gt;
&lt;li&gt;路径的起点与终点颜色相同.&lt;/li&gt;
&lt;li&gt;路径上起点和终点以外的点颜色与起点不同.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;\(n \leqslant 2 \times 10^{5}\).&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;此处给出一个优于官方 \(\Theta(n \log n)\) 做法的线性做法.&lt;/p&gt;
&lt;p&gt;考虑按 \(\rm dfs\) 序枚举树上的每个结点, 统计当前结点 \(u\) 能和前面结点构成的合法路径 \((u, v)\) 的数量. 可以发现若设 \(f\) 为 \(u\) 的祖先中最近的与 \(u\) 颜色相同的结点, 则合法的 \(v\) 可以用以下方式刻画 :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;若 \(f\) 存在则将其计入答案, 否则设 \(f = fa(1) = 0\), 不计入答案.&lt;/li&gt;
&lt;li&gt;遍历 \(u\) 至 \(f\) 路径上的每个结点 \(r\) (不含 \(u, f\)), 从 \(r\) 开始向其子树(不含包括 \(u\) 的这棵)中遍历, 遇到与 \(u\) 颜色相同的结点则停下, 并将其计入答案.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;设 \(c_{i}\) 表示若 \(u\) 的颜色为 \(i\), 能被计入答案的结点数量.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;因为以 \(u\) 为根的子树中所有想走出来的合法路径都会被 \(u\) 拦住, 所以进入子树时要将 \(c_{i}\) 设为 \(1\).&lt;/li&gt;
&lt;li&gt;因为出以 \(u\) 为根的子树时原本的答案会还原, 且 \(u\) 也是合法路径的端点, 所以出子树时要将 \(c_{i}\) 加 \(1\).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;使用这种策略遍历一遍整棵树即可算出答案.&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n)\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;2e5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;cf&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vector&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;dfs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;mark&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nl"&gt;v&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dfs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mark&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ios&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sync_with_stdio&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;cout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dfs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;clear&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;cf&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id="cf1918f-2696"&gt;
(*2696)&lt;/h1&gt;
&lt;p&gt;给定一颗 \(n\) 个结点的树, 从 \(1\) 开始在树上行走, 求走到过所有结点的最小步数.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;操作 \(1\) : 移动到相邻的结点, 花费 \(1\) 步.&lt;/li&gt;
&lt;li&gt;操作 \(2\) : 移动到 \(1\) 号结点, 无花费, 但操作 \(2\) 最多进行 \(k\) 次.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;\(2 \leqslant n \leqslant 2 \times 10^{5}, 0 \leqslant k \leqslant 10^{9}\).&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;可以发现如下性质 :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;操作 \(2\) 只会在叶子结点进行.&lt;/li&gt;
&lt;li&gt;题目等效于要求最后需要回到 \(1\) 号结点, 但操作 \(2\) 可以进行 \(k + 1\) 次.&lt;/li&gt;
&lt;li&gt;如果只使用操作 \(1\), 则每条边会经过恰好 \(2\) 次, 总共需要 \(2(n - 1)\) 步.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;考虑求操作 \(2\) 最多能节省多少步数. 假设遍历顺序已经确定下来了, 那对于其中一对访问时间相邻的叶子结点 \((u, v)\) (相邻被定义为 \(u \to v\) 的路径上不存在其它叶子结点), 如果在 \(u\) 处使用操作 \(2\), 设 \(f = \textrm{LCA}(u, v)\), 能够节省的步数为 \(\textrm{dis}(u, v) - \textrm{dis}(1, v)\), 可转化为 \(\textrm{dis}(u, f) - \textrm{dep}(f)\).&lt;/p&gt;
&lt;p&gt;考察每个非叶子结点 \(f\), 在以 \(f\) 为根的子树中如果存在某个叶节点使用了操作 \(2\), 考虑到要最大化 \(\textrm{dis}(u, f) - \textrm{dep}(f)\), 那么一定是深度最大的结点, 且它是最后一个被遍历到的. 于是对 \(f\) 的所有子节点 \(u\) 按以 \(u\) 为根的子树深度从小到大排序, 这样得出的叶节点访问顺序也即能最小化总步数的访问顺序.&lt;/p&gt;
&lt;p&gt;注意到每个叶节点的贡献是独立的, 于是计算最大的 \(\sum \textrm{dis}(u, f) - \textrm{dep}(f)\) 只需要求出前 \(k\) 大即可.&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n \log n)\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;2e5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;siz&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;son&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vector&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;leaf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;dfs1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;siz&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nl"&gt;v&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;dfs1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;siz&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;siz&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;son&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;siz&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;siz&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;son&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nl"&gt;v&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;son&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;dfs2&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;son&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;dfs2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;son&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nl"&gt;v&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;son&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;dfs2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;LCA&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]])&lt;/span&gt; &lt;span class="n"&gt;swap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nl"&gt;u&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;dis&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;LCA&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="nf"&gt;cmp&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;dfs3&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;begin&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;cmp&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nl"&gt;v&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;dfs3&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;dfs4&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;empty&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="n"&gt;leaf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nl"&gt;v&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;dfs4&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]].&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dfs1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;dfs2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;dfs3&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;dfs4&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;leaf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dis&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;leaf&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;leaf&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;dis&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;leaf&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dis&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;leaf&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;begin&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;greater&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;());&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id="arc173b-1594"&gt;
(*1594+)&lt;/h1&gt;
&lt;p&gt;给定平面上的 \(n\) 个整点, 第 \(i\) 个点坐标为 \((x_{i}, y_{i})\).&lt;/p&gt;
&lt;p&gt;问最多能用这些顶点构建多少个非退化三角形(每个点只能用一次).&lt;/p&gt;
&lt;p&gt;\(3 \leqslant n \leqslant 300, |x_{i}|, |y_{i}| \leqslant 10^{9}.\)&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;设 \(l\) 为平面上穿过点数最多的直线, 其上点数为 \(m\).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;若 \(m \geqslant n - \lfloor\frac{n}{3}\rfloor + 1\), 那么答案为 \(n - m\), 即每从 \(l\) 外取一个点, 从 \(l\) 内取两个点构成一个三角形.&lt;/li&gt;
&lt;li&gt;若 \(m \leqslant n - \lfloor\frac{n}{3}\rfloor\), 那么可以取到答案上界 \(\lfloor\frac{n}{3}\rfloor\).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;下归纳证明第二种情况的正确性, 假设对小于 \(n\) 个点的情况该结论均正确 :&lt;/p&gt;
&lt;p&gt;尝试从 \(n\) 个点中选取 \(3\) 个先构成一个三角形, 钦点其中两个点从 \(l\) 上选, 则 \(l\) 上现在的点数 \(m' = m - 2\), 由 \(m \leqslant n - \lfloor\frac{n}{3}\rfloor\) 得 \(m' = m - 2 \leqslant n - \lfloor\frac{n}{3}\rfloor - 2 = n - 3 - \lfloor\frac{n - 3}{3}\rfloor\), 可以取到 \(n - 3\) 个点的答案上界 \(\lfloor\frac{n - 3}{3}\rfloor\), 进而 \(n\) 个点的第二种情况可以取到 \(n\) 个点的答案上界 \(\lfloor\frac{n}{3}\rfloor\) 得证. 归纳得原命题得证.&lt;/p&gt;
&lt;p&gt;有这个结论, 则可以直接枚举两个点, 设过它们的直线为 \(l\) 并计算 \(m\), 时间复杂度 \(\Theta(n^{3})\), 可以通过原问题.&lt;/p&gt;
&lt;p&gt;注意到若答案不为 \(\lfloor\frac{n}{3}\rfloor\) 则 \(l\) 上的点数占总点数的 \(\frac{2}{3}\) 以上, 用类摩尔投票法的方式来统计显然是一个更聪明的做法. 在一个栈中保存我们认为在 \(l\) 上的点, 若栈大小小于 \(2\) 则将当前点加入栈, 否则判断其跟栈内元素是否在同一条直线上. 若是, 则将其入栈, 否则踢出栈内一个元素. 注意到 \(l\) 上的元素为绝对众数, 所以最终栈内留下来的元素一定是 \(l\) 上的元素(若没留下来超过 \(1\) 个元素, 则说明栈中元素代表的 \(l\) 上的点数并非绝对众数, 答案为 \(\lfloor\frac{n}{3}\rfloor\)). 特别的, 若当前栈中只剩两个元素, 则需要全部踢出, 否则一个不在 \(l\) 上的点可能永远留在栈中. 注意到所求 \(l\) 上的点数大于总点数的 \(\frac{2}{3}\), 所以哪怕每次都踢出两个元素也不会影响投票法的正确性.&lt;/p&gt;
&lt;p&gt;最后, 栈中剩下元素代表的 \(l\) 即为所求, 枚举判断一下有多少个点在 \(l\) 上即可.&lt;/p&gt;
&lt;p&gt;时间复杂度被优化到 \(\Theta(n)\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e6&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="nf"&gt;check&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="n"&gt;sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;top&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id="cf1946d-2006"&gt;
(*2006)&lt;/h1&gt;
&lt;p&gt;有一个长度为 \(n\) 的数列 \(\{a_{n}\}\) 和一个数 \(x\), 请找到最大的数\(k\), 使得可以选择一些数字对 \([l_{1}, r_{1}]\), \([l_{2}, r_{2}]\), \(\cdots\), \([l_{k}, r_{k}]\) 满足以下条件 :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;\(l_{1} = 1\), \(r_{k} = n\).&lt;/li&gt;
&lt;li&gt;对于所有 \(i\) 从 \(1\) 到 \(k\) , \(l_{i} \leqslant r_{i}\).&lt;/li&gt;
&lt;li&gt;对于所有 \(i\) 从 \(1\) 到 \(k - 1\), \(r_{i} + 1 = l_{i + 1}\).&lt;/li&gt;
&lt;li&gt;\((a_{l_{1}} \oplus a_{l_{1} + 1} \oplus \ldots \oplus a_{r_{1}}) | (a_{l_{2}} \oplus a_{l_{2} + 1} \oplus \ldots \oplus a_{r_{2}}) | \ldots | (a_{l_{k}} \oplus a_{l_{k} + 1} \oplus \ldots \oplus a_{r_{k}}) \leqslant x\).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;如果不存在这样的 \(k\), 则输出 \(-1\).&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;设 \(s_{i} = \oplus_{j = 1}^{i} a_{j}\), 则原问题被转化为 \(s_{r_{1}}|(s_{r_{2}}\oplus s_{r_{1}})|\cdots|(s_{r_{k}} \oplus s_{r_{k - 1}}) \leqslant x\).&lt;/p&gt;
&lt;p&gt;注意到 \(x | x \oplus y = x | y\), 于是问题被转化为从 \(\{s_{n}\}\) 中选尽可能多的数, 使其或和不超过 \(x\).&lt;/p&gt;
&lt;p&gt;这就变成了经典问题, 枚举 \(x\) 最高的为 \(1\) 且或和中该位为 \(0\) 的是哪一位, 然后进行贪心即可.&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n \log n)\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;calc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;^=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;(((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id="cf1944f2-2828"&gt;
(*2828)&lt;/h1&gt;
&lt;p&gt;如果一个长度为 \(m\) 的数列 \(\{b_{m}\}\) 能通过若干次操作变成全 \(0\) 序列, 则该序列为合法的. 操作被定义为, 选择 \(1 \leqslant l \lt r \leqslant m\), 将所有满足 \(i \in [l, r]\) 的 \(b_{i}\) 减 \(1\).&lt;/p&gt;
&lt;p&gt;给定 \(n, k, p\), 求有多少个长度为 \(n\) 的数列 \(\{a_{n}\}\) 是合法的, 且满足 \(\forall i, 0 \leqslant a_{i} \leqslant k\), 答案对 \(p\) 取模.&lt;/p&gt;
&lt;p&gt;\(3 \leqslant n \leqslant 3000, 1 \leqslant k \leqslant n, 10^{8} \lt p \lt 10^{9}, p \in \mathbb{P}\).&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;首先我们考虑\(\{a_{n}\}\) 合法的充要条件是什么, 容易想到为 \(\forall i, a_{i} \leqslant a_{i - 1} + a_{i + 1}\).&lt;/p&gt;
&lt;p&gt;注意到 \(a_{i} \gt a_{i - 1} + a_{i + 1}\) 和 \(a_{i + 1} \gt a_{i} + a_{i + 2}\) 不可能同时成立, 于是同时计算合法和不合法的方案数只需要记录前 \(1\) 个元素. 具体来说, 设 \(f_{i, j}\) 为考虑到 \(a_{i}\), 且 \(a_{i} = j\) 的合法方案数, 设 \(g_{i},j\) 为考虑到 \(a_{i}\), 有且仅有 \(a_{i} = j\) 这一位不合法的方案数. 那么有转移式 :&lt;/p&gt;
\[
g_{i, j} = \sum_{t = 0}^k f_{i - 2}, t \times \max\{k - j - t, 0\}, f_{i, j} = \sum_{t = 0}^k f_{i - 1, t} - g_{i, j}
\]&lt;p&gt;前缀和优化后时间复杂度 \(\Theta(n^{2})\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;3e3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;sigma&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;sigma&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sigma&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sigma&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sigma&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id="cf1944d-2072"&gt;
(*2072)&lt;/h1&gt;
&lt;p&gt;定义一个字符串为 \(\textrm {k-good}\) 的, 当且仅当其存在至少一个长度为 \(k\) 的子串不是回文的.&lt;/p&gt;
&lt;p&gt;给定长度为 \(n\) 的字符串 \(s\), 共 \(q\) 次询问, 每次给定 \(l, r\), 求 \(\sum_{k} k[s_{l \sim r}\ \textrm{is\ k-good}]\).&lt;/p&gt;
&lt;p&gt;\(n, q \leqslant 2 \times 10^{5}, 1 \leqslant l \lt r \leqslant n.\)&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;考虑计算一个特定的子串 \(t\) 对应的 \(\sum_{k} k[t\ \textrm{is\ k-good}]\). 对 \(k\) 分类讨论:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;\(k = 1\): 任意字符串均不是 \(\textrm {1-good}\) 的.&lt;/li&gt;
&lt;li&gt;\(k = |t|\): \(t\) 为 \(\textrm {|t|-good}\) 的当且仅当 \(t\) 本身为回文串.&lt;/li&gt;
&lt;li&gt;\(k\) 为偶数: 若 \(t\) 不为 \(\textrm {k-good}\) 的, 则任意长度为 \(k\) 的子串均为回文的, 则 \(t\) 中所有字符均相等.&lt;/li&gt;
&lt;li&gt;\(k\) 为奇数: 若 \(t\) 不为 \(\textrm {k-good}\) 的, 则任意长度为 \(k\) 的子串均为回文的, 则 \(t\) 中所有距离为 \(2\) 的字符均相等.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;考虑如何判断 \(s\) 的子串是否满足以下几个条件:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;\(s_{l \sim r}\) 是回文的: 使用 \(\textrm{Manacher}\) 算法或哈希即可.&lt;/li&gt;
&lt;li&gt;\(s_{l \sim r}\) 是全部相等的: 对 \([s_{i} = s_{i - 1}]\) 做前缀和即可.&lt;/li&gt;
&lt;li&gt;\(s_{l \sim r}\) 是间隔相等的: 对 \([s_{i} = s_{i - 2}]\) 分奇偶做前缀和即可.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;满足的条件判断出来后等差数列求和即可算出答案.&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n + q)\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;manacher&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nb"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;T&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;p1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;p2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;p1&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;p1&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;p1&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p1&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;pal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;manacher&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;__&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;p1&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;continue&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;continue&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;pal&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id="abc347f-2120"&gt;
(*2120)&lt;/h1&gt;
&lt;p&gt;给定 \(n \times n\) 的由非负整数构成的矩阵, 要从中选出 \(3\) 个 \(m \times m\) 的不相交的子矩阵, 最大化所有子矩阵的元素和.&lt;/p&gt;
&lt;p&gt;\(2 \leqslant n \leqslant 1000, 1 \leqslant m \leqslant \frac{n}{2}, a_{i, j} \leqslant 10^{9}\).&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="https://img.atcoder.jp/abc347/c8c4557905764a04a59ff89c7b249746.png" alt="" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;尝试枚举三个子矩阵的相对位置关系, 可以发现, 一定存在以上 \(6\) 中划分方式的其中一种, 使 \(3\) 个子矩阵分属 \(3\) 个不同的区域, 且不会有任何部分被其它区域包含.&lt;/p&gt;
&lt;p&gt;容易发现这 \(6\) 种划分方式本质上是两种.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;对于 \(|\ |\) 型: 求出每一列上的点作为子矩阵左上角的点对应的最大元素和, 预处理列区间的最大值, 枚举划分方案即可.&lt;/li&gt;
&lt;li&gt;对于 \(|-\) 型: 求出列前缀最大值和右上, 右下部分的前缀最大值, 枚举划分方案即可.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;时间复杂度 \(\Theta(n^{2})\).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;()))&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;calc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[:]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>诗歌(4)</title><link>https://sichen-wang.github.io/blog/%E8%AF%97%E6%AD%8C4/</link><pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E8%AF%97%E6%AD%8C4/</guid><description>&lt;p&gt;自市井之中圈一方小屋，拉过雨帘作幕&lt;/p&gt;
&lt;p&gt;独坐窗边，微风携着些许凉意扑面&lt;/p&gt;
&lt;p&gt;挥挥手扇动细雨如烟，似是又回到了江南——我的故乡，这时也是雨季，我们是不是在淋同一场雨呢？&lt;/p&gt;
&lt;p&gt;我倾耳细听，听风带来你的悄悄话，思绪顺着雨点向上，向上…穿过云层，穿过思绪的边界&lt;/p&gt;</description></item><item><title>诗歌(3)</title><link>https://sichen-wang.github.io/blog/%E8%AF%97%E6%AD%8C3/</link><pubDate>Tue, 06 Feb 2024 00:00:00 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E8%AF%97%E6%AD%8C3/</guid><description>&lt;p&gt;人们总把生命看作一口永不枯竭的井，&lt;br&gt;
认为自己总能见到下次太阳升起与落下。&lt;/p&gt;
&lt;p&gt;但是，朋友，&lt;br&gt;
你又几度见证过满月升起，几度见证过樱花飘落？&lt;/p&gt;
&lt;p&gt;万物运转自有其规律，几近不变的规律。&lt;br&gt;
这些东西看似无穷，而生命又何其短暂！&lt;br&gt;
我为光锥之外，悲痛欲绝。&lt;/p&gt;</description></item><item><title>诗歌(2)</title><link>https://sichen-wang.github.io/blog/%E8%AF%97%E6%AD%8C2/</link><pubDate>Fri, 15 Dec 2023 00:00:00 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E8%AF%97%E6%AD%8C2/</guid><description>&lt;p&gt;我曾七次鄙视自己的灵魂。&lt;/p&gt;
&lt;p&gt;第一次，当它本可进取时，却故作谦卑；&lt;/p&gt;
&lt;p&gt;第二次，当它在空虚时，却用爱欲来填充；&lt;/p&gt;
&lt;p&gt;第三次，在困难和容易之间，它选择了容易；&lt;/p&gt;
&lt;p&gt;第四次，它犯了错，却借由别人也会犯错来宽慰自己；&lt;/p&gt;
&lt;p&gt;第五次，它自由软弱，却认为这是生命的坚韧；&lt;/p&gt;
&lt;p&gt;第六次，当它鄙夷一张丑恶的嘴脸时，却不知那正是自己面具中的一副；&lt;/p&gt;
&lt;p&gt;第七次，它陷于生活的污泥之中，虽不甘心，却又畏首畏尾。&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;我曾九次感谢自己的灵魂。&lt;/p&gt;
&lt;p&gt;第一次，当它本可退缩时，选择了孤注一掷；&lt;/p&gt;
&lt;p&gt;第二次，当它在空虚时，选择了享受纯粹理性的愉悦；&lt;/p&gt;
&lt;p&gt;第三次，在舟行急湍之时，它选择了破浪而上；&lt;/p&gt;
&lt;p&gt;第四次，它犯了错，它反思，它原谅，它没有忘却；&lt;/p&gt;
&lt;p&gt;第五次，它忤逆动物软弱的天性，挑战自己生命的坚韧；&lt;/p&gt;
&lt;p&gt;第六次，当它鄙夷一张丑恶的嘴脸时，毫不掩饰自己对其的唾弃；&lt;/p&gt;
&lt;p&gt;第七次，它陷于生活的污泥之中，仍不忘却自己作为人类先锋的使命；&lt;/p&gt;
&lt;p&gt;第八次，当人群唱起赞歌，它没有戴上面具，随声附和；&lt;/p&gt;
&lt;p&gt;第九次，它被打败，却没有崩溃，它重新着上战甲，骑上战马。&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;这都是我。&lt;/p&gt;
&lt;p&gt;我鄙夷自己，我赞美自己；&lt;/p&gt;
&lt;p&gt;我鄙夷人性的残缺和生命的不完美；&lt;/p&gt;
&lt;p&gt;我赞美人性的高尚和生命的坚韧；&lt;/p&gt;
&lt;p&gt;我鄙夷自己的反复，唾弃自己犯下的错；&lt;/p&gt;
&lt;p&gt;我珍惜自己的天赋，牢记自己的不平凡；&lt;/p&gt;
&lt;p&gt;我生而高贵，肩负使命；&lt;/p&gt;
&lt;p&gt;我是人类文明的种子，我将成为人类触碰未知的树梢；&lt;/p&gt;
&lt;p&gt;我曾踏足山巅，也曾跌入谷底；&lt;/p&gt;
&lt;p&gt;我是人——&lt;/p&gt;
&lt;p&gt;人类的赞歌就是勇气的赞歌。&lt;/p&gt;</description></item><item><title>Background</title><link>https://sichen-wang.github.io/experience/</link><pubDate>Tue, 24 Oct 2023 00:00:00 +0000</pubDate><guid>https://sichen-wang.github.io/experience/</guid><description/></item><item><title>诗歌(1)</title><link>https://sichen-wang.github.io/blog/%E8%AF%97%E6%AD%8C1/</link><pubDate>Tue, 29 Aug 2023 00:00:00 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E8%AF%97%E6%AD%8C1/</guid><description>&lt;p&gt;智慧在反复中消磨，&lt;br&gt;
优雅被倦怠淹没，&lt;br&gt;
理性于日复一日中沉沦。&lt;/p&gt;
&lt;p&gt;从早到晚，&lt;br&gt;
跨过白天与黑夜，&lt;br&gt;
曾经美得那样透彻的式子也变成了晦涩难懂的符号。&lt;/p&gt;
&lt;p&gt;请你告诉我，&lt;br&gt;
求你告诉我！&lt;br&gt;
翻过这座山后是不是通向美的康庄大道？&lt;br&gt;
你不知道，&lt;br&gt;
没有人知道，&lt;br&gt;
就连修路的人都不知道我将通向何方。&lt;/p&gt;</description></item><item><title>(可持久化) Trie 树</title><link>https://sichen-wang.github.io/blog/%E5%8F%AF%E6%8C%81%E4%B9%85%E5%8C%96-trie-%E6%A0%91/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E5%8F%AF%E6%8C%81%E4%B9%85%E5%8C%96-trie-%E6%A0%91/</guid><description>&lt;h2 id="字典树"&gt;字典树&lt;/h2&gt;
&lt;p&gt;顾名思义，字典树就是支持像字典一样加入和查询字符串的树形数据结构，实现如下：&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;Trie&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;K&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Insert&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;strlen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;cnt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Find&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;strlen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="01-trie"&gt;0/1 Trie&lt;/h2&gt;
&lt;p&gt;在很多问题中，字符串仅由 \(0\) 和 \(1\) 构成，这些问题存在一定的共性。&lt;/p&gt;
&lt;h3 id="维护异或极值"&gt;维护异或极值&lt;/h3&gt;
&lt;p&gt;考虑如下问题，给定一颗带边权的树，求 \(\max\limits_{i,j\in[1,n]} \oplus Path(i,j)\)。&lt;/p&gt;
&lt;p&gt;由异或的性质，可知 \(\oplus Path(i,j)=\oplus Path(root,i)\oplus Path(root,j)\)。&lt;/p&gt;
&lt;p&gt;所以可以把所有从根开始的路径的异或和表示成一个数字，这样就将问题转化成了求任意两个数字的异或的最大值，可以用 \(\rm 0/1\ Trie\) 解决。&lt;/p&gt;
&lt;h3 id="维护异或和"&gt;维护异或和&lt;/h3&gt;
&lt;p&gt;考虑如下问题，给一些数，维护它们的异或和，支持插入，删除和全局 \(+1\)。&lt;/p&gt;
&lt;p&gt;对于异或和的维护，发现 \(sum=\sum_{i=0}^{k}2^{i}\times [num_{i}\equiv 1\pmod 2]\)。&lt;/p&gt;
&lt;p&gt;其中 \(sum\) 表示异或和，\(num_{i}\) 表示所有数中二进制的第 \(i\) 位为 \(1\) 的数量。这个式子体现在 \(\rm 0/1\ Trie\) 上就是对于所有以父亲边为 \(1\) 的结点为根的子树中有多少个 \(\rm Tag\)，令 \(\rm Tag\) 的数量为 \(num\)，这些结点的深度为 \(k\)，它们对答案的贡献即为 \(num\%2\times 2^{k}\)。&lt;/p&gt;
&lt;p&gt;对于实现全局 \(+1\) 操作，从低位到高维建 \(\rm 0/1\ Trie\)，考虑将一个二进制数 \(+1\) 的一般操作，即找到从低位到高位的第一个 \(0\)，将它变成 \(1\)，数位比它低的 \(1\) 全部变成 \(0\)。 而这个做法体现在 \(\rm 0/1\ Trie\) 上可以将一个结点的两条指向儿子的出边交换，再递归向交换后的 \(0\) 边迭代操作。&lt;/p&gt;
&lt;h3 id="01-trie-合并"&gt;0/1 Trie 合并&lt;/h3&gt;
&lt;p&gt;与线段树合并类似，实现如下：&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Merge&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Merge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;Merge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Push_up&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;需要注意的是，Trie 树合并和线段树合并一样，只有当每次合并的集合没有交集的时候复杂度才是 \(\Theta(n\log n)\) 的。&lt;/p&gt;
&lt;h2 id="可持久化-trie-树"&gt;可持久化 Trie 树&lt;/h2&gt;
&lt;p&gt;可持久化 Trie 的实现方式和可持久化线段树的方式是相似的，即每次只修改被添加或值被修改的节点，而保留没有被改动的节点，在上一个版本的基础上连边，使最后每个版本的 Trie 树的根遍历所能分离出的 Trie 树都是完整且包含全部信息的。实现如下：&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;Trie&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;rt&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Build&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;cnt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Query&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;Query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="经典例题"&gt;经典例题&lt;/h2&gt;
&lt;h3 id="lg4735-最大异或和"&gt;[LG4735] 最大异或和&lt;/h3&gt;
&lt;p&gt;可持久化 \(0/1\) Trie 模板题。&lt;/p&gt;
&lt;p&gt;考虑记所有的前缀和，答案变为统计 \(x\oplus sum_{n}\) 在 \([l-1,r-1]\) 这个区间的 \(0/1\) Trie 中的最大异或值。&lt;/p&gt;
&lt;h3 id="cf455b-a-lot-of-games"&gt;[CF455B] A Lot of Games&lt;/h3&gt;
&lt;p&gt;显然直接建立 Trie 树，每次相当于向 Trie 树的子树内走一步，不能走者为负。&lt;/p&gt;
&lt;p&gt;考虑设 \(f\) 表示是否存在必胜策略，\(g\) 表示是否存在必败策略，转移显然。&lt;/p&gt;
&lt;p&gt;对 \(f_{root}\) 和 \(g_{root}\) 分四种情况讨论，每种情况下的答案易得。需要注意的是，如果先手既存在必胜策略又存在必败策略，那他可以故意输以获得下一局的先手，然后在最后一局获得胜利。&lt;/p&gt;
&lt;h3 id="cf888g-xor-mst"&gt;[CF888G] Xor-MST&lt;/h3&gt;
&lt;p&gt;\(\rm Trie+Boruvka\)。&lt;/p&gt;
&lt;p&gt;考虑将所有树插入一个 Trie 中，枚举到某个连通块时将其中所有点从 Tire 中删除，再用连通块中每个结点从 Trie 中查找出最小边权，完成后再将连通块中的点权加回去。&lt;/p&gt;
&lt;p&gt;发现一个性质，每次合并的连通块都是 Trie 中某个节点的左右子树，再由 Trie 的性质，我们甚至不需要把 Trie 建出来，只需要将 A 排序，二分 Trie 的左右儿子，再将其中一个儿子的所有结点建 Trie，用另一个儿子中的所有结点在其中查找连通块之间的最小边权即可。&lt;/p&gt;
&lt;p&gt;由于每个结点最多被加进 Trie 树 \(\log n\) 次，每次复杂度为 \(\log W\)，所以总时间复杂度为 \(\Theta(n\log n\log W)\)。&lt;/p&gt;</description></item><item><title>(带权)并查集</title><link>https://sichen-wang.github.io/blog/%E5%B8%A6%E6%9D%83%E5%B9%B6%E6%9F%A5%E9%9B%86/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E5%B8%A6%E6%9D%83%E5%B9%B6%E6%9F%A5%E9%9B%86/</guid><description>&lt;h2 id="用途"&gt;用途&lt;/h2&gt;
&lt;p&gt;并查集可以用来维护一类具有传递性的关系，维护形如将 \(x\) 与 \(y\) 所在集合合并和询问 \(x\) 和 \(y\) 是否在同一个集合的操作。&lt;/p&gt;
&lt;h2 id="实现"&gt;实现&lt;/h2&gt;
&lt;h3 id="查询祖先节点"&gt;查询祖先节点&lt;/h3&gt;
&lt;p&gt;对于普通并查集来说，有路径压缩和按秩合并等优化，路径压缩一般实现如下 ：&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Find&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;按秩合并则取点数小的连向点数大的即可。&lt;/p&gt;
&lt;p&gt;而对于带边权的并查集，我们需要在路径压缩的时候考虑加上其父亲的权值以维护其到根的差值，有路径压缩优化的带权并查集一般实现如下 ：&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Find&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;mark&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;mark&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;由于路径压缩后 \(x\) 的父亲就是根节点了，所以需要记录其父亲到根的总权值并加到它的边权上。&lt;/p&gt;
&lt;p&gt;另外，如果要查询某个点 \(x\) 到根的权值和，由于一次路径压缩以后 \(x\) 的父亲会变成根，而此时的 \(val_{x}\) 就是路径和，所以可以先调用一次 &lt;code&gt;Find(x)&lt;/code&gt;，此时的 \(val_{x}\) 即为答案。&lt;/p&gt;
&lt;h3 id="合并两个结点所在集合"&gt;合并两个结点所在集合&lt;/h3&gt;
&lt;p&gt;对于普通并查集来说，两个集合合并直接将其中一个根节点接到另一个根节点上即可。&lt;/p&gt;
&lt;p&gt;而对于带权并查集而言，我们必须求出需要连接的两个根节点之间连边的权值，而这个权值是可以直接确定的，假设现在要给 \(x\to y\) 连一条长度为 \(w\) 的边，设 \(x\) 的祖先为 \(Rx\)，则 \(val_{Rx}=val_{y}+w-val_{x}.\) 另外，如果 \(x\) 和 \(y\) 已经在同一个集合中，并且 \(val_{Rx}+val_{x}-val_{y}\not = w\)，则这条连边不合法。实现如下 ：&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="nf"&gt;Merge&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Rx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;Ry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Rx&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;Ry&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Rx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Ry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Rx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Rx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="code"&gt;Code&lt;/h2&gt;
&lt;p&gt;带路径压缩和按秩合并优化的普通并查集 :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Find&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="nf"&gt;Merge&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Rx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;Ry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pnum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Rx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;pnum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Ry&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Rx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Ry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pnum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Ry&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;pnum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Rx&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Ry&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Rx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pnum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Rx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;pnum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Ry&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Rx&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;Ry&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;带路径压缩和按秩合并优化的带权并查集 ：&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Find&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;mark&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;mark&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="nf"&gt;Merge&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Rx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;Ry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Rx&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;Ry&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pnum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Rx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;pnum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Ry&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Rx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Ry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pnum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Ry&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;pnum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Rx&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Rx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Ry&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Rx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pnum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Rx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;pnum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Ry&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Ry&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;不带任何优化的并查集复杂度是 \(\Theta(n^{2})\) 的。&lt;/p&gt;
&lt;p&gt;带路径压缩的并查集时间复杂度 \(\Theta(n \log n)\)，期望复杂度 \(\Theta(n \alpha(n))\)。&lt;/p&gt;
&lt;p&gt;再加上按秩合并可以做到严格 \(\Theta(n \alpha(n))\)。&lt;/p&gt;</description></item><item><title>「CF690A」Collective Mindsets</title><link>https://sichen-wang.github.io/blog/cf690a-collective-mindsets/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/cf690a-collective-mindsets/</guid><description>&lt;h2 id="description"&gt;Description&lt;/h2&gt;
&lt;p&gt;你是一只僵尸。&lt;/p&gt;
&lt;p&gt;你现在和 \(n - 1\) 个僵尸站在一起分配大脑。你的编号是 \(1\)，其他僵尸编号 \(2 \sim n\)。&lt;/p&gt;
&lt;p&gt;僵尸们按照编号从小到大的顺序提出分配方案（一个方案是指每个僵尸分配几个大脑，大脑不能有剩余），然后所有僵尸进行投票，如果得票数&lt;strong&gt;大于等于&lt;/strong&gt;一半方案就通过，否则当前的僵尸会被其它僵尸吃掉，由下一个僵尸进行分配。&lt;/p&gt;
&lt;p&gt;僵尸们都很贪婪和残忍，但它们更不想被吃掉，所以僵尸们会在保证自己&lt;strong&gt;不被吃掉&lt;/strong&gt;的情况下提出自己获得的大脑&lt;strong&gt;最多&lt;/strong&gt;的方案，并且&lt;strong&gt;当且仅当&lt;/strong&gt;吃掉分配的僵尸&lt;strong&gt;严格劣于&lt;/strong&gt;同意分配方案时才会投赞同票。&lt;/p&gt;
&lt;p&gt;给定 \(n\)，现在你想活下去，并且获得至少 \(m\) 个大脑，请问至少需要多少大脑才能满足？&lt;/p&gt;
&lt;p&gt;数据范围 : \(n \leqslant 10^{9}, m \in \{0, 1\}.\)&lt;/p&gt;
&lt;h2 id="tutorial"&gt;Tutorial&lt;/h2&gt;
&lt;p&gt;首先考虑 \(m = 1\) 的情况。&lt;/p&gt;
&lt;p&gt;容易知道，当 \(n = 1\) 或 \(n = 2\) 时，不需要其它任何人同意，所以只需要给自己分配一个脑子即可，答案为 \(1\)。&lt;/p&gt;
&lt;p&gt;当 \(n = 3\) 时，\(1\) 号不可能获得 \(2\) 号的投票，因为 \(1\) 号死后 \(2\) 号可以独占所有脑子，于是 \(1\) 号只能去争取 \(3\) 号的同意。又因为如果让 \(2\) 号来分配，\(3\) 号一个脑子都得不到，所以分给它 \(1\) 个脑子即可获得它的同意，答案为 \(2\)。&lt;/p&gt;
&lt;p&gt;考虑不断将 \(n\) 增加来考虑，可以发现，在上一步中可以获得脑子的僵尸是无法收买的，于是给上一步中无法获得脑子的僵尸分别分配 \(1\) 个脑子就可以获得它们的同意。&lt;/p&gt;
&lt;p&gt;综上，当 \(m = 1\) 时，答案为 \(\left\lfloor\frac{n + 1}{2}\right\rfloor\)。&lt;/p&gt;
&lt;p&gt;然后考虑 \(m = 0\) 的情况。&lt;/p&gt;
&lt;p&gt;首先可以确定一个答案的上界，即考虑到 \(m = 1\) 情况下的分法，答案至多为 \(\left\lfloor\frac{n - 1}{2}\right\rfloor\)。&lt;/p&gt;
&lt;p&gt;考虑当答案为 \(0\) 时有哪些僵尸可以存活:&lt;/p&gt;
&lt;p&gt;首先给僵尸重新标号，记最后提方案的僵尸为 \(1\) 号，倒数第二个为 \(2\) 号，依此类推。&lt;/p&gt;
&lt;p&gt;容易知道，当 \(n = 1\) 或 \(n = 2\) 时，所有僵尸均可存活。&lt;/p&gt;
&lt;p&gt;\(3\) 号僵尸无法牵扯任何僵尸的利益，所以它无法存活。&lt;/p&gt;
&lt;p&gt;\(4\) 号僵尸死后，\(3\) 号僵尸也会死，于是它获得 \(3\) 号僵尸的支持，可以存活。&lt;/p&gt;
&lt;p&gt;\(5, 6, 7\) 号僵尸全部死后 \(1, 2, 3, 4\) 号僵尸也不会有任何损失，于是它们都不会同意 \(5, 6, 7\) 号僵尸的方案，所以 \(5, 6, 7\) 号无法存活。&lt;/p&gt;
&lt;p&gt;\(8\) 号僵尸死后 \(5, 6, 7\) 号会死，于是它可以获得除自己外 \(3\) 只僵尸的支持，可以存活。&lt;/p&gt;
&lt;p&gt;到这里，我们可以找到规律，在用到 \(0\) 个脑子的情况下，\(1, 2, 4, 8, 16, \cdots\) 号僵尸可以存活。&lt;/p&gt;
&lt;p&gt;用与之前类似的方式分析脑子总数为 \(1, 2, 3, \cdots\) 的情况，我们可以发现，当脑子总数为 \(B\) 时，存活僵尸的集合为 \(\{1, 2, \cdots, 2B\} \cup \{2B + 2^{i}|i \in N^{\ast}\}\)。&lt;/p&gt;
&lt;p&gt;当 \(n \equiv 1 \pmod 2\) 时，\(n\) 仅有可能在集合 \(\{1, 2, \cdots, 2(B + 1)\}\) 中出现，于是答案为 \(\frac{n - 1}{2}\)。&lt;/p&gt;
&lt;p&gt;当 \(n \equiv 0 \pmod 2\) 时，可以找到最大的 \(2\) 的幂 \(p\) 满足 \(p \leqslant n\)，此时 \(n\) 会在 \(B = \frac{n - p}{2}\) 时第一次出现在集合中，于是答案即为 \(\frac{n - p}{2}\)。&lt;/p&gt;
&lt;p&gt;综上，时间复杂度 \(\Theta(\log n)\)。&lt;/p&gt;
&lt;h2 id="reference-code"&gt;Reference Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="cm"&gt;/*0*/&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>「Codechef」Children Trips</title><link>https://sichen-wang.github.io/blog/codechef-children-trips/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/codechef-children-trips/</guid><description>&lt;h2 id="description"&gt;Description&lt;/h2&gt;
&lt;p&gt;你在一颗树上旅行。&lt;/p&gt;
&lt;p&gt;树由 \(n\) 个点，\(n - 1\) 条边构成，每条边的长度 \(w\) 是 \(1\) 或 \(2\)。&lt;/p&gt;
&lt;p&gt;你要从点 \(u\) 沿着唯一的简单路径走到点 \(v\)。但是，你的体力有限，所以一天之内最多只能走 \(l\) 的距离。一天结束时待在树的节点外是很危险的，所以你必须在一天结束前到达某个节点并停下（可以刚好到达），即使你没有走到 \(l\) 的距离。&lt;/p&gt;
&lt;p&gt;给定这棵树和 \(q\) 个询问，每个询问给出 \(u,v,l\)，请求出至少需要多少天。&lt;/p&gt;
&lt;p&gt;数据范围 : \(1 \leqslant n,q \leqslant 10^{5}, 1 \leqslant x,y,u,v \leqslant n,w \in \{1, 2\}, 2 \leqslant l \leqslant 2n.\)&lt;/p&gt;
&lt;h2 id="tutorial"&gt;Tutorial&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Lemma1:&lt;/strong&gt; 一条路径，正着走和倒着走答案是一样的。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Proof1:&lt;/strong&gt; 考虑将正着和倒着每天累计走的距离写下来，容易发现正着走相当于一开始落后了至多 \(1\) 的距离，后面在不断追赶。可以发现在走的过程中是存在单调性的，所以正着走一定不可能超过倒着走，但也不可能落后超过 \(1\)。由于最后会走到相同的位置，所以答案是一样的。&lt;/p&gt;
&lt;p&gt;有了上述引理，我们就可以考虑分别计算 \(u\) 和 \(v\) 分别跳到 \(\textrm{LCA}(u, v)\) 下面最高能跳到的点的答案。设 \(l_{1}, l_{2}\) 分别表示 \(u\) 和 \(v\) 剩下的距离，最终答案即为 \(u\) 和 \(v\) 的答案之和加上 \(\left\lceil\frac{l_{1} + l_{2}}{l}\right\rceil\)。&lt;/p&gt;
&lt;p&gt;考虑对询问根号分治，分别处理 \(l \leqslant \sqrt{n}\) 的询问和 \(l \gt \sqrt{n}\) 的询问。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;对于 \(l \gt \sqrt{n}\) 的询问，可以发现其跳的次数不超过 \(\sqrt{n}\)，于是可以直接暴力跳，用倍增维护一下即可。&lt;/li&gt;
&lt;li&gt;对于 \(l \leqslant \sqrt{n}\) 的询问，可以预处理出从每个点 \(u\) 开始，此时的 \(l = k\)，往上跳 \(2^{i}\) 天到的点 \(f_{u, k, i}\)，倍增往上跳即可。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;时间复杂度 \(\Theta(n \sqrt{n} \log n)\)，卡一卡常可以通过。&lt;/p&gt;
&lt;p&gt;考虑换一种思路，我们给树上 \(\sqrt{n}\) 个点打上标记，称它们为特殊点。那么如果标记打得足够均匀，就可以使 \(u, v \to \textrm{LCA}(u, v)\) 的路径上每隔 \(\sqrt{n}\) 的距离经过一个特殊点，且总共经过 \(\sqrt{n}\) 个特殊点。至于如何打标记，可以记 \(dis_{u}\) 表示 \(u\) 到树上最远点的距离，取 \(B = \sqrt{n}\)，\(u\) 为标记点当且仅当 \(B | dis_{u}\)。&lt;/p&gt;
&lt;p&gt;考虑预处理 \(f_{u, k}\) 表示当 \(l = k\) 时，从 \(u\) 开始走一天到的点（如果这个点超过了 \(u\) 祖先中最深的特殊点，那么就将 \(f_{u, k}\) 设为该特殊点，并且计算剩下了多少距离），\(g_{u, k}\) 表示当 \(l = k\) 时，从 \(u\) 开始走到 \(u\) 祖先中最深的特殊点需要花费的天数。&lt;/p&gt;
&lt;p&gt;容易发现，由于走到 \(u\) 祖先中最深的特殊点最多 \(2\sqrt{n}\) 的距离，所以 \(k\) 的取值范围为 \([0, 2\sqrt{n}]\)。预处理直接从上往下递推即可，由于状态总数是 \(n \sqrt{n}\) 的，所以预处理时间复杂度也是 \(\Theta(n \sqrt{n})\)。至于如何使用这两个数组优化往上跳的过程则是简单的，不作赘述。&lt;/p&gt;
&lt;p&gt;总时间复杂度 \(\Theta(n \sqrt{n})\)，可以轻松通过此题。&lt;/p&gt;</description></item><item><title>「省选联考 2021」卡牌游戏</title><link>https://sichen-wang.github.io/blog/%E7%9C%81%E9%80%89%E8%81%94%E8%80%83-2021%E5%8D%A1%E7%89%8C%E6%B8%B8%E6%88%8F/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E7%9C%81%E9%80%89%E8%81%94%E8%80%83-2021%E5%8D%A1%E7%89%8C%E6%B8%B8%E6%88%8F/</guid><description>&lt;h2 id="sol"&gt;Sol&lt;/h2&gt;
&lt;h3 id="法一"&gt;法一&lt;/h3&gt;
&lt;p&gt;可以证明，若进行了操作 \(a_{i} \to b_{i}\)，那么 \(\forall j \lt i\)，操作 \(a_{j} \to b_{j}\) 都进行了。因为如果存在 \(j \lt i\)，\(a_{i} \to b_{i}\) 执行了，但 \(a_{j} \to b_{j}\) 没执行，那么 \(a_{i} \to b_{i}\) 执行就没有意义，因为 \(a_{j}\) 还是会作为最小值。&lt;/p&gt;
&lt;p&gt;同理，我们可以证明操作序列也是后缀连续的。&lt;/p&gt;
&lt;p&gt;于是我们可以枚举操作了的前缀，然后预处理出 \(b\) 序列后缀最大值等信息即可计算答案。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n).\)&lt;/p&gt;
&lt;h3 id="法二"&gt;法二&lt;/h3&gt;
&lt;p&gt;容易发现答案满足可二分性，于是二分答案 \(\rm mid.\)&lt;/p&gt;
&lt;p&gt;如果选定了答案区间的左端点，那么右端点可以容易地确定。&lt;/p&gt;
&lt;p&gt;于是问题转化成了一个前后缀 \(\rm RMQ.\)&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n \log n).\)&lt;/p&gt;
&lt;h3 id="法三"&gt;法三&lt;/h3&gt;
&lt;p&gt;考虑将 \(a_{i}\) 和 \(b_{i}\) 全部取出来排序，可以发现答案是删去一些数后的最大值减最小值。&lt;/p&gt;
&lt;p&gt;于是双指针维护，记录当前删去了多少个 \(a_{i}\) 和一张牌的 \(a_{i}\) 和 \(b_{i}\) 是否同时被删掉即可。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n \log n)\)，因为要排序。&lt;/p&gt;
&lt;h2 id="code"&gt;Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;2e6&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;INT_MAX&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;pair&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;idx&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="nf"&gt;check&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;del&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;rev&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="n"&gt;del&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;del&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>「省选联考 2021」图函数</title><link>https://sichen-wang.github.io/blog/%E7%9C%81%E9%80%89%E8%81%94%E8%80%83-2021%E5%9B%BE%E5%87%BD%E6%95%B0/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E7%9C%81%E9%80%89%E8%81%94%E8%80%83-2021%E5%9B%BE%E5%87%BD%E6%95%B0/</guid><description>&lt;h2 id="sol"&gt;Sol.&lt;/h2&gt;
&lt;p&gt;首先考虑分析 \(f(u, G)\)，可以观察出一些性质 ：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;会产生贡献的 \(v\) 必须满足 \(v \lt u.\)&lt;/li&gt;
&lt;li&gt;\(v\) 与 \(u\) 会产生贡献当且仅当 \(u\) 和 \(v\) 可以仅通过大于 \(v\) 的点互达。&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;\(\rm Proof: \)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;当 \(v \gt u\) 时 \(u\) 自己都已经删掉了，肯定不能产生贡献。&lt;/li&gt;
&lt;li&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="https://s1.ax1x.com/2022/03/06/bDTc79.png" alt="" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;如上图所示，我们不妨设 \(u \to v\) 的路径上必须经过 \(x(x \lt u)\)，那么 \(x\) 和 \(u\) 一定相互可达，\(x\) 会在统计 \(v\) 的答案之前被删掉。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;于是我们可以发现，若定义两点 \((u, v)\) 有贡献当且仅当 \(u \gt v\) 且 \(u\) 和 \(v\) 之间可以通过大于 \(v\) 的点相互到达，则 \(h(G)\) 就是在求解 \(G\) 中所有点对的贡献之和。&lt;/p&gt;
&lt;p&gt;我们考虑 \(\rm Floyd\) 算法的过程，实际上就是在不断求解如果只经过当前已经枚举的这些中转点 \(k\)，有哪些 \(u\) 可以走到 \(v.\) 于是求解 \(h(G)\) 只需要从大到小枚举中转点 \(k\)，并在 \(\rm Floyd\) 的过程中记录下当前 \(v = k - 1\) 的答案即可。&lt;/p&gt;
&lt;p&gt;进一步观察发现，如果我们按照编号从大到小将边加入图 \(G\)，那么必然可以找到一个分界点，使得 \(u\) 和 \(v\) 恰好变为有贡献的点对。容易发现，这个分界点就是 \(u\) 和 \(v\) 可以相互到达的路径上编号最小的边的最大值。求解这个最大值是简单的，只需要将初始矩阵修改成边的编号，方程改写为 \(f_{u, v} = \max\{f_{u, v}, \min\{f_{u, k}, f_{k, v}\}\}\) 即可。&lt;/p&gt;
&lt;p&gt;最后用差分维护一下就可以得到最终答案。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n^{3} + m)\)，常数很小，写得好的话可以通过。&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;为了进一步优化复杂度，我们摈弃之前使用 \(\rm Floyd\) 的想法。&lt;/p&gt;
&lt;p&gt;考虑按编号从大到小枚举所有的边，可以发现每对点 \((u, v)(u \gt v)\) 都会有一个成为有贡献的点对的分界点。&lt;/p&gt;
&lt;p&gt;首先计算 \(v\) 可以到达 \(u\) 的分界点， \(u\) 到 \(v\) 的分界点可以通过在反图上进行同样的操作来计算。&lt;/p&gt;
&lt;p&gt;有两个显然的性质 ：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;有贡献的点对数量最多 \(n^{2}\) 量级。&lt;/li&gt;
&lt;li&gt;在加边的过程中有贡献的点对数量不减。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;于是考虑计算每条边加入后有贡献的点对的增量。&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="https://s1.ax1x.com/2022/03/06/brP9Ds.png" alt="" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;如上图所示，设当前加入的边为 \(x \to y\)，\(u_{1}, u_{2}, u_{3}, \cdots \) 和 \(v_{1}, v_{2}, v_{3}, \cdots\) 分别为能到达 \(x\) 的点和 \(y\) 能到的点。&lt;/p&gt;
&lt;p&gt;考虑用 \(\rm bitset\) 记录某个点能直接到达的所有点，能到达的所有点和能到达这个点的所有点，不妨分别设它们为 \(E_{u}, S_{u}\) 和 \(T_{u}.\)&lt;/p&gt;
&lt;p&gt;可以发现，若点对 \((u, v)\) 因 \(x \to y\) 而增加，需要满足 ：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;\(u\) 在加入 \(x \to y\) 之前不能到达 \(y.\)&lt;/li&gt;
&lt;li&gt;\(u\) 在加入 \(x \to y\) 之前要能到达 \(x.\)&lt;/li&gt;
&lt;li&gt;路径上所有点的编号都不小于 \(u.\)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;首先前两个条件可以通过 \(T_{x} \cap (U - T_{y})\) 简单地得到，考虑枚举集合中的所有点作为 \(u\) 从 \(y\) 开始遍历。遍历的过程中，每一步要将 \(E_{v} \cap (U - S_{u})\) 中所有编号大于 \(u\) 的点作为下一个遍历的点。另外，还要记得随时更新 \(S_{u}.\)&lt;/p&gt;
&lt;p&gt;考虑这样做的复杂度为什么是对的。因为每一步都会走到一个合法的 \(v\)，所以答案每一步会增加 \(1.\) 并且每走一步都需要计算 \(E_{v} \cap (U - S_{u})\)，其时间复杂度为 \(\Theta(\frac{n}{\omega}).\) 另外，每加入一条边都需要计算 \(T_{x} \cap (U - T_{y})\)，其时间复杂度也为 \(\Theta(\frac{n}{\omega}).\) 于是总时间复杂度为 \(\Theta(\frac{n^{3} + nm}{\omega})\)。&lt;/p&gt;
&lt;h2 id="code"&gt;Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;M&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;2e5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;Eik&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Eik&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Eik&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nl"&gt;Eik&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Eik&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nl"&gt;Eik&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Eik&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nl"&gt;Eik&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Eik&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nl"&gt;Eik&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Eik&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nl"&gt;Eik&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Eik&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nl"&gt;Eik&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Eik&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nl"&gt;Eik&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Eik&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nl"&gt;Eik&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>「省选联考 2021」矩阵游戏</title><link>https://sichen-wang.github.io/blog/%E7%9C%81%E9%80%89%E8%81%94%E8%80%83-2021%E7%9F%A9%E9%98%B5%E6%B8%B8%E6%88%8F/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E7%9C%81%E9%80%89%E8%81%94%E8%80%83-2021%E7%9F%A9%E9%98%B5%E6%B8%B8%E6%88%8F/</guid><description>&lt;h2 id="sol"&gt;Sol.&lt;/h2&gt;
&lt;p&gt;首先可以发现，若不考虑 \(a_{i} \leqslant 10^{6}\) 的限制，那么构造一组合法解是容易的。&lt;/p&gt;
&lt;p&gt;同时可以发现，如果对一行或一列进行 \(+1, -1, +1, -1, \cdots \) 操作，那么得到的 \(a_{i}\) 还是合法的。&lt;/p&gt;
&lt;p&gt;设 \(c_{i}\) 和 \(d_{i}\) 分别表示每行，每列进行了多少次操作，下面两个矩阵即为 \(a_{i, j}\) 得到真实值需要加上修改值的系数：&lt;/p&gt;
\[
\begin{bmatrix}
+1 &amp; -1 &amp; +1 &amp; -1 \\
+1 &amp; -1 &amp; +1 &amp; -1 \\
+1 &amp; -1 &amp; +1 &amp; -1 \\
+1 &amp; -1 &amp; +1 &amp; -1 \\
\end{bmatrix}
\rm and
\begin{bmatrix}
+1 &amp; +1 &amp; +1 &amp; +1 \\
-1 &amp; -1 &amp; -1 &amp; -1 \\
+1 &amp; +1 &amp; +1 &amp; +1 \\
-1 &amp; -1 &amp; -1 &amp; -1 \\
\end{bmatrix}
\]&lt;p&gt;列出需要满足的方程 ：
&lt;/p&gt;
\[
0 \leqslant a_{i, j} \pm c_i \pm d_j \leqslant 10 ^ 6
\]&lt;p&gt;可以发现，若将 \(c_{i}\) 和 \(d_{i}\) 作为未知数，可能会出现 “求和约束”，这是难以解决的。&lt;/p&gt;
&lt;p&gt;观察到发生这个问题的本质是因为在两个矩阵的相同位置出现了相同的符号，于是考虑重构矩阵：&lt;/p&gt;
\[
\begin{bmatrix}
+1 &amp; -1 &amp; +1 &amp; -1 \\
-1 &amp; +1 &amp; -1 &amp; +1 \\
+1 &amp; -1 &amp; +1 &amp; -1 \\
-1 &amp; +1 &amp; -1 &amp; +1 \\
\end{bmatrix}
\rm and
\begin{bmatrix}
-1 &amp; +1 &amp; -1 &amp; +1 \\
+1 &amp; -1 &amp; +1 &amp; -1 \\
-1 &amp; +1 &amp; -1 &amp; +1 \\
+1 &amp; -1 &amp; +1 &amp; -1 \\
\end{bmatrix}
\]&lt;p&gt;于是此时就可以使用差分约束的常规求解方式了。&lt;/p&gt;
&lt;p&gt;使用 \(\rm SPFA\) 的时间复杂度为 \(\Theta[n^{2} (n + m)]\)，常数很小，可以通过。&lt;/p&gt;
&lt;h2 id="code"&gt;Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define int long long
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;M&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;W&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;tot&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;vis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;dis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;queue&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Link&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;tot&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;W&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tot&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tot&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tot&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;signed&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%lld&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%lld%lld&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;vis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e9&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;empty&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="n"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%lld&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Link&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;Link&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1e6&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;Link&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;Link&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1e6&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Link&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;vis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;flag&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;empty&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;front&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;flag&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;vis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;dis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;W&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;W&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;vis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]])&lt;/span&gt; &lt;span class="n"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;vis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;flag&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;NO&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;YES&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;dis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;dis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;dis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;dis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%lld &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>2-SAT 问题</title><link>https://sichen-wang.github.io/blog/2-sat-%E9%97%AE%E9%A2%98/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/2-sat-%E9%97%AE%E9%A2%98/</guid><description>&lt;h2 id="求解-2-sat-问题"&gt;求解 2-SAT 问题&lt;/h2&gt;
&lt;p&gt;\(2-\rm Sat\) 问题是求解某个 \(\rm bool\) 方程组，方程组中的每个方程被描述为：\(x_{i}\) 为真\(/\)假 或 \(x_{j}\) 为真\(/\)假。&lt;/p&gt;
&lt;p&gt;我们可以对每个 \(x_{i}\) 和 \(\lnot x_{i}\) 分别建点，\(x_{i}\) 为假看作 \(\lnot x_{i}\) 为真，这样方程就仅有一种类型了，即若 \(p\) 为真则 \(q\) 为真。具体来说，建一些边 \(u\to v\) 表示当 \(u\) 为真的时候 \(v\) 一定为真，比如有方程 \(p\) 为真或 \(q\) 为真时，建两条边 \(p\to \lnot q\) 和 \(q\to \lnot {p}\)。&lt;/p&gt;
&lt;p&gt;建完图后，显然同一个强连通分量中的点取值必然相同，那么如果 \(a\) 和 \(\lnot a\) 在同一个强连通分量里则该 \(\rm bool\) 方程组无解。易知，存在 \(a\) 和 \(\lnot a\) 在同一个强连通分量中为该 \(\rm bool\) 方程组无解的充要条件。&lt;/p&gt;
&lt;p&gt;对于其它的点，每对 \(a\) 和 \(\lnot a\) 中有且仅有一个为真，我们令拓扑序大的那个为真。可以分情况证明其最优性 ：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;若 \(a\) 和 \(\lnot a\) 在 \(\rm DAG\) 的同一条链上，那么拓扑序大的必然为真，否则两个都为真与题意相悖。&lt;/li&gt;
&lt;li&gt;若 \(a\) 和 \(\lnot a\) 在不同链上，那么两个点的取值其实无所谓，但一定要跟拓扑序相关。因为每条链上拓扑序的大小关系时严格的，用拓扑序规定某个点取值是否为真可以使为真的点在同一条链上，尽可能降低对其他点的影响。另外，为了保证跟上一种情况的统一性，仍选择令拓扑序大的点为真。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;另一方面，我们发现 \(\rm Tarjan\) 缩点所求出的 \(\rm SCC\) 强连通分量数组的值负相关，可以理解为拓扑序更小的点更后入栈，也更先出栈编号。故最后对比 \(a\) 和 \(\lnot a\) 的 \(\rm SCC\) 值即可判断它们谁为真谁为假。&lt;/p&gt;
&lt;h2 id="经典例题"&gt;经典例题&lt;/h2&gt;
&lt;h3 id="lg6378-riddle"&gt;[LG6378] Riddle&lt;/h3&gt;
&lt;p&gt;对树上每个点建立一个 \(\rm bool\) 变量，取值为 \(1\) 表示这个点选。&lt;/p&gt;
&lt;p&gt;使用 \(\rm 2-Sat\) 的通用做法，建立为每个点的状态建立两个点 \(u\) 和 \(\lnot u\)，分别对每个限制考虑 ：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;每条边至少有一个关键点，则对于一条边 \(u-v\) 若 \(\lnot u\) 则 \(v\)，若 \(\lnot v\) 则 \(u\)，故连接 \(\lnot u\to v\) 和 \(\lnot v\to u\)。&lt;/li&gt;
&lt;li&gt;每个部分最多有一个关键点，则如果 \(u\) 被选了，那么同一个块中所有点都不能选，连接 \(u\to \lnot v\)。 但是我们发现这样连边是 \(\Theta(n^{2})\) 的，所以前缀和优化连边即可。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;建好图以后直接跑 \(\rm 2-Sat\)，时间复杂度 \(\Theta(n)\)。&lt;/p&gt;
&lt;h3 id="poi2011-kon-conspiracy"&gt;[POI2011] KON-Conspiracy&lt;/h3&gt;
&lt;p&gt;首先转化题意，这道题要求的是将一张无向图划分成一个团和一个独立集的方案数。&lt;/p&gt;
&lt;p&gt;首先找出一种合法的方案是很容易的，是一个裸的 \(\rm 2-Sat\) 问题。&lt;/p&gt;
&lt;p&gt;考虑找出一种方案后统计方案数。首先有如下性质 ：&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;ul&gt;
&lt;li&gt;一个团中不可能取出一个以上的点加入独立集，因为两点之间必有连边。&lt;/li&gt;
&lt;li&gt;一个独立集中不可能取出一个以上的点加入团，因为两点之间必无连边。&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;所以可以直接分别枚举团和独立集中的每个点，交换它们即可。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\rm \Theta(n^{2})\)。&lt;/p&gt;
&lt;h3 id="北京省选集训-2019-完美塔防"&gt;[北京省选集训 2019] 完美塔防&lt;/h3&gt;
&lt;p&gt;首先预处理哪些炮台会互相打到，若存在，则输出 &lt;code&gt;IMPOSSIBLE&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;然后发现有如下结论：&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;每个空地最多可以被两个炮台打到。
因为每个空地最多在纵横两个方向上被打到，若还存在一个，则必定会打到其中一个炮台。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;于是对每个炮台，它的纵横情况设为 \(0/1\)，每个空地会加入一个形如 \(a\ or\ b\) 的条件，这就变成了经典的 \(\rm 2-Sat\) 问题。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(Tn^{3})\)。&lt;/p&gt;
&lt;h3 id="hnoi2010-平面图判定"&gt;[HNOI2010] 平面图判定&lt;/h3&gt;
&lt;p&gt;首先有平面图中的欧拉定理，设一张无向连通图点数为 \(v\)，边数为 \(e\)，面数为 \(f\)，则有 ：&lt;/p&gt;
\[
v-e+f=2
\]&lt;p&gt;考虑通过对 \(e\) 进行归纳证明该式。&lt;/p&gt;
&lt;p&gt;当 \(e=0\) 时显然成立。&lt;/p&gt;
&lt;p&gt;若当 \(e'=e-1\) 时该式成立，我们要证 \(v-e+f=1\) 成立只需证添加一条边会使得面数恰好增加 \(1\)。 而对于这个问题，我们可以分类讨论，若这条边加在某个面的中间，那么其必将这个面分成两半，若这条边加在图形外面，那么会围出一块新的区域，也会使面数恰好增加 \(1\)。&lt;/p&gt;
&lt;p&gt;故该式成立。&lt;/p&gt;
&lt;p&gt;我们进一步探究平面图的性质。定义面的度数为与其相邻的面的数量，显然对于每条边都会有恰好两个面与其相邻，故所有面的度数之和为 \(2e\)。 又因为每个面至少三条边，所以度数不小于 \(3\)，进而有 \(3f\) 不大于所有面的度数之和，故有 \(3f\leqslant 2e\)，将其带入平面图中的欧拉定理可得 ：&lt;/p&gt;
\[
e\leqslant 3v-6
\]&lt;p&gt;于是不满足该式的无向连通图均不为平面图，进而可以将 \(m\) 限制到与 \(n\) 同数量级。&lt;/p&gt;
&lt;p&gt;我们发现题目给定了哈密顿回路，于是考虑以这个环作为中心考虑问题。&lt;/p&gt;
&lt;p&gt;我么发现对于任意一条边，它要么从环内连接，要么从环外连接，并且如果有两条边 \(u-v\) 和 \(u'-v'\)，且满足 \(u\lt u'\lt v\lt v'\)，那么它们不能连在同一面。于是可以通过这种关系构建 \(\rm 2-Sat\) 模型。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(Tn)\)。&lt;/p&gt;</description></item><item><title>2021 年计数题康复训练</title><link>https://sichen-wang.github.io/blog/2021-%E5%B9%B4%E8%AE%A1%E6%95%B0%E9%A2%98%E5%BA%B7%E5%A4%8D%E8%AE%AD%E7%BB%83/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/2021-%E5%B9%B4%E8%AE%A1%E6%95%B0%E9%A2%98%E5%BA%B7%E5%A4%8D%E8%AE%AD%E7%BB%83/</guid><description>&lt;h2 id="技巧收集"&gt;技巧收集&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;将要计数的总体分成很多个部分，每个部分分别计算贡献。&lt;/li&gt;
&lt;li&gt;有些时候一个集合 \(S\) 联合产生贡献，为了避免算重，可以将这个集合的贡献放在其中的某个元素上计算，比如标号最小的那一个。&lt;/li&gt;
&lt;li&gt;可以考虑划分阶段，每次加入一个元素时计算答案增量。&lt;/li&gt;
&lt;li&gt;如果需要计算在一个大的部分中选择一些状态的方案数，可以将这个大的部分分为几个，枚举在这几个部分中选择的状态数量，再分别计算并相乘。&lt;/li&gt;
&lt;li&gt;可以先计算每一部分的答案，用某种数据结构维护，合并的时候考虑两个部分联合产生的答案。&lt;/li&gt;
&lt;li&gt;如果子问题的答案容易计算，并且原问题与子问题之间存在容斥关系，可以用 \(\rm DP\) 计算，转移的时候容斥。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="好题选做"&gt;好题选做&lt;/h2&gt;
&lt;h3 id="heading"&gt;
&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;方法一：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;首先有一个直观的想法，计算每条线段对答案的贡献。&lt;/p&gt;
&lt;p&gt;考虑将每个连通块的贡献放到这个连通块最左边的线段上去计算，于是我们发现在一种选择方案中，一条线段 \([l_{i},r_{i}]\) 有 \(1\) 的贡献当且仅当不存在另一条同时被选择的线段 \([l_{j},r_{j}]\) 满足 \(l_{j}\lt l_{i}\lt r_{j}\)，即其左端点不能被覆盖。&lt;/p&gt;
&lt;p&gt;因为题目保证了所有端点互不相同，所以我们不需要经过比较复杂的分类讨论，直接将线段按左端点排序，右端点用线段树维护即可。&lt;/p&gt;
&lt;p&gt;用线段树求出与当前线段不能同时选择的线段数，记为 \(x\)，则这条线段的贡献为 \(2^{n-x-1}\)。&lt;/p&gt;
&lt;p&gt;总时间复杂度 \(\Theta(n\log n)\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&amp;lt;bits/stdc++.h&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e9&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;pair&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;seg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;ST&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define LS (p &amp;lt;&amp;lt; 1)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define RS (p &amp;lt;&amp;lt; 1 | 1)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Build&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;LS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;RS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;LS&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;LS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;RS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;LS&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;RS&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Query&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;L&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;LS&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;Query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;LS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;RS&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;Query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;RS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;seg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;seg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seg&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seg&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ST&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;ST&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ST&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;方法二：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;还是考虑将线段按左端点排序后一个个加入并计算贡献，但是我们这次只考虑已经枚举了的 \(i\) 条线段的答案，记为 \(f_{i}\)。&lt;/p&gt;
&lt;p&gt;可以发现，如果当前枚举的线段不选，那么答案为 \(f_{i-1}\)，否则在选择某一个集合的时候答案会 \(+1\)，而这个集合中的线段即为右端点小于当前线段左端点的线段，记其数量为 \(x\)。 由于这个线段集合的每一个子集的答案都相比原来 \(+1\)，所以这种情况下的答案为 \(f_{i-1}+2^{x}\)。 故总的转移式为 \(f_{i}=2f_{i-1}+2^{x}\)。&lt;/p&gt;
&lt;p&gt;至于 \(x\) 的值可以很方便地在最开始用前缀和求出。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&amp;lt;bits/stdc++.h&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;2e5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e9&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;pair&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;seg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;seg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;seg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;seg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seg&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seg&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;seg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="heading-1"&gt;
&lt;/h3&gt;
&lt;p&gt;看上去很简单，代码也很简洁，但如果要证明而非直接打表的话是一个有一定难度的题。&lt;/p&gt;
&lt;p&gt;首先观察到题目限制等价于 \(\forall i'\leqslant i,j'\leqslant j,A_{i,j}\subseteq A_{i',j'}\)。&lt;/p&gt;
&lt;p&gt;又观察到如果对每个元素分开考虑，那么一定存在一条从左下到右上的分界线，使分界线左边的集合都有这个元素，而右边都没有，形如下图 ：&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="https://s2.ax1x.com/2020/02/11/1oskl9.png" alt="" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;容易发现，对于每个元素，这样的路径与每种方案一一对应，并且路径数为 \(2^{n}\)。&lt;/p&gt;
&lt;p&gt;进一步的，容易发现每个元素的方案相互独立，于是将每个元素的方案数相乘即为最终答案 \(2^{nk}\)。&lt;/p&gt;
&lt;p&gt;总时间复杂度 \(\Theta(\log n)\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&amp;lt;bits/stdc++.h&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e9&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Pow&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="heading-2"&gt;
&lt;/h3&gt;
&lt;p&gt;首先考虑在一个 \(k\times k\) 的矩形上放置 \(k\) 个车的方案数，显然为 \(k!\)。&lt;/p&gt;
&lt;p&gt;然后考虑在一个 \(n\times m\) 的矩形上放置 \(k\) 个车的方案数，可以先从 \(n\) 行 \(m\) 列中分别选出 \(k\) 行 \(k\) 列，再按照 \(k\times k\) 矩形的方式计算，方案数为 \(\binom{n}{k}\binom{m}{k}k!\)。&lt;/p&gt;
&lt;p&gt;考虑将原图形划分成右边一个 \(c\times d\) 的矩形和左边一个 \(a\times (b+d)\) 的矩形，然后枚举在右边放置多少个车，可以发现右边每放置一个车都可以使左边能放置车的行减少一个，于是容易独立计算两边的方案数，故答案为 :&lt;/p&gt;
\[
\sum_{i=0}^d \dbinom{c}{i}\dbinom{d}{i}i!\dbinom{a}{k-i}\dbinom{b+d-i}{k-i}(k-i)!
\]&lt;p&gt;总时间复杂度 \(\Theta(n)\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&amp;lt;bits/stdc++.h&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;2e3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Pow&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;C&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="heading-3"&gt;
&lt;/h3&gt;
&lt;p&gt;想这题时思路容易往如何建图上跑偏，但其实完全不用建图，直接对着原模型考虑即可。&lt;/p&gt;
&lt;p&gt;考虑从底层往上加水的过程，容易发现一些联通块会逐渐被连接在一起，可以考虑用并查集维护，两个连通块合并的答案显然为原本答案的乘积加上 \(1\)，因为所有的点都加上水也是一种方案。&lt;/p&gt;
&lt;p&gt;最终的答案即为所有连通块的方案数之积。&lt;/p&gt;
&lt;p&gt;总时间复杂度 \(\Theta(nm\log (nm))\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&amp;lt;bits/stdc++.h&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define int long long
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define idx(x, y) ((x - 1) * m + y)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e9&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Find&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;signed&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;.&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;))]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;.&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;.&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;))]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;))]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;))]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;))]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;.&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;endl&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="heading-4"&gt;
&lt;/h3&gt;
&lt;p&gt;运用插板法和捆绑法易得答案即为 ：&lt;/p&gt;
\[
(n + 2)! A_{n + 3}^{m} - 2 (n + 1)! A_{n + 2}^{m}
\]&lt;p&gt;高精差评。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&amp;lt;bits/stdc++.h&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;2e3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;BigInt_Class&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;MaxL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;5e3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="nc"&gt;BigInt&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;MaxL&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Clear&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;read&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;MaxL&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%s&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;strlen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;0&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Write&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;End&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;putchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;End&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="k"&gt;operator&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="nf"&gt;Change&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Clear&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="k"&gt;operator&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Clear&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="k"&gt;operator&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Clear&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="k"&gt;operator&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Clear&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="k"&gt;operator&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Clear&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Clear&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="k"&gt;operator&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Clear&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;BigInt_Class&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;BigInt&lt;/span&gt; &lt;span class="nf"&gt;A&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;Change&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Change&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Change&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;A&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;Change&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;A&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;\n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="heading-5"&gt;
&lt;/h3&gt;
&lt;p&gt;看到题目一眼二项式反演，但事实上是不行的。&lt;/p&gt;
&lt;p&gt;考虑钦点 \(m\) 个位置 \(a_{i}=i\)，剩下的显然是 \(n - m\) 个数的错排问题。&lt;/p&gt;
&lt;p&gt;记 \(D_{n}\) 表示 \(n\) 个数的错排问题方案数，推导其递推式 ：&lt;/p&gt;
&lt;p&gt;考虑在 \(n\) 个数的基础上再加入第 \(n + 1\) 个数，不妨设 \(a_{n+1}=k\)。&lt;/p&gt;
&lt;p&gt;接下来对 \(a_{k}\) 做分类讨论 ：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;如果 \(a_{k}=n+1\)，那么 \(k\) 和 \(n+1\) 互相占用，剩下的方案数为 \(D_{n-1}\)。&lt;/li&gt;
&lt;li&gt;如果 \(a_{k}\not = n + 1\)，那么除了 \(a_{n + 1}\) 已经被确定之外，其它所有位置都有且仅有一个数不能填 （位置 \(k\) 不能填的数为 \(n + 1\)），于是方案即为 \(D_{n}\)。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;再考虑到选取 \(k\) 的方式有 \(n\) 种，故 \(\{D_{n}\}\) 的递推式为 ：&lt;/p&gt;
\[
D_{n + 1} = n(D_n + D_{n - 1})
\]&lt;p&gt;根据错排数列的定义易知 \(D_{0} = 1, D_{1} = 0,D_{2} = 1\)。&lt;/p&gt;
&lt;p&gt;综上，答案即为 \(\binom{n}{m}D_{n-m}\)。&lt;/p&gt;
&lt;p&gt;总时间复杂度 \(\Theta(T+n)\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&amp;lt;bits/stdc++.h&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e6&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e9&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Pow&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;C&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%lld&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="heading-6"&gt;
&lt;/h3&gt;
&lt;p&gt;考虑到一段区间内的方案数是独立的，于是使用区间 \(\rm DP\) 求解。&lt;/p&gt;
&lt;p&gt;可以发现我们关心的状态除了区间端点 \(l,r\) 外，还有上一个填入值的大小，因为这关系到现在这个数填在左边还是右边。同时，我们观察到，上一个数只有可能填在区间的左端点或右端点，于是记 \(f_{l,r,0/1}\) 表示在 \([l,r]\) 这段区间内，上一次填的数在左端点\(/\)右端点的方案数。&lt;/p&gt;
&lt;p&gt;转移是简单的，分 \(4\) 种情况 ：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;\(a_{i}\lt a_{i + 1},f_{i,j,0}\leftarrow f_{i+1,j,0}\)&lt;/li&gt;
&lt;li&gt;\(a_{i}\lt a_{j},f_{i,j,0}\leftarrow f_{i+1,j,1}\)&lt;/li&gt;
&lt;li&gt;\(a_{j}\gt a_{i},f_{i,j,1}\leftarrow f_{i,j-1,0}\)&lt;/li&gt;
&lt;li&gt;\(a_{j}\gt a_{j-1},f_{i,j,1}\leftarrow f_{i,j-1,1}\)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;需要注意的是，赋初值时，可以钦点 \([i,j]\) 的数是从左端点填进去的，即 \(f_{i,i,0} = 1\)，如果不这样做的话会算重。&lt;/p&gt;
&lt;p&gt;总时间复杂度 \(\Theta(n^{2})\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&amp;lt;bits/stdc++.h&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;19650827&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;endl&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="heading-7"&gt;
&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;形式化题意：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;定义全集 \(U=\{1,2,3,\cdots ,n\}\)，要从中选出 \(m\) 个子集，满足 ：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;任意子集非空。&lt;/li&gt;
&lt;li&gt;子集互不相同。&lt;/li&gt;
&lt;li&gt;在选出的 \(m\) 个子集中，\(1\sim n\) 中每个数的出现次数均为偶数。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;求方案数对 \(10^{8} + 7\) 取模后的值。&lt;/p&gt;
&lt;p&gt;保证 \(n,m\leqslant 10^{6}\)。&lt;/p&gt;
&lt;p&gt;考虑计算选出子集有序的方案数，容易发现最后将方案数除以 \(m!\) 就与原问题等价。&lt;/p&gt;
&lt;p&gt;记 \(f_{i}\) 表示从 \(U\) 中选出 \(i\) 个合法子集的方案数，转移考虑容斥 ：&lt;/p&gt;
&lt;p&gt;如果前面的 \(i - 1\) 个集合已经确定，那么这个集合中每个元素是否存在就已经被确定了，并且一定存在一种选择这个集合的方案，故在不考虑子集非空和子集互不相同的情况下，方案数为 \(A_{2^{n} - 1}^{i - 1}\)。&lt;/p&gt;
&lt;p&gt;考虑将第 \(i\) 个集合为空的方案去除。可以发现在第 \(i\) 个集合为空的情况下，不合法方案与 \(f_{i - 1}\) 中的每种合法方案一一对应，故第 \(i\) 个集合为空的方案数为 \(f_{i - 1}\)。&lt;/p&gt;
&lt;p&gt;考虑将第 \(i\) 个集合与前面某个集合 \(S_{j}\) 相同的方案去除。可以发现，将 \(S_{i}\) 和 \(S_{j}\) 同时去除后的方案还是合法的，且数量为 \(f_{i - 2}\)。 \(j\) 有 \(i - 1\) 种取值，\(S_{i}\) 和 \(S_{j}\) 由于不能与另外 \(i - 2\) 个集合相同，所以有 \((2^{n} - 1) - (i - 2)\) 种取法。故第 \(i\) 个集合与之前某个集合相同的方案数为 \(f_{i - 2}\times (i - 1)\times (2^{n} - i + 1)\)。&lt;/p&gt;
&lt;p&gt;故转移方程为 ：&lt;/p&gt;
\[
f_{i} = A_{2^n - 1}^{i - 1} - f_{i - 1} - f_{i - 2}\times (i - 1)\times (2^n - i + 1)
\]&lt;p&gt;经过一些预处理后可以做到 \(\Theta(n)\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&amp;lt;bits/stdc++.h&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e6&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e8&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;A&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Pow&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;A&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;A&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;A&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;A&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;A&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;A&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;A&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;A&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;M&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;M&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;M&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;endl&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="heading-8"&gt;
&lt;/h3&gt;
&lt;p&gt;可以发现
是这个题的弱化版，但区别不算很大。&lt;/p&gt;
&lt;p&gt;考虑依据偏序关系连边，可以发现构成一颗满足小根堆性质的树。&lt;/p&gt;
&lt;p&gt;记 \(f_{i}\) 表示以点 \(i\) 为根的子树的方案数，显然子树内答案独立，故只需要考虑乘上分配给子树的方案数即可得 ：&lt;/p&gt;
\[
siz_i = siz_{2i} + siz_{2i + 1} + 1
\]\[
f_i = f_{2i}\times f_{2i + 1}\times \dbinom{siz_i - 1}{siz_{2i}}
\]&lt;p&gt;因为模数有可能小于 \(n\)，所以求组合数需要用到 \(\rm Lucas\) 定理。&lt;/p&gt;
&lt;p&gt;需要注意的是，在预处理阶乘逆元的时候最多预处理到 \(\rm mod - 1\)，否则会出现为 \(0\) 的情况。&lt;/p&gt;
&lt;p&gt;总时间复杂度 \(\Theta(n\log n)\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&amp;lt;bits/stdc++.h&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;2e6&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Min&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;siz&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Pow&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Lucas&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Lucas&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Lucas&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Min&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Min&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Min&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Min&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Min&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;siz&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;siz&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;siz&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;siz&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Lucas&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;siz&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;siz&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>2022 年新一卷数学第 7 题另解</title><link>https://sichen-wang.github.io/blog/2022-%E5%B9%B4%E6%96%B0%E4%B8%80%E5%8D%B7%E6%95%B0%E5%AD%A6%E7%AC%AC-7-%E9%A2%98%E5%8F%A6%E8%A7%A3/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/2022-%E5%B9%B4%E6%96%B0%E4%B8%80%E5%8D%B7%E6%95%B0%E5%AD%A6%E7%AC%AC-7-%E9%A2%98%E5%8F%A6%E8%A7%A3/</guid><description>&lt;p&gt;设 \(a = 0.1 e^{0.1}, b = \frac{1}{9}, c = -\ln 0.9\)，试比较 \(a, b, c\) 的大小。&lt;/p&gt;
&lt;p&gt;考虑到以下公式：&lt;/p&gt;
\[
e ^ {qx} = \sum _ {n} q ^ n \frac{x ^ n}{n!} \tag{7.1}
\]\[
\ln(1 + x) = \sum _ n (-1) ^ n \frac{x ^ {n + 1}}{n + 1} \tag{7. 2}
\]&lt;p&gt;将 \(a\) 带入式 \((7. 1)\) 可得：&lt;/p&gt;
\[
\begin{aligned}
a &amp;= 0.1(1 + 0.1 + \frac{0.01}{2} + \frac{0.001}{6} + \cdots) \\
&amp;= 0.1 + 0.01 + \frac{0.001}{2} + \frac{0.0001}{6} + \cdots
\end{aligned}
\]&lt;p&gt;将 \(c\) 带入式 \((7.2)\) 可得：&lt;/p&gt;
\[
\begin{aligned}
c &amp;= \ln (1 + \frac{1}{9}) \\
&amp;= \frac{1}{9} - \frac{\frac{1}{9 ^ 2}}{2} + \frac{\frac{1}{9 ^ 3}}{3} - \cdots
\end{aligned}
\]&lt;p&gt;分解 \(b\) 是简单的：&lt;/p&gt;
\[
b = 0.111\cdots = 0.1 + 0.01 + 0.001 + \cdots
\]&lt;p&gt;此时 \(b \gt a, c\) 应当是一目了然的，于是考虑对比 \(a, c\) 的大小。&lt;/p&gt;
&lt;p&gt;取 \(c' = \frac{1}{9} - \frac{1}{2 \times 81} + \frac{1}{3 \times 729} \gt c\)，不够好算，再取 \(c'' = \frac{1}{9} - \frac{1}{400} + \frac{1}{2000} = \frac{1}{9} - 0.002 \gt c'\)。&lt;/p&gt;
&lt;p&gt;取 \(a' = 0.1 + 0.01 \lt a\)，易知 \(c'' \lt a'\)，于是 \(c \lt c' \lt c'' \lt a' \lt a\)。&lt;/p&gt;
&lt;p&gt;综上，有 \(c \lt a \lt b\)。&lt;/p&gt;</description></item><item><title>AC 自动机</title><link>https://sichen-wang.github.io/blog/ac-%E8%87%AA%E5%8A%A8%E6%9C%BA/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/ac-%E8%87%AA%E5%8A%A8%E6%9C%BA/</guid><description>&lt;h3 id="失配指针"&gt;失配指针&lt;/h3&gt;
&lt;p&gt;定义 fail 为广义的 \(\pi\) 函数，即对于 \(n\) 个字符串，\(fail_{i,j}=\max\limits_{k=1}^{n} \pi(S_{k}\#S_{i,1\sim j})\)。&lt;/p&gt;
&lt;p&gt;上面那个是一种定义，但事实上，在 \(\rm AC\) 自动机中，fail 是具有指向性的，它指向的是所有模式串中，前缀与当前字符串某个前缀的后缀匹配可以产生最大匹配的那个串，它与当前串匹配的最后一个结点。&lt;/p&gt;
&lt;h3 id="构建-ac-自动机"&gt;构建 AC 自动机&lt;/h3&gt;
&lt;p&gt;首先对所有模式串建立 Trie 树，显然 Trie 树上的每一个结点都对应某个模式串的某个前缀。&lt;/p&gt;
&lt;p&gt;然后将每个 fail 都指向匹配的结点，显而易见，所有的 fail 都指向一个祖先节点，这个性质后面要用到。&lt;/p&gt;
&lt;p&gt;最后构建转移边 Auto，Auto 指向跳 fail 过程中存在字符 \(c\) 的结点。&lt;/p&gt;
&lt;p&gt;具体来说，可以以 \(\rm BFS\) 序遍历 Trie 树，在遍历的同时更新答案，转移式如下：&lt;/p&gt;
\[
\begin{cases}
fail_u = Auto_{fail_{fa_u}, c} \\
Auto_{u, c} = Auto_{fail_u, c}
\end{cases}
\]&lt;p&gt;建 \(\rm AC\) 自动机复杂度为 \(\Theta(|\Sigma|n)\)。&lt;/p&gt;
&lt;h3 id="文本串匹配"&gt;文本串匹配&lt;/h3&gt;
&lt;p&gt;遍历文本串，直接按照转移边走即可，如果要统计每个模式串出现的次数，就将所有经过的点权值 \(+1\)，再在 fail 树上差分即可计算。&lt;/p&gt;
&lt;p&gt;令模式串为 \(S\)，文本串为 \(T\)，总时间复杂度为 \(\Theta(|\Sigma||S|+|T|)\)。&lt;/p&gt;
&lt;p&gt;例题：
&lt;/p&gt;
&lt;p&gt;首先有一个显然的 \(\Theta(|s|\sum|t|)\) 暴力，枚举文本串的转移点，显然其不能超过最大串长，转移式为：&lt;/p&gt;
\[
f_i=\bigvee_{j=i-|s|}^{i-1}\{f_j\wedge[t_{j+1\sim i}\in s]\}
\]&lt;p&gt;这个式子的核心在于，\(f_{i}=true\) 当且仅当它存在一个后缀，这个后缀是某个模式串，并且删去这个后缀以后的文本串仍合法。&lt;/p&gt;
&lt;p&gt;于是考虑建立 \(\rm AC\) 自动机，将文本串放在自动机上跑的时候记 \(f_{i}\) 表示当前前缀是否合法。&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;存在如下 \(\rm AC\) 自动机性质：如果 \(v\) 可以从 \(u\) 开始由跳 fail 得到，即 fail 树上 \(v\) 是 \(u\) 的祖先，那么 \(v\) 代表的字符串是 \(u\) 代表的字符串的一个后缀。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;所以从 \(u\) 开始遍历跳 fail 经过的结点，如果它代表的字符串长度为 \(l\)，且为某个模式串的结尾，则将 \(g_{u,l}\) 记为 true。 由于 \(|s|\leqslant 10\)，所以只有当 \(l\leqslant 10\) 的时候 \(g_{u,l}\) 可能为 true，故直接状压成 \(g_{u}\)，其二进制下第 \(l\) 位表示之前 \(g_{u,l}\) 的值。&lt;/p&gt;
&lt;p&gt;最后直接将文本串放在 \(\rm AC\) 自动机上跑即可，记 \(now_{i}\) 表示文本串中当前点前 \(i\) 位的 \(f\) 值为多少，易知 \(i\leqslant 10\)，故也可以状压成一个数 \(now\)。 易知 \(f_{i}=true\) 当且仅当 \([now \operatorname{or} g_{u}]=true\)。&lt;/p&gt;
&lt;p&gt;总时间复杂度 \(\Theta(|\Sigma|n|s|^{2}+m|t|)\)。&lt;/p&gt;</description></item><item><title>AtCoder Beginner Contest 212</title><link>https://sichen-wang.github.io/blog/atcoder-beginner-contest-212/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/atcoder-beginner-contest-212/</guid><description>&lt;h2 id="e"&gt;E&lt;/h2&gt;
&lt;p&gt;考虑记 \(f_{i, u}\) 表示走 \(i\) 步到 \(u\) 的方案数。显然有转移式：&lt;/p&gt;
\[
f_{i, u} = \sum _ {(u, v) \in Edge} f_{i - 1, v}
\]&lt;p&gt;状态数为 \(nk\)，转移的时间复杂度为 \(\Theta(n)\)，于是总时间复杂度为 \(\Theta(n^{2} k).\)&lt;/p&gt;
&lt;p&gt;考虑到删除的边数很少，于是将转移方程改写为：&lt;/p&gt;
\[
f_{i, u} = \sum _ {v = 1} ^ n f_{i - 1, v} - \sum _ {(u, v) \not\in Edge} f_{i - 1, v}
\]&lt;p&gt;前一项可以算完每个 \(i\) 以后记录一下，后一项合法转移数量之和为 \(m\)，于是总时间复杂度被优化至 \(\Theta(nk + mk).\)&lt;/p&gt;
&lt;h2 id="f"&gt;F&lt;/h2&gt;
&lt;p&gt;看到这个题，我们首先想到的肯定是倍增。&lt;/p&gt;
&lt;p&gt;但是细想一下可以发现，从一个点 \(i\) 开始跳 \(2^{j}\) 步到的地方还与时间有关，是难以处理的。&lt;/p&gt;
&lt;p&gt;我们考虑记 \(f_{i, j}\) 表示从 \(i\) 号&lt;strong&gt;路径&lt;/strong&gt;开始，跳 \(2^{j}\) 步到的地方，容易发现此时 \(f_{i, j}\) 的值是唯一的。&lt;/p&gt;
&lt;p&gt;于是用 \(\rm set\) 维护出 \(y\) 号点在 \(x\) 时刻开始要走上的路径，然后不断往后跳，直到停在最后一个时间不大于 \(z\) 的位置，判断一下是停在路上还是停在点上即可。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n \log n + q \log n).\)&lt;/p&gt;
&lt;h2 id="g"&gt;G&lt;/h2&gt;
&lt;p&gt;首先考虑到当 \(x = 0\) 时有且仅有 \(y = 0\) 满足条件，于是我们不妨设 \(1 \leqslant x, y \lt P\)，最后再给答案加上 \(1\)。&lt;/p&gt;
&lt;p&gt;考虑 \(P\) 的一个原根 \(r\)，设 \(x = r^{a}, y = r^{b}\)，容易发现 \((x, y)\) 与 \((a, b)\) 一一对应，于是有：&lt;/p&gt;
\[
x ^ n \equiv y \iff r ^ {an} \equiv r ^ b \pmod P
\]&lt;p&gt;考虑拓展欧拉定理，可以发现：&lt;/p&gt;
\[
r ^ {an} \equiv r ^ b \pmod P \iff an \equiv b \pmod {P - 1}
\]&lt;p&gt;于是问题被转化为求满足 \(an \equiv b \pmod {P - 1}\) 的 \((a, b)\) 数量。&lt;/p&gt;
&lt;p&gt;根据裴蜀定理，可以推导出：&lt;/p&gt;
\[
\sum _ {a = 1} ^ {P - 1} \sum _ {b = 1} ^ {P - 1} [an \equiv b \pmod {P - 1}] = \sum _ {a = 1} ^ {P - 1} \frac{P - 1}{(P - 1, a)}
\]&lt;p&gt;考虑对 \((P - 1, a)\) 相等的 \(a\) 一起计算。设 \(f(g)\) 表示满足 \(g = (P - 1, a)\) 的 \(a\) 的数量。可以发现 \(g \mid P - 1\) 且 \(f(g) = \varphi\left(\frac{P - 1}{g}\right)\)。&lt;/p&gt;
&lt;p&gt;考虑求解 \(\varphi(n)\)，观察到 \(\varphi \times I = id\)，于是有：&lt;/p&gt;
\[
\varphi(n) = n - \sum _ {d \mid n,\ d \not= n} \varphi(d)
\]&lt;p&gt;进一步有：&lt;/p&gt;
\[
f(g) = \frac{P - 1}{g} - \sum _ {g \mid k,\ g \not= k} f(g)
\]&lt;p&gt;从大到小枚举 \(g\)，枚举其倍数转移一下即可，时间复杂度 \(\Theta(\sqrt{P} + d^{2}(P - 1))\)。&lt;/p&gt;
&lt;h2 id="h"&gt;H&lt;/h2&gt;
&lt;p&gt;考虑记 \(w + 1\) 为第一个大于所有 \(a_{i}\) 的 \(2\) 的幂，\(S\) 为 \(a\) 序列中数构成的集合。&lt;/p&gt;
&lt;p&gt;造一个集合幂级数 \(F(x) = \sum_{i = 0}^{w} [i \in S]x^{i}\)，容易发现答案即为：&lt;/p&gt;
\[
\sum _ {i = 1} ^ n \left(k ^ i - [x ^ 0] F^i(x) \right)
\]&lt;p&gt;利用 \(\rm FWT\) 的线性性推一推式子：&lt;/p&gt;
\[
\begin{aligned}
&amp;~~~~~\sum _ {i = 1} ^ n \left(k ^ i - [x ^ 0] F^i(x) \right) \\
&amp;=\sum _ {i = 1} ^ n \left( k ^ i - [x ^ 0] \textrm{IFWT}(\textrm{FWT}\cdot F^i (x)) \right) \\
&amp;=\sum _ {i = 1} ^ n k ^ i - [x ^ 0] \textrm{IFWT}\left( \sum _ {i = 1} ^ n \textrm{FWT} \cdot F^i(x)\right)
\end{aligned}
\]&lt;p&gt;\(\rm FWT\) 后 \(F\) 的幂表示对每一项系数做点乘。&lt;/p&gt;
&lt;p&gt;设 \(G(x) = \textrm{FWT} \cdot F(x)\)，用一下等比数列求和公式，则有答案为：&lt;/p&gt;
\[
\sum _ {i = 1} ^ n k ^ i - [x ^ 0] \textrm{IFWT}\left[ \sum _ {i = 0} ^ w \left( \frac{g_i ^ {n + 1} - g_i}{g_i - 1} \right)x ^ i \right]
\]&lt;p&gt;计算上式所需时间复杂度为 \(\Theta((n + w) \log (n + w)).\)&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;</description></item><item><title>AtCoder Beginner Contest 213</title><link>https://sichen-wang.github.io/blog/atcoder-beginner-contest-213/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/atcoder-beginner-contest-213/</guid><description>&lt;h2 id="e"&gt;E&lt;/h2&gt;
&lt;p&gt;考虑使用 \(\rm bfs\)。&lt;/p&gt;
&lt;p&gt;观察到每一步的代价都是 \(0\) 或 \(1\)，于是建立双端队列。每次迭代取队头，如果走了代价为 \(0\) 的边就将出点加入队首，否则加入队尾。&lt;/p&gt;
&lt;p&gt;考虑其正确性，因为走代价为 \(0\) 的边不会增加当前点的答案，所以可以维护住当前取出的点一定是答案最小点的性质。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(nm)\)。&lt;/p&gt;
&lt;p&gt;另外，这种模型还可拓展到代价为 \(0 \sim k\)，只需要对每种贡献维护一个队列即可，容易发现仍然满足单调性。时间复杂度 \(\Theta(nk)\)。&lt;/p&gt;
&lt;h2 id="g"&gt;G&lt;/h2&gt;
&lt;p&gt;考虑使用状压 \(\rm DP\)。&lt;/p&gt;
&lt;p&gt;设 \(f_{S}\) 表示仅考虑 \(S\) 的导出子图，令它与 \(1\) 连通的方案数。设 \(cnt_{S}\) 表示 \(S\) 导出子图中的边数，显然有：&lt;/p&gt;
\[
ans_k = \sum _ {1, k \in S} f_S \times 2 ^ {cnt_{U-S}}
\]&lt;p&gt;考虑容斥求解 \(f_{S}\)，有：&lt;/p&gt;
\[
f_S = 2 ^ {cnt_S} - \sum _ {1 \in T, T \subsetneq S} f_T \times 2 ^ {cnt_{S - T}}
\]&lt;p&gt;求解两部分的时间复杂度分别为 \(\Theta(n^{2} 2^{n})\) 和 \(\Theta(3^{n})\)。&lt;/p&gt;
&lt;p&gt;另外，后半部分可以使用 \(\rm FWT\) 优化或卷积做到 \(\Theta(n^{2} 2^{n})\)。&lt;/p&gt;
&lt;h2 id="h"&gt;H&lt;/h2&gt;
&lt;p&gt;考虑 \(\rm DP\)。设 \(f_{i, j}\) 表示到 \(i\) 为止经过长度为 \(j\) 的路径的方案数，记 \(E_{u, v, w}\) 表示从 \(u\) 到 \(v\) 长度为 \(w\) 的路径数量。显然有转移方程：&lt;/p&gt;
\[
f_{i, j} = \sum _ {k = 1} ^ n \sum _ {l = 1} ^ T f_{k, j - l} \times E_{k, i, l}
\]&lt;p&gt;考虑用 \(\rm GF\) 拟合这个过程，设 \(F_{i}(x) = \sum \limits_{j} f_{i, j} x^{j}\)，\(G_{i, j}(x) = \sum \limits_{k \geqslant 1} E_{i, j, k} x^{k}.\) 有方程：&lt;/p&gt;
\[
F_i(x) = \sum _ {j = 1} ^ n F_j(x) \times G_{j, i}(x)
\]&lt;p&gt;使用分治多项式乘法即可，时间复杂度 \(\Theta(n^{2} T \log^{2} T)\)。&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;</description></item><item><title>AtCoder Beginner Contest 214</title><link>https://sichen-wang.github.io/blog/atcoder-beginner-contest-214/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/atcoder-beginner-contest-214/</guid><description>&lt;h2 id="d"&gt;D&lt;/h2&gt;
&lt;p&gt;考虑枚举最大边，分别计算从两个端点出发能走到多少个点。&lt;/p&gt;
&lt;p&gt;可以发现并查集能够很好地拟合这个过程，于是将边从小到大加入，每次合并的两个点集即为所求。&lt;/p&gt;
&lt;h2 id="e"&gt;E&lt;/h2&gt;
&lt;p&gt;考虑贪心。从小到大枚举每一个盒子 \(i\)，所有满足 \(L \leqslant i\) 的球都可以放进这个盒子（如果 \(R \lt i\) 则无解），容易发现要选择 \(R\) 最小的球放进当前盒子。&lt;/p&gt;
&lt;p&gt;但是由于盒子数量很大，所以不能枚举盒子。考虑将所有区间按 \(L\) 从小到大排序，记 \(p\) 表示当前填到哪个盒子了，将所有满足 \(L \leqslant p\) 的盒子以 \(R\) 为关键字加入小根堆，此时维护 \(p\) 是简单的。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n \log n)\)。&lt;/p&gt;
&lt;h2 id="f"&gt;F&lt;/h2&gt;
&lt;p&gt;首先考虑求解本质不同子序列数量。设 \(f_{i}\) 表示考虑到 \(s_{i}\) 且 \(s_{i}\) 必选的方案数。&lt;/p&gt;
&lt;p&gt;可以发现不同子序列个数是好求的，转移方程为 \(f_{i} = \sum \limits_{j = 0}^{i - 1} f_{j}\)，但如何去除重复的子序列呢？&lt;/p&gt;
&lt;p&gt;令 \(k\) 为满足 \(s_{k} = s_{i}, k \lt i\) 的最大整数，注意到在这种转移方式下会得出相同的子序列当且仅当在 \(f_{j} (j \lt k)\) 的后面直接接上了 \(s_{i}\)，于是本质不同子序列计数的转移方程为 \(f_{i} = \sum \limits_{j = 0}^{i - 1} f_{j} - \sum \limits_{j = 0}^{k - 1} f_{j} = \sum \limits_{j = k}^{i - 1} f_{j}.\)&lt;/p&gt;
&lt;p&gt;而子序列中相邻两字符在原串中不相同的限制是好保证的，只需要考虑其不同子序列个数的转移方程为 \(f_{i} = \sum \limits_{j = 0}^{i - 2} f_{j}\) 对后面的推导稍作修改即可得到本质不同子序列计数的转移方程为 \(f_{i} = \sum \limits_{j = k - 1}^{i - 2} f_{j}\).&lt;/p&gt;
&lt;p&gt;记录一下每个字符 \(c\) 当前最后出现的位置，同时做前缀和优化即可做到 \(\Theta(1)\) 转移。&lt;/p&gt;
&lt;h2 id="g"&gt;G&lt;/h2&gt;
&lt;p&gt;首先可以将 \(q_{i}\) 对 \(p_{i}\) 做置换，将限制转换成 \(r_{i} \not= i, a_{i}\) 的形式。&lt;/p&gt;
&lt;p&gt;考虑将 \(i\) 向 \(a_{i}\) 连边，得到若干置换环。这时候问题可以重新描述为“每个点的取值不能为自身权值或后一个点的权值。”&lt;/p&gt;
&lt;p&gt;考虑容斥，需要对每个 \(k\) 分别计算“恰有 \(k\) 个点不满足限制的方案数”。容易发现可以对每个环分别计算，于是考虑在一个长度为 \(m\) 的置换环上如何计算。&lt;/p&gt;
&lt;p&gt;考虑设 \(f_{i, j, 0/1/2}\) 表示当前考虑到第 \(i\) 个点，前 \(i\) 个点中共有 \(j\) 个点的取值不满足限制，且第 \(i\) 个点的取值为（自身/后一个点/两者皆不）的方案数。转移之前枚举第一个点的取值状态，转移时两个状态之间不能转移当且仅当前一个点的取值为后一个点且后一个点的取值为它自身权值。最后统计方案时判断一下最后一个点的状态能否与枚举的第一个点的状态拼合即可。&lt;/p&gt;
&lt;p&gt;将每个环的方案数算出来后只需要每次取两个最小的环使用暴力多项式乘法即可，容易证明时间复杂度是 \(\Theta(n^{2})\) 的。&lt;/p&gt;
&lt;p&gt;最后考虑如何计算答案。若设恰好有 \(k\) 个点的取值不满足限制的方案数为 \(g_{k}\)，则根据二项式反演公式，最终答案为：&lt;/p&gt;
\[
\sum _ {i = 0} ^ {n} (-1) ^ i \dbinom{n}{i} g_i \times (n - i)!
\]&lt;p&gt;其中 \((n - i)!\) 是不满足限制的点的取值确定后，其它点的取值随意排列的方案数。&lt;/p&gt;
&lt;p&gt;总时间复杂度 \(\Theta(n^{2})\)。&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;</description></item><item><title>AtCoder Beginner Contest 247</title><link>https://sichen-wang.github.io/blog/atcoder-beginner-contest-247/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/atcoder-beginner-contest-247/</guid><description>&lt;h2 id="e"&gt;E&lt;/h2&gt;
&lt;p&gt;考虑枚举右端点 \(R\)，计算对于每个 \(R\) 有多少个左端点 \(L\) 满足条件。&lt;/p&gt;
&lt;p&gt;左端点需要满足的条件如下：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;\([L, R]\) 中需要有 \(x\) 和 \(y\) 至少各一个。&lt;/li&gt;
&lt;li&gt;\([L, R]\) 中不能出现比 \(x\) 大或比 \(y\) 小的元素。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;转化条件：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;设 \(px\) 表示 \([1, R]\) 中最右边 \(x\) 的位置，\(py\) 表示 \([1, R]\) 中最右边 \(y\) 的位置，\(L \leqslant \min(px, py)\)。&lt;/li&gt;
&lt;li&gt;设 \(gex\) 表示 \([1, R]\) 中最右边大于 \(x\) 的位置，\(ley\) 表示 \([1, R]\) 中最右边小于 \(y\) 的位置，\(L \gt \max(gex, ley)\)。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;于是只需要在枚举 \(R\) 的同时维护 \(px, py, gex, ley\) 并将 \(\min(px, py) - \max(gex, ley)\) 计入答案即可。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n)\)。&lt;/p&gt;
&lt;h2 id="f"&gt;F&lt;/h2&gt;
&lt;p&gt;考虑到每个数都需要存在，并且它在恰好两个位置中出现过（这两个位置可能相同），于是将这两个位置在一张图中连无向边。&lt;/p&gt;
&lt;p&gt;观察到每个点度数都恰好为 \(2\)，于是连边后构成若干个环。&lt;/p&gt;
&lt;p&gt;易知，整体方案数为每个环方案数的乘积，每个环的方案数为点覆盖方案数。&lt;/p&gt;
&lt;p&gt;考虑求解大小为 \(m\) 的环的点覆盖方案数。考虑强行将环从 \(n \sim 1\) 处拆成链，设 \(f_{i, 0/1}\) 表示仅考虑 \(1 \sim i\) 的链，中间每条边都至少有一个端点被选，第 \(i\) 个点被选或不选的方案数。转移是简单的。但是我们发现最后计算答案时需要知道第一个点到底选没选，于是需要钦点第一个点选或不选分别转移。&lt;/p&gt;
&lt;p&gt;将转移方程写出来后，我们观察到它其实是两个斐波那契状物之和，于是用数列 \(f_{1} = 1, f_{2} = 3, f_{i} = f_{i - 1} + f_{i - 2}\) 来拟合是可行的（当然也可以直接算，复杂度不变，代码也没长多少）。&lt;/p&gt;
&lt;p&gt;综上即可算出原问题答案，时间复杂度 \(\Theta(n)\)。&lt;/p&gt;
&lt;h2 id="code-link"&gt;
&lt;/h2&gt;</description></item><item><title>KMP 算法 &amp; KMP 自动机</title><link>https://sichen-wang.github.io/blog/kmp-%E7%AE%97%E6%B3%95-kmp-%E8%87%AA%E5%8A%A8%E6%9C%BA/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/kmp-%E7%AE%97%E6%B3%95-kmp-%E8%87%AA%E5%8A%A8%E6%9C%BA/</guid><description>&lt;h2 id="border--pi-函数"&gt;Border &amp;amp; pi 函数&lt;/h2&gt;
&lt;h3 id="一些定义"&gt;一些定义&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;字符串 \(S\) 的真前/后缀为非自身的前/后缀。&lt;/li&gt;
&lt;li&gt;字符串 \(S\) 的 border为 \(S\) 的公共真前/后缀。&lt;/li&gt;
&lt;li&gt;字符串 \(S\) 的最长 border 为 \(\pi\)，对于 \(S\) 的每个前缀 \(S_{1 \sim i}\) 令 \(\pi_{i}\) 为其最长 border，\(\pi\) 函数就是所谓的前缀函数。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="pi-函数的性质"&gt;pi 函数的性质&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;\(\forall i,\pi_{i+1}\leqslant \pi_{i}+1\)。&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;由反证法易知。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;字符串 \(S\) 的所有 border 可以由 \(\pi_{|S|}\) 开始不断跳 \(\pi\) 由长度从大到小遍历。&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;只需证明 \(S_{1 \sim \pi_{\pi_{n}}}\) 是 \(S\) 的次长 border 即可。&lt;/p&gt;
&lt;p&gt;由 \(\pi\) 的定义易知。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;相邻前缀函数满足 \(\pi_{i + 1} = \max\limits_{T \ is \ the \ border \ of \ S_{1 \sim i}, S_{i + 1} = S_{|T| + 1}} |T| + 1\)。&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;使用反证法易知。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id="pi-函数的线性求法"&gt;pi 函数的线性求法&lt;/h3&gt;
&lt;p&gt;有了上述几条性质，我们可以得到一个求解 \(\pi\) 函数的算法：&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;pi&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pi&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pi&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;pi&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;直观感受上这个做法是 \(\Theta(n^{2})\) 的，但实际上它是线性的，复杂度证明如下：&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;不难发现复杂度来源在于跳 \(\pi\)，下面我们将证明跳 \(\pi\) 的总次数是线性的。&lt;/p&gt;
&lt;p&gt;注意 \(\pi_{i}\) 的位置变化情况，不难发现 \(\pi_{i}\) 只会每次 \(+1\) 或往前跳若干次，但往前跳的的总距离不能超过当前 \(+1\) 的次数，故总路程也是线性的。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id="pi-函数的基本应用"&gt;pi 函数的基本应用&lt;/h3&gt;
&lt;h4 id="字符串匹配"&gt;字符串匹配&lt;/h4&gt;
&lt;p&gt;求解模式串 \(T\) 在匹配串 \(S\) 中的出现位置的问题。&lt;/p&gt;
&lt;p&gt;构造一个新的字符串 \(T\circ S\)，其中 \(\circ\not\in S\cup T\)，它仅作为一个分隔符。&lt;/p&gt;
&lt;p&gt;对这个新的字符串求其 \(\pi\) 函数，不难发现由于分隔符的出现，\(\forall i, \pi_{i} \leqslant |T|\)，于是找到 \(\pi_{i} = |T|\) 的位置，\(i - |T| + 1 \sim i\) 就是一个匹配。&lt;/p&gt;
&lt;p&gt;以上即为 \(\rm KMP\) 算法。&lt;/p&gt;
&lt;h4 id="统计每个前缀的出现次数"&gt;统计每个前缀的出现次数&lt;/h4&gt;
&lt;p&gt;考虑到如果某个前缀在之后的位置里出现过，那么一定是某个前缀的 border，于是我们考虑在每个数的最大 border 处统计答案，其为更小 border 的重复次数，并且更小的 border 一定可以通过跳 \(\pi\) 遍历到，这样只需要从后往前扫一遍，复杂度 \(\Theta(n)\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pi&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;至于这个问题的加强版，统计 \(S\) 中的每个前缀在 \(T\) 中的出现次数，可以构造 \(S\#T\)，赋初值的时候只需要将 \(T\) 中的位置初始化为 \(1\) 即可。&lt;/p&gt;
&lt;h4 id="统计本质不同子串的数目"&gt;统计本质不同子串的数目&lt;/h4&gt;
&lt;p&gt;考虑迭代计算，问题转化成：在当前字符串的末尾加入一个新的字符，以这个字符结尾的后缀中有多少个是前面没有出现过的。&lt;/p&gt;
&lt;p&gt;如果一个子串 \(S_{i\sim n}\) 在前面出现过，则 \(\forall j\geqslant i,S_{j\sim n}\) 都在前面出现过。&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;由反证法易知。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;于是就只需求出加入新字符后的串的反串中的 \(\max\pi\) 即可，而这个字符的贡献就是 \(|S|+1-\max\pi\)，时间复杂度 \(\Theta(n^{2})\)。&lt;/p&gt;
&lt;h2 id="字符串周期相关性质"&gt;字符串周期相关性质&lt;/h2&gt;
&lt;p&gt;称 \(k\) 为 \(S\) 的一个周期且仅当 \(\forall i\leqslant |S|-k, S_{i} = S_{i + k}\)，特别地若 \(k \nmid S\) 则称 \(k\) 为 \(S\) 的弱周期。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;若字符串 \(S\) 存在一个 border \(T\)，当且仅当 \(S\) 存在一个长度为 \(|S| - |T|\) 的（弱）周期。&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;必要性显然，充分性递归论证即可。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;字符串 \(S\) 的最短（弱）周期长度为 \(n - \pi_{n}\)。&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;由 \(\pi\) 函数的定义易知。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;若长度不小于 \(p + q\) 的字符串 \(S\) 存在长度分别为 \(p, q\) 的（弱）周期，那么 \(\gcd(p, q)\) 也是 \(S\) 的一个（弱）周期。&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;下面首先证明 \(p - q(p \gt q)\) 也是 \(S\) 的一个（弱）周期。&lt;/p&gt;
&lt;p&gt;分两种情况讨论：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;若 \(i \leqslant q\)，则 \(S_{i} = S_{i + p} = S_{i + p - q}\)，可知 \(\forall i \leqslant q, p - q\) 是其一个（弱）周期。&lt;/li&gt;
&lt;li&gt;若 \(i \gt q\)，则 \(S_{i} = S_{i - q} = S_{i + p - q}\)，可知 \(\forall i \gt q, p - q\) 是其一个（弱）周期。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;证明 \(p - q\) 是 \(S\) 的一个（弱）周期后，根据更相减损术的性质，最终可以迭代至 \(\gcd(p, q)\) 是 \(S\) 的一个（弱）周期。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;所有强周期的长度均为最短强周期长度的倍数。&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;若存在一个强周期 \(x\)，显然有 \(x\mid n\)，若 \(n-\pi_{n}\nmid x\)，则 \(\gcd(n-\pi_{n},x)\lt n-\pi_{n}\) 也为一个强周期，与 \(n-\pi_{n}\) 是最小强周期矛盾。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;字符串 \(S\) 存在周期当且仅当 \(n - \pi_{n}\) 为一个周期。&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;必要性显然。若存在强周期 \(x\mid n\)，又因为 \(n-\pi_{n}\mid x\)，则 \(n-\pi_{n}\mid n\)，充分性得证。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="kmp-自动机"&gt;KMP 自动机&lt;/h2&gt;
&lt;p&gt;在求 \(\pi\) 函数的时候，我们发现这个做法是支持在线插入一个字符在末尾并计算函数值的。&lt;/p&gt;
&lt;p&gt;并且在做 \(\rm KMP\) 的过程中我们发现，在匹配串每一位求 \(\pi\) 函数时，并不关心之前匹配串的字符是什么，只关心之前的 \(\pi\) 函数值和当前位的字符。&lt;/p&gt;
&lt;p&gt;这意味着可以对一个模式串建立一个自动机，结点 \(i\) 表示当前节点的 \(\pi\) 值为 \(i\)，新加入一个节点的出边 \(c\) 指向跳 \(\pi\) 时第一个能够匹配的结点。暴力建这个自动机的复杂度为 \(\Theta(n^{2}|\Sigma|)\)，因为出边需要遍历 \(\Sigma\)，所以不存在求 \(\pi\) 函数时指针单方向移动的性质。&lt;/p&gt;
&lt;p&gt;但是实际上之前已经计算了从所有节点开始，以任意一个字符为出边会到哪个节点，故可以直接调用。具体规则为，记 \(f_{i,c}\) 表示从 \(i\) 号节点开始，字符 \(c\) 会到达的节点。如果当前到达了节点 \(i\) ，字符为 \(c\)，则如果 \(c=s_{i+1}\)，那么当前节点指向 \(i+1\)，否则指向 \(f_{\pi_{i},c}\)。时间复杂度 \(\Theta(n|\Sigma|)\)。&lt;/p&gt;
&lt;p&gt;同 \(\rm KMP\) 算法一样，\(\rm KMP\) 自动机也可以用来实现若干文本串和模式串的匹配，文本串从节点 \(0\) 开始走，每次走到 \(|S|\) 都完成了一次匹配。若模式串长度为 \(m\)，文本串长度为 \(n\)，数量为 \(t\)，则时间复杂度为 \(\Theta(m+tn|\Sigma|)\)。&lt;/p&gt;
&lt;p&gt;另一方面，\(\rm KMP\) 自动机在完成普通字符串匹配时表现并不优秀，但它可以求解一些特殊的字符串匹配问题，如：&lt;/p&gt;
&lt;p&gt;定义 \(g_{1}="a"\)，\(g_{2}="aba"\)，\(g_{3}="abacaba"\cdots \forall i,g_{i}=g_{i-1}+(char)i+g_{i-1}\)。 给定另一字符串 \(S\) 和整数 \(k\)，求 \(S\) 在 \(g_{k}\) 中的匹配次数。保证 \(|S|\times k\leqslant 10^{6}\)。&lt;/p&gt;
&lt;p&gt;显然题目是要求从 \(0\) 号节点开始对 \(g_{k}\) 进行匹配，经过 \(|S|\) 号节点的次数是多少。&lt;/p&gt;
&lt;p&gt;首先对 \(S\) 建立 \(\rm KMP\) 自动机，记 \(f_{i,j}\) 表示从 \(i\) 号节点开始对 \(g_{j}\) 进行匹配后经过 \(|S|\) 号节点的次数。记 \(k_{i,S}\) 表示从 \(i\) 号节点开始，匹配完字符串 \(S=g_{i}+(char)i\) 后停下来的结点，那么有 ：&lt;/p&gt;
\[
f_{i,j}=f_{i,j-1}+[k_{i,g_{j-1}+(char)(j-1)}=|S|]+f_{k_{i,g_{j-1}+(char)(j-1)},j-1}
\]&lt;p&gt;总时间复杂度 \(\Theta(|S|\times k)\)。&lt;/p&gt;
&lt;p&gt;另外，由于单次添加结点的复杂度是严格 \(\Theta(|\Sigma|)\) 的，所以可以对 \(\rm KMP\) 自动机进行可持久化处理，总时间复杂度 \(\Theta(n|\Sigma|\log n)\)。&lt;/p&gt;
&lt;p&gt;例题：
&lt;/p&gt;
&lt;p&gt;考虑对模式串建立 \(\rm KMP\) 自动机。&lt;/p&gt;
&lt;p&gt;令 \(f_{i,j}\) 表示对字符串匹配到第 \(i\) 位时，跳到自动机的 \(j\) 号点匹配的次数最大值，显然有转移：&lt;/p&gt;
\[
f_{i, to} =
\begin{cases}
\max\{f_{i-1, j} + [to = m]\} &amp; (s_i \not= '?') \\
\max\limits_{k = 0}^{25}\{f_{i-1, j} + [to = m]\} &amp; (s_i = '?')
\end{cases}
\]&lt;p&gt;由于 \(\rm DP\) 空间开不下，需要使用滚动数组。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(|S||T||\Sigma|)\)。&lt;/p&gt;</description></item><item><title>Manacher 算法</title><link>https://sichen-wang.github.io/blog/manacher-%E7%AE%97%E6%B3%95/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/manacher-%E7%AE%97%E6%B3%95/</guid><description>&lt;p&gt;\(\rm Manacher\) 是用于求解一个字符串中所有回文子串的算法。&lt;/p&gt;
&lt;p&gt;首先，回文子串的数量级是 \(n^{2}\) 的，所以要考虑如何将所有回文子串快速地表达出来，容易发现如下性质：&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;如果存在一个以 \(p\) 为中心，半径为 \(d\) 的回文子串，那所有以 \(p\) 为中心，半径小于 \(d\) 的子串都是回文子串，证明显然。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;于是我们记 \(d_{i}\) 表示以 \(i\) 为中心的最大回文子串，而 \(\rm Manacher\) 算法的用处就是在线性复杂度下求出这个序列。&lt;/p&gt;
&lt;p&gt;具体过程跟 \(Z\) 算法类似，记 \(L,R\) 表示在之前的回文子串中，右端点最靠右的子串的左右端点，转移分三种情况：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;若 \(i\gt R\)，令 \(L=i-1,R=i+1\)，暴力更新。&lt;/li&gt;
&lt;li&gt;若 \(i\leqslant R,\ d_{L+R-i}\lt R-i\)，\(d_{i}=d_{L+R-i}\)。&lt;/li&gt;
&lt;li&gt;若 \(i\leqslant R,\ d_{L+R-i}\geqslant R-i\)，令 \(L=2i-R\)，暴力更新。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;由于 \(R\) 只会往右移，且每次暴力更新必定右移一位，所以时间复杂度为 \(\Theta(n)\)。&lt;/p&gt;
&lt;p&gt;但是我们发现，上面这种方法只处理了回文子串长度为奇数的情况，而偶数的情况只需要分开考虑，奇偶性稍微改变一下即可，但还有一种更加巧妙的方式可以规避分奇偶讨论。&lt;/p&gt;
&lt;p&gt;考虑给所有字符之间加入一个不可能出现的相同字符，如字符串 \(abaca\) 变成 \(\#a\#b\#a\#c\#a\#\)，这样在奇数位上统计的就是字串长度为偶数的答案，在偶数位上统计的就是字串长度为奇数的答案。同时，这样统计出来的半径 \(d\) 就是以当前点为中心的最长回文子串的长度。&lt;/p&gt;</description></item><item><title>Prufer 序列</title><link>https://sichen-wang.github.io/blog/prufer-%E5%BA%8F%E5%88%97/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/prufer-%E5%BA%8F%E5%88%97/</guid><description>&lt;h2 id="prufer-序列的定义"&gt;Prufer 序列的定义&lt;/h2&gt;
&lt;p&gt;\(\rm Prufer\) 序列可以将一颗结点数为 \(n\) 的有标号无根树用一个长度为 \(n-2\)，值域为 \([1,n]\) 的数列唯一表示，即有标号无根树和 \(\rm Prufer\) 序列呈双射关系。&lt;/p&gt;
&lt;p&gt;具体来说，有标号无根树的构建方式如下：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;选择一个编号最小的叶子节点，并将其删除。&lt;/li&gt;
&lt;li&gt;将这个叶子节点所连接的点的编号加入 \(\rm Prufer\) 序列中。&lt;/li&gt;
&lt;li&gt;重复以上步骤 \(n-2\) 次，直到树上只剩下 \(2\) 个点。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;这是某一颗点数为 \(n\) 的有标号无根树的 \(\rm Prufer\) 序列的构造过程：&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="https://oiwiki.org/graph/images/prufer1.png" alt="Prufer" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 id="快速求解-prufer-序列"&gt;快速求解 Prufer 序列&lt;/h2&gt;
&lt;p&gt;由其过程，显然有一个使用堆优化的 \(\Theta(n\log n)\) 做法，但 \(\rm Prufer\) 序列其实可以线性构造。&lt;/p&gt;
&lt;p&gt;记录所有点的度数和一个指针 \(p\) 指向编号最小的叶子节点，进行以下操作：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;将 \(p\) 指向的结点删除，检查是否出现了新的叶结点。&lt;/li&gt;
&lt;li&gt;如果产生了新的叶结点，记其编号为 \(x\)。 若 \(x\gt p\)，则不做任何操作，否则将其删除，并检查删除 \(x\) 以后是否出现了新的叶结点，重复这一步操作直到没有产生新的叶结点或新产生的结点编号大于 \(p\)。&lt;/li&gt;
&lt;li&gt;让 \(p\) 自增直到遇见下一个叶结点为止。&lt;/li&gt;
&lt;li&gt;重复以上操作直到结点数为 \(2\) 可以得到这棵树的 \(\rm Prufer\) 序列。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;可以发现，在算法流程中，每条边只在其连接的外层结点被删除时被遍历过一次，并且 \(p\) 单调递增，树中的节点数单调递减，所以每个点也只被遍历过一次。&lt;/p&gt;
&lt;p&gt;总时间复杂度 \(\Theta(n)\)。&lt;/p&gt;
&lt;h2 id="快速还原-prufer-序列"&gt;快速还原 Prufer 序列&lt;/h2&gt;
&lt;p&gt;显然还是有一个堆优化的 \(\Theta(n\log n)\) 做法。&lt;/p&gt;
&lt;p&gt;从前到后枚举 \(\rm Prufer\) 序列中的每一个数，维护不在序列中的结点编号的最小值。显然不在序列中的是叶子节点，并且其最小值为最后一个加入的，于是将其与当前枚举的序列中的数连边。连边后若序列中已没有枚举的这个数，那么将其踢出序列作为新的叶子结点。&lt;/p&gt;
&lt;p&gt;考虑以与之前构造 \(\rm Prufer\) 序列相同的方法构造线性做法。&lt;/p&gt;
&lt;p&gt;记一个指针 \(p\) 指向不在序列中的最小结点，如果将其连向序列中枚举的位置，并将枚举的位置删除。序列中没有这个结点了，那么如果被删除的结点比 \(p\) 小，直接将其与现在序列中枚举的数连边后将其删除，重复操作。如果这个结点的值大于 \(p\)，那么不用管它，在后面它一定会被枚举到。&lt;/p&gt;
&lt;p&gt;显然，这种算法的时间复杂度为 \(\Theta(n)\)。&lt;/p&gt;
&lt;h2 id="prufer-序列的应用"&gt;Prufer 序列的应用&lt;/h2&gt;
&lt;h3 id="cayley-公式"&gt;Cayley 公式&lt;/h3&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;完全图 \(K_{n}\) 有 \(n^{n-2}\) 颗生成树。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;证明方法很多，其中最简单的应该是利用 \(\rm Prufer\) 序列。&lt;/p&gt;
&lt;p&gt;考虑到任何一个长度为 \(n-2\) 的 \(\rm Prufer\) 序列唯一对应一颗大小为 \(n\) 的有标号无根树，于是考虑计算长度为 \(n-2\) 的 \(\rm Prufer\) 序列的数量，又因为其值域为 \([1,n]\)，故总方案数为 \(n^{n-2}\)。&lt;/p&gt;
&lt;h3 id="限定度数的有标号无根树计数"&gt;限定度数的有标号无根树计数&lt;/h3&gt;
&lt;p&gt;求有 \(n\) 个结点，且第 \(i\) 个结点的度数为 \(d_{i}\) 的有标号无根树的数量。&lt;/p&gt;
&lt;p&gt;考虑到一个点的度数为其在 \(\rm Prufer\) 序列中出现次数 \(+1\)，于是对于一个度数为 \(d_{i}\) 的点，其在 \(\rm Prufer\) 序列中的出现次数应为 \(d_{i}-1\)，故存在这样的有标号无根树当且仅当 \(\sum_{i=1}^{n} d_{i}-1=n-2\)，并且这样的树的数量为：&lt;/p&gt;
\[
\dbinom{n-2}{d_1-1,d_2-1,\cdots ,d_n-1}=\frac{(n-2)!}{(d_1-1)!(d_2-1)!\cdots (d_n-1)!}
\]</description></item><item><title>Z 算法</title><link>https://sichen-wang.github.io/blog/z-%E7%AE%97%E6%B3%95/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/z-%E7%AE%97%E6%B3%95/</guid><description>&lt;h2 id="算法简介"&gt;算法简介&lt;/h2&gt;
&lt;p&gt;\(Z\) 算法在国内也被某些人称为 \(\rm ExKMP\)（虽然我不知道它跟 \(\rm KMP\) 算法有什么关系）。&lt;/p&gt;
&lt;p&gt;\(Z\) 算法用于求字符串 \(S\) 的 \(Z\) 函数，其定义为 \(z_{i}=\rm LCP(S,S_{i\sim n})\)。&lt;/p&gt;
&lt;p&gt;这个算法的核心在于利用之前的信息来减少计算量。&lt;/p&gt;
&lt;p&gt;具体来说我们可以从左往右依次求每个位置的 \(z\) 函数，令 \([i, i + z_{i} - 1]\) 为 \(i\) 的匹配段，同时维护出右端点最靠右的匹配段 \([l, r]\)。&lt;/p&gt;
&lt;p&gt;那么我们知道有 \(S_{1 \sim r - l + 1} = S_{l \sim r}, S_{i \sim r} = S_{i - l + 1, r - l + 1}(i \leqslant r), z_{i} \geqslant \min(r - i + 1, z_{i - l + 1})\)&lt;/p&gt;
&lt;p&gt;在计算 \(z_{i}\) 时，分以下三种情况：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;若 \(i \leqslant r, z_{i - l + 1} \lt r - i + 1\) 那么显然有 \(z_{i} = z_{i - l + 1}\)。&lt;/li&gt;
&lt;li&gt;若 \(i \leqslant r, z_{i - l + 1} \geqslant r - i + 1\)，那么我们就从 \(r + 1\) 开始暴力匹配前缀。&lt;/li&gt;
&lt;li&gt;若 \(i \gt r\)，那么直接从 \(i\) 开始暴力匹配前缀。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;不难发现复杂度来源在于 \(2, 3\) 情况，但可以发现右端点最靠右的匹配段的右端点总是在这两种情况下向右移动，而总移动量不超过 \(n\)，因此复杂度是 \(\Theta(n)\) 的。&lt;/p&gt;
&lt;p&gt;如果要求 \(z_{i} = \rm LCP(T, S_{i \sim n})\) 话，就类似于 \(\rm KMP\) 的做法，构造一个 \(T \# S\) 的串去求 \(z\) 函数即可。&lt;/p&gt;
&lt;h2 id="经典例题"&gt;经典例题&lt;/h2&gt;
&lt;h3 id="noi2014-动物园"&gt;[NOI2014] 动物园&lt;/h3&gt;
&lt;p&gt;对于每个 \(i\)，计算后缀 \(S_{i\sim n}\) 与 \(S\) 的 \(\rm LCP\)，考虑在后一个 border 的左端点 \(i\) 处统计答案。&lt;/p&gt;
&lt;p&gt;令最长公共前缀的四个端点分别为 \(L,R,L',R'\)，分两种情况讨论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;当 \(R\lt L'\) 时，区间 \([L',R']\) 答案 \(+1\)。&lt;/li&gt;
&lt;li&gt;当 \(R\geqslant L'\) 时，区间 \([L',R]\) 答案 \(+1\)。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;区间 \(+1\) 可以使用差分实现，总时间复杂度 \(\Theta(n)\)。&lt;/p&gt;
&lt;h3 id="cf1051e-vasya-and-big-integers"&gt;[CF1051E] Vasya and Big Integers&lt;/h3&gt;
&lt;p&gt;记 \(f_{i}\) 表示 \(a_{1\sim i}\) 有多少种合法的划分方案，显然有一个 \(\Theta(n^{2})\) 的暴力 \(\rm DP\)，即往前枚举转移点 \(j\)，判断转移是否合法后累加。&lt;/p&gt;
&lt;p&gt;观察到合法的转移点是一段连续的区间，若令 \(len_{l}\) 和 \(len_{r}\) 分别表示两限制字符串的长度，显然对于满足 \(len_{l}\lt i-j\lt len_{r}\) 的转移点 \(j\)，这个转移都是合法的，现在的问题在于判断当 \(j=i-len_{l}\) 或 \(j=i-len_{r}\) 的时候转移是否合法。&lt;/p&gt;
&lt;p&gt;考虑用 \(\rm ExKMP\) 对任意一个 \(i\)，求 \(\rm LCP(s_{i\sim n},l)\) 和 \(\rm LCP(s_{i\sim n},r)\)，这样就可以快速求出 \(s_{i-len_{l}+1\sim i}\) 与 \(l\) 的最长公共前缀 \(zl_{i-len_{l}+1}\)，并通过比较 \(s_{i-len_{l}+1+z_{i-len_{l}+1}}\) 与 \(l_{z_{i-len_{l}+1}+1}\) 的大小判断当 \(j=i-len_{l}\) 时转移是否合法，同理，当 \(j=i-len_{r}\) 时转移是否合法也可以通过相同方式判断。&lt;/p&gt;
&lt;p&gt;这样，合法转移点的区间就在 \(\Theta(1)\) 的时间内求出来了，剩下的用前缀和记录一下即可。需要注意的是，由于不能出现前导零，所以当转移点的后一位为 ‘\(0\)’ 时不能将其加入前缀和数组。&lt;/p&gt;
&lt;p&gt;总时间复杂度 \(\Theta(n)\)。&lt;/p&gt;</description></item><item><title>一封面向社会，关于对近日来 CCF 不当行为之抗议的公开信</title><link>https://sichen-wang.github.io/blog/%E4%B8%80%E5%B0%81%E9%9D%A2%E5%90%91%E7%A4%BE%E4%BC%9A%E5%85%B3%E4%BA%8E%E5%AF%B9%E8%BF%91%E6%97%A5%E6%9D%A5-ccf-%E4%B8%8D%E5%BD%93%E8%A1%8C%E4%B8%BA%E4%B9%8B%E6%8A%97%E8%AE%AE%E7%9A%84%E5%85%AC%E5%BC%80%E4%BF%A1/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E4%B8%80%E5%B0%81%E9%9D%A2%E5%90%91%E7%A4%BE%E4%BC%9A%E5%85%B3%E4%BA%8E%E5%AF%B9%E8%BF%91%E6%97%A5%E6%9D%A5-ccf-%E4%B8%8D%E5%BD%93%E8%A1%8C%E4%B8%BA%E4%B9%8B%E6%8A%97%E8%AE%AE%E7%9A%84%E5%85%AC%E5%BC%80%E4%BF%A1/</guid><description>&lt;p&gt;\(\quad\)前天，我看到 \(\rm CCF\) 发布了这样一则公告 ：&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;\(\quad\)得知此事，我很愤怒，但愤怒过后是深深的失落。大概是因为看着我所热爱的信息学竞赛正因为一个组织的糊涂行为走向毁灭吧。&lt;/p&gt;
&lt;p&gt;\(\quad\)是的，毁灭。“ \(\rm OI\) 要做干净的竞赛。” 这句话的提出者正抬起脚，狠狠地将这块令所有信息竞赛生引以为傲的招牌踩在地上，变得四分五裂。&lt;strong&gt;当一个竞赛已经失去了信用，那它的存在倒比毁灭更令人难过了。&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;\(\quad\)在过去的很多年里，\(\rm CCF\) 一直有一个规定，若某省存在选手作弊，那么&lt;strong&gt;扣除该省省队名额一个，并将作弊选手禁赛三年&lt;/strong&gt;。由于这个政策的存在，有很多本该进入省队的选手因为某个与自己&lt;strong&gt;毫不相关&lt;/strong&gt;的人作弊而与自己本该获得的奖牌失之交臂。&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;\(\quad\)但这项规则对所有人都是如此吗？去年南门口中学某谢姓选手在省选考场上作弊，并进入省队。作弊事实败露后他&lt;strong&gt;仅仅是被 \(\rm CCF\) 以非公开的方式取消了抄袭题目的分数，甚至还参加了在省选之后举办的清华集训。&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;\(\quad\)而今年情况越发严峻，十多个省由于存在作弊选手而被扣除省队名额，其中大多数为入门组的小朋友，而代价却要能够进入省队的高水平选手来承担。幸好后来事情发生了变化，有一名被判定为作弊的选手来自某&lt;strong&gt;超级强校&lt;/strong&gt;，而那所学校的教练对 \(\rm CCF\) 的行为进行了强烈的抗议，直接促使 \(\rm CCF\) 被迫取消此规定。&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;\(\quad\)在结果大快人心的同时，我们不妨想想，之前难道没有学校对这个规定进行过抗议吗？&lt;strong&gt;为什么 \(\rm CCF\) 可以置若罔闻，而超级强校对其抗议却立刻奏效了呢？&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;\(\quad\)在 \(\rm CCF\) 取消上述规定后，我本来以为风波已平，却不想是另一场风暴的开端，而这次更是带来了席卷 \(\rm OI\) 界的滔天巨浪 —— &lt;strong&gt;某些选手因为在代码注释中写下 &lt;code&gt;F**k_CCF&lt;/code&gt; 等内容而被取消本次考试成绩并被禁赛一年。&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;\(\quad\)先对一些关键点进行解释 ：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;代码注释是形如下文中 &amp;quot; \(//\) &amp;quot; 后面的内容 ：&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;read&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getchar&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;0&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;9&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getchar&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;0&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;9&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getchar&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// 这段代码被用来快速读入一个数&amp;lt;span class=&amp;#34;bd-box&amp;#34;&amp;gt;&amp;lt;h-char class=&amp;#34;bd bd-beg&amp;#34;&amp;gt;&amp;lt;h-inner&amp;gt;，&amp;lt;/h-inner&amp;gt;&amp;lt;/h-char&amp;gt;&amp;lt;/span&amp;gt;注意&amp;lt;span class=&amp;#34;bd-box&amp;#34;&amp;gt;&amp;lt;h-char class=&amp;#34;bd bd-beg&amp;#34;&amp;gt;&amp;lt;h-inner&amp;gt;，&amp;lt;/h-inner&amp;gt;&amp;lt;/h-char&amp;gt;&amp;lt;/span&amp;gt;只能用来读取不大于 2^31 - 1 的正整数&amp;lt;span class=&amp;#34;bd-box&amp;#34;&amp;gt;&amp;lt;h-char class=&amp;#34;bd bd-beg&amp;#34;&amp;gt;&amp;lt;h-inner&amp;gt;。&amp;lt;/h-inner&amp;gt;&amp;lt;/h-char&amp;gt;&amp;lt;/span&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;\(\quad\)注释一般被写在代码中用来提醒程序员这段代码起什么作用或者需要注意什么事情，在评测时机器不会读取这些字符。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;在 \(\rm OI\) 考试中，&lt;strong&gt;时间紧，任务重，大多数选手在考试结束时是拿不到自己的极限分数的&lt;/strong&gt;。而在考试中，题目质量，考场状态，考试策略等都能极大地影响一个选手的分数，但一场考试又最多只有 \(4\) 道题，所以选手在在看到自己不擅长的题目类型时是非常难受的。比如说这次 \(\rm NOIp\)，我本人在发现有一半题目是 \(\rm DP\) 题，并且 \(\rm DP\) 又是我最不擅长的知识点时，花 \(5\) 分钟去厕所洗了个脸才基本冷静下来。&lt;strong&gt;而某些选手在注释中写下一些对 \(\rm CCF\) 的怒斥又何尝不是他们宣泄情绪，让自己保持冷静的方式呢 ？&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;\(\quad\)&lt;strong&gt;至于某些人将这种行为类比成在高考作文中骂教育部是完全不恰当的&lt;/strong&gt;，因为在了解了 \(\rm OI\) 的规则后，我们知道这种行为顶多算是在草稿纸上写 &lt;code&gt;F**k jyb&lt;/code&gt;. 改卷老师（评测机）是不会看到这些语句的。虽然草稿纸最后会被公示（此处不得不承认 \(\rm CCF\) 在赛后公示选手代码（答卷）是考试史上的一大进步），但公示后会看到的人数至多以千记，造成的影响不算很大。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;禁赛一年是指在接下来的一年中，被禁赛的选手将不能参加&lt;strong&gt;所有&lt;/strong&gt; \(\rm NOI\) 系列的比赛，这意味着一个选手不能参加次年的 \(\rm NOIp\)，而又有谁能在不参加 \(\rm NOIp\) 的情况下进入省队呢？所以一个选手两年内的所有比赛将会被禁止，这意味着如果这个选手是高中生，那么&lt;strong&gt;他的 \(\rm OI\) 之路必将就此断绝&lt;/strong&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;\(\quad\)回归正题。看到这里，大家对 \(\rm CCF\) 的行为应该已经有了自己的评判。我想，大多数 \(\rm OIer\) 对 \(\rm CCF\) 所作行为的愤怒之处并不在于他对涉事选手的处罚，而在于 ：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;选手不过是在 “草稿纸” 上骂了 \(\rm CCF\) 几句，而 \(\rm CCF\) 却要对他们赶尽杀绝，&lt;strong&gt;这未免已经超出了批评教育，甚至惩罚的范畴。&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;前 \(\rm IOI\) 中国代表队成员钟子谦已经对全国选手的代码进行了查找，发现在代码中辱骂 \(\rm CCF\) 者高达 \(122\) 人之多，而 \(\rm CCF\) 却只处罚了 \(5\) 名高水平选手，仅占总数的 \(4\%\)，其中甚至包含一名联赛 \(344\) 分，排名浙江第 \(4\)，不出意外必然进入国家集训队的选手。&lt;strong&gt;这不禁让人联想，其中是不是有其它的利益关系呢？&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;\(\rm CCF\) 这样做并没有任何法律依据&lt;/strong&gt;，而仅仅是搬出了 “ 国务院办公厅近日印发的《关于全面加强新时代语言文字工作的意见》指出，要“加强语言文明教育，强化对互联网等各类新媒体语言文字使用的规范和管理，坚决遏阻庸俗暴戾网络语言传播，建设健康文明的网络语言环境。” 这样一段并不具有法律效力的文本，就对 \(5\) 名选手做出了如此严厉的处罚。&lt;strong&gt;这种行为本就违反了中国科学技术协会发布的《中国科协全国五项学科竞赛条例》中 “ 不可擅自更改参赛学生的竞赛结果或成绩 ” 这一条款。&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;\(\rm CCF\) 做出这样的事非但没有法律依据，并且还是在&lt;strong&gt;没有任何提前通知的情况下猝然做出&lt;/strong&gt;的。这不禁让人忧心，如果今后某位选手在考完试后得罪了某位 \(\rm CCF\) 的领导，那他是不是可以&lt;strong&gt;生造一条莫须有的规定&lt;/strong&gt;来取消这位选手的成绩并将他禁赛呢？这未免太可怕了！&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;\(\quad\)因此，我作为一名现役的高二信息竞赛生，在此对 \(\rm CCF\) 提出我们 \(\rm OIer\) 的共同诉求 ：&lt;strong&gt;撤销对 \(5\) 名选手取消成绩和禁赛一年的处罚，将对它们的惩罚限定在批评教育的范畴内&lt;/strong&gt;。如果贵学会坚持认为他们的行为对自己造成了严重的声誉影响，可以&lt;strong&gt;依法向他们提出合理的经济赔偿&lt;/strong&gt;。&lt;/p&gt;
&lt;p&gt;\(\quad\)我奉劝中国计算机学会，既然要承办信息学奥林匹克竞赛，那就要秉承&lt;strong&gt;奥林匹克精神&lt;/strong&gt;，守住竞赛公平的底线，而不是成为用心险恶之人作恶的工具。&lt;/p&gt;
&lt;p&gt;\(\quad\)作为一名中学生，我当然对改变此事无能为力。但 \(\rm OIer\) 不是一名中学生，而是千千万万心怀公义的少年。若是 \(\rm CCF\) 继续执迷不悟，非要一意孤行，将 \(\rm OI\) 变成自己滥权和敛财的工具，那么必将被另一个更有能力的组织取代。事实上，我期待这一天的到来！&lt;/p&gt;
&lt;p&gt;\(\quad\)&lt;strong&gt;最后我想说，国家交给任何组织的公权力都不是让其肆意滥用的，竞赛这种为国举才的大事不能用于满足某些人的私利，希望 \(\rm CCF\) 悬崖勒马，不要陷自己于不仁不义不法之地&lt;/strong&gt;。&lt;/p&gt;
&lt;p&gt;\(\quad\)此致。&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;\(\quad\)下附信息学竞赛赛程和基本规则，以助不了解信息学竞赛者快速理解上文中某些内容 ：&lt;/p&gt;
&lt;p&gt;\(\quad\)信息学竞赛的赛程是 ：&lt;/p&gt;
&lt;p&gt;\(\quad\)初赛 \(+\ \rm CSP\) ：决定选手是否有资格参加 联赛 \(\rm(NOIp)\)，允许社会人员参与。并且 \(\rm CCF\) 曾宣布过 “ \(\rm CSP\) 与 \(\rm NOI\) 系列比赛没有任何关系” ，但最后还是成为了 \(\rm NOIp\) 的预选赛，其真实目的也不过是为了对抗教育部 “ 竞赛不可收费 ” 的规定，违规收取选手的参赛费罢了。&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;\(\quad \rm NOIp\) ：全国中学生信息联赛，对于一般选手来说这是一个赛季中最重要的比赛，将评出省一二三等奖，在 \(\rm -OH\) 计划出台后已无实际作用，或许更大程度上是一个选手认真参加过 \(\rm OI\) 的证明。&lt;/p&gt;
&lt;p&gt;\(\quad\)省选 ：全国高中生信息竞赛省队选拔赛，用于选拔各省省队去参加 国赛 \(\rm(NOI)\)，每个省的名额在 \(10\) 人左右，根据各省成绩好坏会有所增减。选拔方式为，将联赛和省选分数计算其占该省最高分比例后，分别以 \(0.4,0.6\) 的权重加权而得的值降序排列，从前往后取至省队名额。同时每所学校的进队人数不可占省队名额的 \(1 / 3\) 以上（四舍五入），因该限制而空出的名额向后顺延。&lt;/p&gt;
&lt;p&gt;\(\quad \rm NOI\) : 全国高中生信息竞赛，绝大多数顶尖选手的最终挑战，前 \(50\) 名进入国家集训队保送清北，\(51\sim 200\) 名获得银牌破格入围 \(\rm -OH\)，除了这 \(200\) 人之外，无论获得其它什么奖项都仅作为纪念和荣誉，他们将带着对 \(\rm OI\) 的回忆回归文化课。&lt;/p&gt;
&lt;p&gt;\(\quad\)信息学竞赛的评分机制是 :&lt;/p&gt;
&lt;p&gt;\(\quad\)初赛 ：笔试，题型为选择题和填空题，全部随机选择的期望分数可以晋级 \(\rm CSP.\)&lt;/p&gt;
&lt;p&gt;\(\quad \rm CSP,NOIp\ :\ CSP\ 4\) 小时，\(\rm NOIp\ 4.5\) 小时，均为 \(4\) 道题。&lt;/p&gt;
&lt;p&gt;\(\quad\)省选，\(\rm NOI\) ：均为两场，每场 \(5\) 小时，\(3\) 道题。&lt;/p&gt;
&lt;p&gt;\(\quad\)除了初赛之外，考试中的每道题形如，给定一个问题，如 “ 给出两个数，求它们的和 ”，你需要在规定时间内编写一个程序用来解决它。考完之后选手编写的程序会被上交，统一进行评测。&lt;/p&gt;
&lt;p&gt;\(\quad\)评测时评测机会给出一些输入文本，待测程序读取后会按照选手所编写的程式对其进行一定处理，然后给出输出文本。如果待测程序在规定时间内给出了输出文本，评测机会将它与标准答案进行对比，如果完全相同（也有一些非传统评测规则并非如此，此处略过）则选手获得该测试点的分数。比如说在之前那个问题中，评测机若给出输入文本 “ \(2\ 3\) ”，那么一个正确的程序应该输出 “ \(5\) ”，并且可以获得这个测试点的分数。&lt;/p&gt;
&lt;p&gt;\(\quad\)在 \(\rm OI\) 赛制中，每道题目的分数均为 \(100\)，最后每道题的得分之和就是一场考试的总分。当然，每道题的分数并不是非零即 \(100\)，大多数题目会给出若干子任务，如果选手无法解决完整的问题，可以选择一些弱化问题来解决，并获得相应的部分分。&lt;/p&gt;</description></item><item><title>决策单调性</title><link>https://sichen-wang.github.io/blog/%E5%86%B3%E7%AD%96%E5%8D%95%E8%B0%83%E6%80%A7/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E5%86%B3%E7%AD%96%E5%8D%95%E8%B0%83%E6%80%A7/</guid><description>&lt;h2 id="四边形不等式优化"&gt;四边形不等式优化&lt;/h2&gt;
&lt;h3 id="定义"&gt;定义&lt;/h3&gt;
&lt;p&gt;假设有 \(p_{1}\leqslant p_{2}\leqslant p_{3}\leqslant p_{4}.\)&lt;/p&gt;
&lt;p&gt;则 \(c_{p_{1},p_{3}}+c_{p_{2},p_{4}}\leqslant c_{p_{1},p_{4}}+c_{p_{2},p_{3}}\) 被称为四边形不等式。&lt;/p&gt;
&lt;p&gt;假设一个问题满足四边形不等式，那么它的决策点有单调性。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Proof:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;假设有如下问题 ：现在有一个序列，我们要将其分割开来，分割一段 \([l,r]\) 的代价是 \(c_{l,r}\)，求最小代价。&lt;/p&gt;
&lt;p&gt;设 \(F_{i}\) 表示将前 \(i\) 个位置分割完毕的最小代价，显然有暴力转移 ：&lt;/p&gt;
\[
F_i=\min\limits_{j\lt i}\{F_j+c_{j,i}\}
\]&lt;p&gt;设 \(F_{i}\) 的决策点为 \(p_{i}.\) 假设存在 \(x\gt y,p_{x}\lt p_{y}.\)&lt;/p&gt;
&lt;p&gt;根据最优决策的定义写出这个位置的转移式 :&lt;/p&gt;
\[
F_x=F_{p_x}+c_{p_x,x}\leqslant F_{p_y}+c_{p_y, x}
\]&lt;p&gt;有 \(p_{x}\lt p_{y}\lt y\lt x\)，根据四边形不等式得到 :&lt;/p&gt;
\[
c_{p_x,y}+c_{p_y,x}\leqslant c_{p_y,y}+c_{p_x,x}
\]&lt;p&gt;两不等式相加，得到 :&lt;/p&gt;
\[
F_{p_x}+c_{p_x,y}\leqslant F_{p_y}+c_{p_y,y}
\]&lt;p&gt;与前文矛盾，故不存在 \(x\gt y,p_{x}\lt p_{y}\)，即满足决策单调性。&lt;/p&gt;
&lt;p&gt;需要注意的是，只有最小化问题才能通过四边形不等式判定决策单调性。&lt;/p&gt;
&lt;h3 id="区间形式"&gt;区间形式&lt;/h3&gt;
&lt;p&gt;在实际做题中，我们经常遇到这样的 \(\rm DP\) 方程 ：&lt;/p&gt;
\[
f_{i,j}=\min\limits_{i\leqslant k\lt j}\{f_{i,k}+f_{k+1,j}+w_{i,j}\}
\]&lt;p&gt;我们考虑将四边形不等式推广到二维形式。&lt;/p&gt;
&lt;p&gt;定理 \(1\) ：若 \(w\) 满足四边形不等式，并且对于任意 \(a \leqslant b\leqslant c\leqslant d\)，有 \(w_{a,d}\geqslant w_{b,c}\)，则 \(f\) 也满足四边形不等式。&lt;/p&gt;
&lt;p&gt;定理 \(2\) ：设 \(p_{i,j}\) 表示 \(f_{i,j}\) 的决策点，若 \(f\) 满足四边形不等式，则对于任意 \(i\lt j\)，有 \(p_{i,j-1}\leqslant p_{i,j}\leqslant p_{i+1,j}.\)&lt;/p&gt;
&lt;p&gt;例题 ：
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="转移技巧"&gt;转移技巧&lt;/h2&gt;
&lt;h3 id="有单峰性"&gt;有单峰性&lt;/h3&gt;
&lt;p&gt;这个性质结合决策单调性有均摊转移复杂度 \(\Theta(1)\) 的做法 ：&lt;/p&gt;
&lt;p&gt;记录一个指针表示当前的决策点，由于决策单调性所以它不会往回跳。进入每一层之后如果后面的决策点更优就跳到后面的决策点，根据单峰性这样一定不会漏掉解。&lt;/p&gt;
&lt;p&gt;跳的次数是状态级别的，故转移均摊 \(\Theta(1).\)&lt;/p&gt;
&lt;h3 id="仅有相邻层之间转移"&gt;仅有相邻层之间转移&lt;/h3&gt;
&lt;p&gt;这是一类特殊的二维 \(\rm DP\)，仅有相邻层之间的转移，没有同层之间的转移，同时满足决策单调性。&lt;/p&gt;
&lt;p&gt;一般这种 \(\rm DP\) 的时间复杂度是 \(\Theta(n^{3})\) 的，每次转移需要枚举前一层的所有点。&lt;/p&gt;
&lt;p&gt;我们发现一个性质，在同一层中，先枚举哪一个是无关紧要的，因为同一层之间不会发生转移。&lt;/p&gt;
&lt;p&gt;于是可以考虑分治，先转移 \(mid\)，得到其最优决策为 \(p\)，然后就可以将区间划分开，\([l,mid)\) 和 \((mid,r]\) 分别对应 \([tl,p]\) 和 \([p,tr].\)&lt;/p&gt;
&lt;p&gt;这样分治时间复杂度 \(\Theta(n\log n).\)&lt;/p&gt;
&lt;p&gt;例题 ：
&lt;/p&gt;
&lt;h3 id="贡献难算"&gt;贡献难算&lt;/h3&gt;
&lt;p&gt;首先有例题 ：存在一个长度为 \(n\) 的序列，要将它划分成 \(k\) 段，每段的价值被定义为不同的元素个数，要求最大化贡价值和。&lt;/p&gt;
&lt;p&gt;数据范围：\(n\leqslant 3.5\times 10^{4},k\leqslant 50.\)&lt;/p&gt;
&lt;p&gt;首先有一个 \(\Theta(n^{3k})\) 的暴力 \(\rm DP\)，设 \(dp_{i,j}\) 表示当分到 \(i\) 时已经分了 \(j\) 段的最大价值，有转移式 ：&lt;/p&gt;
\[
dp_{i,j}=\max\limits_{k\lt i}\{dp_{k,j-1}+cnt_{k+1,i}\}
\]&lt;p&gt;其中 \(cnt_{l,r}\) 表示从 \([l,r]\) 中不同颜色的个数，单次计算需要 \(\Theta(n).\)&lt;/p&gt;
&lt;p&gt;我们发现只在相邻层之间发生转移，并且满足决策单调性（直观理解就是分得越多越容易亏），于是可以使用之前提到的分治法。&lt;/p&gt;
&lt;p&gt;这样看起来是优化到 \(\Theta(n^{2k}\log n)\)，但我们考虑计算贡献的具体过程。我们每次只会计算 \(dp_{mid}\) 的值，每次询问一个区间 \([i,mid]\) 的不同元素个数，可以考虑固定右端点移动左端点，容易发现移动次数是当前的分治区间长度，于是总移动次数不会超过 \(n\log n\)，故时间复杂度实际上为 \(\Theta(nk\log n).\)&lt;/p&gt;
&lt;p&gt;例题：
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="常用算法"&gt;常用算法&lt;/h2&gt;
&lt;h3 id="斜率优化"&gt;斜率优化&lt;/h3&gt;
&lt;p&gt;假设 \(\rm DP\) 方程长成这种形式 ：&lt;/p&gt;
\[
dp_i=\max\limits_{j\lt i}\{dp_j+(i)'+(i)(j)+(j)'+C\}
\]&lt;p&gt;即贡献为一个仅与 \(i\) 有关的式子加上一个仅与 \(j\) 有关的式子加上一个与两者都有关的乘积形式再加上一个常数，那么可以使用斜率优化。&lt;/p&gt;
&lt;p&gt;我们发现 \(dp_{i},(i)',C\) 都与决策点的选择无关，于是可以把它们看作常数，将仅与 \(j\) 有关的式子放在一边，可以得到方程 ：&lt;/p&gt;
\[
dp_j+(j)'=-(i)(j)+dp_i-(i)'-C
\]&lt;p&gt;我们发现这是一次函数的形式，考虑构造平面，平面上有一些点，形如 \(((j),dp_{j}+(j)').\) 我们发现，如果用一条斜率为 \(-(i)\) 的直线经过某个点，那么截距为 \(dp_{i}-(i)'-C.\) 由于我们要最大化 \(dp_{i}\)，等价于最大化这个截距，所以用这根斜率为 \(-(i)\) 的直线从上到下平移，第一个碰到的点就是决策点。&lt;/p&gt;
&lt;p&gt;于是现在问题就变成了维护一个凸包，我们发现有三种情况 ：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;当加入点按照横坐标单调递增的顺序，并且询问点单调递增时，可以直接维护单调队列，加入点对比队尾斜率，取答案从队首即可。&lt;/li&gt;
&lt;li&gt;当加入点按照横坐标单调的顺序时可以维护一个单调队列，每次加入时对比斜率，取答案二分。&lt;/li&gt;
&lt;li&gt;当加入点无序时直接用平衡树 &lt;code&gt;(std :: set)&lt;/code&gt; 维护，用 &lt;code&gt;lower_bound&lt;/code&gt; 查找插入点，然后向左右两边依次弹出，取答案也使用 &lt;code&gt;lower_bound&lt;/code&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;例题 ：
&lt;/p&gt;
&lt;h3 id="二分队列"&gt;二分队列&lt;/h3&gt;
&lt;p&gt;若 \(\rm DP\) 方程形如 ：&lt;/p&gt;
\[
dp_i=\min\limits_{j\lt i}\{dp_j+w_{j+1,i}\}
\]&lt;p&gt;根据决策单调性的推论，任何两个点 \(i,j(i\lt j)\) 之间都存在一个点 \(k\)，在 \(k\) 之前一段转移点为 \(i\)，在 \(k\) 之后某一段转移点为 \(j.\)&lt;/p&gt;
&lt;p&gt;我们发现如果能快速计算 \(w_{i,j}\)，那么就能 \(\Theta(\log n)\) 计算两个点 \(i,j\) 之间的决策分界点。&lt;/p&gt;
&lt;p&gt;我们发现所有相邻决策点的分界点可以用单调队列维护，具体来说 ：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;求当前的最优决策时判断一下队首和队次首谁更优，若队首最优则决策点为队首，否则决策点为队次首，并且将当前队首弹出。&lt;/li&gt;
&lt;li&gt;加入一个点时判断它是否能比队尾更快地替换掉队次尾，若能，则弹出队尾，重复操作。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;这样就可以快速地维护相邻点的决策分界点了。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\log n).\)&lt;/p&gt;
&lt;p&gt;例题 ：
&lt;/p&gt;
&lt;h3 id="二分栈"&gt;二分栈&lt;/h3&gt;
&lt;p&gt;有些题可能会有这样的奇怪性质 ：每个决策点只会被自己前面的点反超。&lt;/p&gt;
&lt;p&gt;我们发现某个决策点会经历这样的过程 ：一开始就比前面的优（否则就相当于一开始就被别人反超了），然后在最优决策的地方呆一会儿，最后被某个点反超。&lt;/p&gt;
&lt;p&gt;严格来说这根本不算决策单调性，但是仍然可以用二分栈来维护，因为两点的优劣仍旧可以 \(\Theta(\log n)\) 对比。具体来说 ：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;加入一个点时，若其比堆顶劣，则直接扔掉，若其比堆顶优，则留下。&lt;/li&gt;
&lt;li&gt;每一轮判断一下堆次顶是否比堆顶优，优则将堆顶弹出。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;这样堆顶就一直是当前转移的决策点。&lt;/p&gt;
&lt;p&gt;例题 ：\(\rm [POI2011]Lightning\ Conductor\)&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="习题"&gt;习题&lt;/h2&gt;
&lt;h3 id="noi1995-石子合并"&gt;[NOI1995] 石子合并&lt;/h3&gt;
&lt;p&gt;首先有暴力转移 ：&lt;/p&gt;
\[
dp_{l,r}=\min\limits_{i\leqslant k\lt j}\{dp_{i,k}+dp_{k+1,j}+w_{i,j}\}
\]&lt;p&gt;记录前缀和 \(sum\)，这里 \(w_{i,j}=sum_{j}-sum_{i-1}.\)&lt;/p&gt;
&lt;p&gt;\(w\) 显然满足四边形不等式和包含单调，于是考虑四边形不等式优化。&lt;/p&gt;
&lt;p&gt;然后就直接设 \(p_{i,j}\) 表示 \(dp_{i,j}\) 的转移点，成功转移的时候更新，枚举 \(dp_{i,j}\) 断点的时候只需要枚举 \([p_{i,j-1},p_{i+1,j}]\) 即可。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n^{2}).\)&lt;/p&gt;
&lt;h3 id="sdoi2016征途"&gt;[SDOI2016]征途&lt;/h3&gt;
&lt;p&gt;首先易知，设每一天走的长度为 \(d\)，则答案为 ：&lt;/p&gt;
\[
m\sum_{i=1}^m(d_i-ave)^2=m\sum_{i=1}^md_i^2-\left(\sum_{i=1}^md_i\right)^2
\]&lt;p&gt;容易观察到此题本质上是在求 \(\left(\sum_{i=1}^{m}d_{i}\right)^{2}_{\min}\)，于是设 \(f_{i,j}\) 表示当前已经考虑到第 \(i\) 段，当前已经分成了 \(j\) 段的最小 \(\sum_{p=1}^{j}d_{p}.\) 枚举转移点，容易得到转移方程 ：&lt;/p&gt;
\[
f_{i,j}=\min\limits_{k\lt i}\{f_{k,j-1}+(s_i-s_k)^2\}
\]&lt;p&gt;易证 \(w_{i,j}=(s_{j}-s_{i})^{2}\) 满足四边形不等式，所以该转移方程满足决策单调性。我们还发现转移方程只在相邻层之间转移，所以可以使用分治转移。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n^{2}\log n).\)&lt;/p&gt;
&lt;p&gt;还有斜率优化的做法，注意到转移方程是可以变形的 ：&lt;/p&gt;
\[
f_{i,j}=f_{k,j-1}+(s_i-s_k)^2
\]\[
\iff f_{i,j}=f_{k,j-1}+s_i^2-2s_is_k+s_k^2
\]\[
\iff f_{k,j-1}+s_k^2=2s_i\cdot s_k+f_{i,j}-s_i^2
\]&lt;p&gt;易知插入点横坐标有序，询问斜率也有序，所以可以直接使用单调队列维护，每一层分开转移。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n^{2}).\)&lt;/p&gt;
&lt;h3 id="p5574任务分配问题"&gt;[P5574]任务分配问题&lt;/h3&gt;
&lt;p&gt;非常套路的分治 \(+\) 决策单调性优化 \(\rm DP.\)&lt;/p&gt;
&lt;p&gt;首先定义 \(w_{i,j}\) 表示 \(i\sim j\) 的顺序对个数，设 \(f_{i,j}\) 表示当前已经考虑到第 \(i\) 个任务，将他们分成 \(j\) 段的最小顺序对数量之和，易得转移方程 ：&lt;/p&gt;
\[
f_{i,j}=\min\limits_{k\lt i}\{f_{k,j-1}+w_{k+1,i}\}
\]&lt;p&gt;对于任意 \(a\leqslant b\leqslant c\leqslant d\)，使用容斥易证 \(w_{a,c}+w_{b,d}-w_{b,c}\leqslant w_{a,d}\)，故 \(w\) 满足四边形不不等式。进一步的，\(f\) 的转移满足决策单调性。&lt;/p&gt;
&lt;p&gt;有了决策单调性，我们就可以分治转移，同时令人惊喜的是，转移时需要遍历一段连续的区间并计算每一个位置的贡献，于是用莫队和 \(\rm BIT\) 维护一下就好了。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(nk\log^{2n}).\)&lt;/p&gt;</description></item><item><title>十二类基本组合问题</title><link>https://sichen-wang.github.io/blog/%E5%8D%81%E4%BA%8C%E7%B1%BB%E5%9F%BA%E6%9C%AC%E7%BB%84%E5%90%88%E9%97%AE%E9%A2%98/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E5%8D%81%E4%BA%8C%E7%B1%BB%E5%9F%BA%E6%9C%AC%E7%BB%84%E5%90%88%E9%97%AE%E9%A2%98/</guid><description>&lt;p&gt;小球入盒问题是所有组合问题的基础，它计算的是形如 “\(n\) 个球放进 \(m\) 个盒子的方案数” 的一类问题，在这类问题中一般存在三种限制 ：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;小球是否有编号。&lt;/li&gt;
&lt;li&gt;盒子是否有编号。&lt;/li&gt;
&lt;li&gt;盒子中球的数量是无限制，至少一个还是至多一个。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;记有编号为 \(L\rm(labelled)\)，无编号为 \(U\rm(unlabelled)\)，盒子中球的数量限制分别为 \(A,B,C\)，这样我们就可以将一个问题用三个字母简记，如 \(\rm LUB\) 表示将 \(n\) 个有标号小球放进 \(m\) 个无标号盒子里，每个盒子中至少有一个球的方案数。&lt;/p&gt;
&lt;p&gt;可以发现问题共有 \(12\) 类，现在我们来一个个分析。&lt;/p&gt;
&lt;h3 id="part1-lla"&gt;Part1 LLA&lt;/h3&gt;
&lt;p&gt;将 \(n\) 个有标号的球放进 \(m\) 个有标号的盒子里，每个盒子中球的数量没有限制的方案数。&lt;/p&gt;
&lt;p&gt;可以看作每次从 \(m\) 个盒子里任选一个，一共要放 \(n\) 次，没有其他限制，故方案数为 ：&lt;/p&gt;
\[
\boxed{m^n}
\]&lt;h3 id="part2-ula"&gt;Part2 ULA&lt;/h3&gt;
&lt;p&gt;将 \(n\) 个无标号的球放进 \(m\) 个有标号的盒子里，每个盒子中球的数量没有限制的方案数。&lt;/p&gt;
&lt;p&gt;在这个问题中我们只关心对每个盒子里面球的数量，所以这个问题的方案数等于方程 \(x_{1}+x_{2}+\cdots +x_{m}=n\) &lt;strong&gt;非负整数解&lt;/strong&gt;的数量，用隔板法可以求得其为 ：&lt;/p&gt;
\[
\boxed{\dbinom{n+m-1}{m-1}}
\]&lt;h3 id="part3-ulb"&gt;Part3 ULB&lt;/h3&gt;
&lt;p&gt;将 \(n\) 个无标号的球放进 \(m\) 个有标号的盒子里，每个盒子中球的数量至少为 \(1\) 的方案数。&lt;/p&gt;
&lt;p&gt;这个问题与上个问题相似，方案数等于方程 \(x_{1}+x_{2}+\cdots +x_{m}=n\) &lt;strong&gt;正整数解&lt;/strong&gt;的数量，用隔板法可以求得其为 ：&lt;/p&gt;
\[
\boxed{\dbinom{n-1}{m-1}}
\]&lt;h3 id="part4-llc"&gt;Part4 LLC&lt;/h3&gt;
&lt;p&gt;将 \(n\) 个有标号的球放进 \(m\) 个有标号的盒子里，每个盒子中球的数量至多为 \(1\) 的方案数。&lt;/p&gt;
&lt;p&gt;我们发现这个问题等价于依次为每个球选择一个盒子，故答案为 ：&lt;/p&gt;
\[
\boxed{m^{\underline{n}}}
\]&lt;h3 id="part5-ulc"&gt;Part5 ULC&lt;/h3&gt;
&lt;p&gt;将 \(n\) 个无标号的球放进 \(m\) 个有标号的盒子里，每个盒子中球的数量至多为 \(1\) 的方案数。&lt;/p&gt;
&lt;p&gt;相当于是为每一个盒子选择数量，等价于从 \(m\) 个盒子中选出 \(n\) 个，让它的数量为 \(1\)，故方案数为 ：&lt;/p&gt;
\[
\boxed{\dbinom{m}{n}}
\]&lt;h3 id="part6-luc"&gt;Part6 LUC&lt;/h3&gt;
&lt;p&gt;将 \(n\) 个有标号的球放进 \(m\) 个无标号的盒子里，每个盒子中球的数量至多为 \(1\) 的方案数。&lt;/p&gt;
&lt;p&gt;盒子顺序可以任意交换，所以任意一种方案都等价，发现当球数超过盒子数时无解，故方案数为 ：&lt;/p&gt;
\[
\boxed{[n\leqslant m]}
\]&lt;h3 id="part7-uuc"&gt;Part7 UUC&lt;/h3&gt;
&lt;p&gt;将 \(n\) 个无标号的球放进 \(m\) 个无标号的盒子里，每个盒子中球的数量至多为 \(1\) 的方案数。&lt;/p&gt;
&lt;p&gt;理由同上，方案数为 ：&lt;/p&gt;
\[
\boxed{[n\leqslant m]}
\]&lt;h3 id="part8-llb"&gt;Part8 LLB&lt;/h3&gt;
&lt;p&gt;将 \(n\) 个有标号的球放进 \(m\) 个有标号的盒子里，每个盒子中球的数量至少为 \(1\) 的方案数。&lt;/p&gt;
&lt;p&gt;考虑使用容斥原理，枚举有多少个盒子为空，剩下的盒子随便填，故方案数为 ：&lt;/p&gt;
\[
\boxed{\sum_{i=0}^m(-1)^i\dbinom{m}{i}(m-i)^n}
\]&lt;p&gt;利用 \(\rm Part9\) 中讲到的第二类斯特林数也可以 \(\rm LLB\) 问题的方案数表示为 ：&lt;/p&gt;
\[
\boxed{\begin{Bmatrix}n\\ m\end{Bmatrix}m!}
\]&lt;h3 id="part9-lub"&gt;Part9 LUB&lt;/h3&gt;
&lt;p&gt;将 \(n\) 个有标号的球放进 \(m\) 个无标号的盒子里，每个盒子中球的数量至少为 \(1\) 的方案数。&lt;/p&gt;
&lt;p&gt;只需要将 \(m\) 个盒子排序产生的方案去除即可，故方案数为 :&lt;/p&gt;
\[
\boxed{\sum_{i=0}^m\frac{(-1)^i(m-i)^n}{i!(m-i)!}}
\]&lt;p&gt;\(\rm LUB\) 问题的答案被定义为 “第二类斯特林数”，递推式如下 ：&lt;/p&gt;
\[
\boxed{\begin{Bmatrix}n\\ m\end{Bmatrix}=m\begin{Bmatrix}n-1\\ m\end{Bmatrix}+\begin{Bmatrix}n-1\\ m-1\end{Bmatrix}}
\]&lt;p&gt;其含义为考虑新加入一个有标号小球，可以将其加入之前的任意一个盒子，也可以为它单独开一个盒子，方案数相加。&lt;/p&gt;
&lt;h3 id="part10-lua"&gt;Part10 LUA&lt;/h3&gt;
&lt;p&gt;将 \(n\) 个有标号的球放进 \(m\) 个无标号的盒子里，每个盒子中球的数量无限制的方案数。&lt;/p&gt;
&lt;p&gt;记 \(\rm LUA\) 问题的方案数为 \(B_{n}\)，读作贝尔数。因为若某个盒子为空可以看作没有这个盒子，故 \(B_{n}\) 表示将 \(n\) 个数划分成任意个集合的方案数，有 ：&lt;/p&gt;
\[
\boxed{B_n=\sum_{i=1}^n\begin{Bmatrix}n\\ i\end{Bmatrix}}
\]&lt;p&gt;同时，我们发现它也可以递推，有递推式 ：&lt;/p&gt;
\[
\boxed{B_{n+1}=\sum_{i=0}^n\dbinom{n}{i}B_i}
\]&lt;p&gt;其含义为第 \(n+1\) 个数若和之前的 \(i\) 个数放在一起，方案数为 \(\tbinom{n}{i}B_{n-i}\)。&lt;/p&gt;
&lt;h3 id="part11-uua"&gt;Part11 UUA&lt;/h3&gt;
&lt;p&gt;将 \(n\) 个无标号的球放进 \(m\) 个无标号的盒子里，每个盒子中球的数量无限制的方案数。&lt;/p&gt;
&lt;p&gt;我们发现其实这就是划分数，求法如下 ：&lt;/p&gt;
&lt;p&gt;记 \(f_{i,j}\) 表示将 \(i\) 划分成不超过 \(j\) 的数的方案数，当计算 \(f_{i,j}\) 时，其方案数可以从 \(f_{i-j,j}\) 继承，表示分出去一个大小为 \(j\) 的数，其方案数也可以从 \(f_{i,j-1}\) 继承，表示不选大小为 \(j\) 的数。故有转移方程 ：&lt;/p&gt;
\[
f_{i,j}=f_{i-j,j}+f_{i,j-1}
\]&lt;p&gt;我们发现 \(f\) 的转移就是一个完全背包，所以考虑将其改写为一维形式，即 ：&lt;/p&gt;
\[
f_j=\sum_{i=1}^nf_{j-i}
\]&lt;p&gt;记 \(g_{i,j}\) 表示将 \(i\) 划分成 \(j\) 个数的方案，当计算 \(g_{i,j}\) 时，其方案数可以从 \(g_{i-j,j}\) 继承，表示将所有数 \(+1\)，其方案数也可以从 \(g_{i-1,j-1}\) 继承，表示新增一个大小为 \(1\) 的数。我们发现后增加的数一定比前增加的数小，所以不重，这样一定能遍历到所有合法的划分，所以不漏，故有转移方程 ：&lt;/p&gt;
\[
g_{i,j}=g_{i-j,j}+g_{i-1,j-1}
\]&lt;p&gt;这两种方式都可以做到 \(\Theta(n^{2})\)。&lt;/p&gt;
&lt;p&gt;我们分析两种方式的优劣，发现第一种算法主要依赖于划分成的数大小的上界，第二种算法主要依赖于划分成数的数量，于是考虑根号分治。将问题看成一个完全背包，物品按照占用空间小于等于 \(\sqrt{n}\) 和大于 \(\sqrt{n}\) 分类即可。&lt;/p&gt;
&lt;p&gt;同时，由于 \(g\) 计算的只有物品占用空间大于 \(\sqrt{n}\) 的情况，所以转移方程要改写成 :&lt;/p&gt;
\[
g_{i,j}=g_{i-j,j}+g_{i-\sqrt{n},j-1}
\]&lt;p&gt;每次加入一个 \(\sqrt{n}\) 就可以保证所有数都大于 \(\sqrt{n}\) 了。&lt;/p&gt;
&lt;p&gt;最后统计答案的时候直接枚举 \(i\)，然后将 \(f_{i}\) 和 \(g_{n-i,k}\) 乘起来即可。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\sqrt{n})\)。&lt;/p&gt;
&lt;h3 id="part12-uub"&gt;Part12 UUB&lt;/h3&gt;
&lt;p&gt;将 \(n\) 个无标号的球放进 \(m\) 个无标号的盒子里，每个盒子中球的数量 至少为 \(1\) 的方案数。&lt;/p&gt;
&lt;p&gt;我们发现只需要先在每个盒子中放 \(1\) 个球就可以了，等价于 \(\rm UUA\) 问题中 \(n-m\) 个球，\(m\) 个盒子的情况。&lt;/p&gt;</description></item><item><title>原根和阶</title><link>https://sichen-wang.github.io/blog/%E5%8E%9F%E6%A0%B9%E5%92%8C%E9%98%B6/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E5%8E%9F%E6%A0%B9%E5%92%8C%E9%98%B6/</guid><description>&lt;h2 id="阶的定义及求法"&gt;阶的定义及求法&lt;/h2&gt;
&lt;p&gt;称使得 \(a^{t}\equiv 1\pmod p\) 成立的最小正整数 \(t_{min}\) 为 \(a\) 对模数 \(p\) 的阶，记为 \(\delta_{p}(a)\)。&lt;/p&gt;
&lt;p&gt;有如下定理 ：\(\delta_{p}(a) \mid n\Longleftrightarrow a^{n}\equiv 1\pmod p\)。&lt;/p&gt;
&lt;p&gt;又有 \(a^{\varphi(p)}\equiv 1\pmod p\Longrightarrow \delta_{p}(a) \mid \varphi(p)\) 可得一个 \(\Theta(\sqrt{p}+\log^{2p})\) 求阶的算法：&lt;/p&gt;
&lt;p&gt;首先将 \(\varphi(p)\) 分解成 \(\varphi(p)=k_{1}^{q_{1}}\times k_{2}^{q_{2}}\times \cdots \times k_{r}^{q_{r}}\) 的形式，令 \(\delta_{p}(a)=\varphi(p)\)，然后试着用每一个质因子去除 \(\delta_{p}(a)\)，如果除了之后 \(a^{\frac{\delta_{p}(a)}{k_{i}}}\equiv 1\pmod p\) 那么 \(\frac{\delta_{p}(a)}{k_{i}}\) 就作为新的阶，直到不能再除，此时的 \(\delta_{p}(a)\) 就为 \(a\) 在模 \(p\) 意义下真正的阶。&lt;/p&gt;
&lt;h2 id="原根的定义及求法"&gt;原根的定义及求法&lt;/h2&gt;
&lt;p&gt;原根 \(g\) 是使得 \(g^{1\sim p-1}\) 在模 \(p\) 意义下的值与 \([1,p-1]\) 形成一一对应关系的值。&lt;/p&gt;
&lt;p&gt;有如下定理 ：\(g\) 为 \(p\) 的原根当且仅当 \(\delta_{p}(g)=\varphi(p)\)。&lt;/p&gt;
&lt;p&gt;于是可以导出一个计算 \(g_{min}\) 的算法，从小到大枚举 \(g\)，若 \(\delta_{p}(g)=\varphi(p)\)，则 \(g\) 为 \(p\) 的最小原根。&lt;/p&gt;
&lt;p&gt;有如下定理 ：\(g_{min}\lt p^{\frac{1}{4}}\)。&lt;/p&gt;
&lt;p&gt;所以以上算法时间复杂度为 \(\Theta(\sqrt{p}+p^{\frac{1}{4}}\omega(p))\)。&lt;/p&gt;</description></item><item><title>反悔贪心</title><link>https://sichen-wang.github.io/blog/%E5%8F%8D%E6%82%94%E8%B4%AA%E5%BF%83/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E5%8F%8D%E6%82%94%E8%B4%AA%E5%BF%83/</guid><description>&lt;h2 id="算法简介"&gt;算法简介&lt;/h2&gt;
&lt;p&gt;反悔贪心是对贪心策略的一种优化，有些时候贪心策略是错的，但如果可以撤销之前的操作，那么就会变为正确的。&lt;/p&gt;
&lt;p&gt;反悔贪心主要有两种。一种是反悔堆，即将之前没有选择的操作加入一个（类）堆中，保证每次取出的堆顶都是当前没有选择的策略中最优的，若由于当前操作，则将其替换。还有一种是反悔自动机，可以设计一个自动机来决策当前的操作。&lt;/p&gt;
&lt;p&gt;另外，有一种观点认为反悔贪心的本质是贪心模拟费用流，我认为是有一定道理的，这种观点也有利于解释反悔贪心的正确性。&lt;/p&gt;
&lt;h2 id="经典例题"&gt;经典例题&lt;/h2&gt;
&lt;h3 id="usaco09open-work-scheduling-g"&gt;[USACO09OPEN] Work Scheduling G&lt;/h3&gt;
&lt;p&gt;反悔贪心板子题。&lt;/p&gt;
&lt;p&gt;按任务按截止时间排序，若当前这个工作做得了（即已经做的件数小于这个工作的截止日期），那么直接做，并把它的价值放进优先队列中。若当前这个工作没时间做了，我们发现如果把前面一个工作去除，这个工作就做得了，于是对比小根堆顶的价值与他的价值，谁大就保留谁。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\log n)\)。&lt;/p&gt;
&lt;h3 id="jsoi2007-建筑抢修"&gt;[JSOI2007] 建筑抢修&lt;/h3&gt;
&lt;p&gt;反悔贪心板子题 \(\times 2\)。&lt;/p&gt;
&lt;p&gt;我们发现每个建筑的贡献都是一样的。按建筑的 \(T2\) 排序，一个个枚举，若当前建筑可以修（即之前已经选的建筑的 \(T1\) 之和加上当前这个建筑的 \(T1\) 不大于当前建筑的 \(T2\)），那么就直接将这个建筑的 \(T1\) 加上并放进优先队列，并把答案 \(+1.\) 若不能修，考虑到价值一样的情况下最小化总修理时间，那么将大根堆的堆顶取出，若其大于当前点的 \(T1\)，更新花费总时间。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\log n)\)。&lt;/p&gt;
&lt;h3 id="p2107-小-z-的-ak-计划"&gt;[P2107] 小 Z 的 AK 计划&lt;/h3&gt;
&lt;p&gt;反悔贪心板子题 \(\times 3\)。&lt;/p&gt;
&lt;p&gt;首先按机房位置升序考虑，假设你有一种到了机房就必须 \(\rm AK\) 的欲望（实际上是因为如果不 \(\rm AK\) 这个机房，就没必要走到这里，而是在之前停下），那么如果当前的总用时加上 \(\rm AK\) 这个机房的用时不到 \(m\) 的时候，你就可以直接 \(\rm AK\)，并将这个机房的 \(\rm AK\) 用时加入大根堆。若当前时间不够，就不断弹出堆顶，直到剩下的时间足够 \(\rm AK.\) 一边枚举一边记录当前最优答案即可。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\log n)\)。&lt;/p&gt;
&lt;h3 id="cf865d-buy-low-sell-high"&gt;[CF865D] Buy Low Sell High&lt;/h3&gt;
&lt;p&gt;首先考虑一个贪心，对每个数选择它后面第一个比他大并且还没被选择的数，容易发现这样是错的，\(\rm Hack\) 数据如下 ：&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;4
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1 2 3 4
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;于是我们考虑给上面那个贪心加上反悔操作，每次将当前值放入小根堆中，若当前枚举的这个数大于小根堆堆顶，那么就将其卖掉，获得 &lt;code&gt;a[i] - Q.top()&lt;/code&gt; 的贡献。同时，为了之后能够反悔，我们还要将它也加入堆中，我们发现，如果后面还有一个数将其卖出，那么其等价于直接将此时的堆顶卖出。这样一来，如果我们认为某个点要卖出，那么它就要入堆两次。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\log n)\)。&lt;/p&gt;
&lt;h3 id="国家集训队-种树"&gt;[国家集训队] 种树&lt;/h3&gt;
&lt;p&gt;考虑选了一个数以后会发生什么，它两边的数都不能选了。于是考虑在选了一个点之后，把它两边的数标为不能选，然后在原处加入一个权值为 \(a_{i-1}+a_{i+1}-a_{i}\) 的点。每次取最大的点，若已标为不能选，就跳过，否则选他，然后将两边的点删去，更新链表顺序。&lt;/p&gt;
&lt;p&gt;容易证明这样做是对的，并且可以用优先队列维护，时间复杂度 \(\Theta(n\log n)\)。&lt;/p&gt;</description></item><item><title>复杂度分析</title><link>https://sichen-wang.github.io/blog/%E5%A4%8D%E6%9D%82%E5%BA%A6%E5%88%86%E6%9E%90/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E5%A4%8D%E6%9D%82%E5%BA%A6%E5%88%86%E6%9E%90/</guid><description>&lt;h2 id="主定理"&gt;主定理&lt;/h2&gt;
&lt;p&gt;主定理 \(\rm(Master\ Theorem)\) 被用来求解一类递归算法的时间复杂度，假设有递推式形如:&lt;/p&gt;
\[
T(n) = aT\left(\frac{n}{b}\right) + f(n)
\]&lt;p&gt;上式的含义是，存在一个规模为 \(n\) 的问题可以被划分成 \(a\) 个规模为 \(\frac{n}{b}\) 的问题，且将它们合并的运算复杂度为 \(f(n)\)。&lt;/p&gt;
&lt;p&gt;那么根据主定理，有 ：&lt;/p&gt;
\[
T(n) =
\begin{cases}
\Theta\left(n^{\log _{b} a}\right) &amp; f(n)=O\left(n^{\log _{b} a-\epsilon}\right) \\
\Theta(f(n)) &amp; f(n)=\Omega\left(n^{\log _{b} a+\epsilon}\right) \\
\Theta\left(n^{\log _{b} a} \log ^{k+1} n\right) &amp; f(n)=\Theta\left(n^{\log _{b} a} \log ^{k} n\right), k \geq 0
\end{cases}
\]</description></item><item><title>多项式</title><link>https://sichen-wang.github.io/blog/%E5%A4%9A%E9%A1%B9%E5%BC%8F/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E5%A4%9A%E9%A1%B9%E5%BC%8F/</guid><description>&lt;h2 id="拉格朗日插值"&gt;拉格朗日插值&lt;/h2&gt;
&lt;p&gt;插值问题形如 ：给定 \(n\) 个点的坐标 \((x, y)\)，要求出一个经过所有点的最低次多项式。&lt;/p&gt;
&lt;h3 id="一般插值"&gt;一般插值&lt;/h3&gt;
&lt;p&gt;容易构造出 \(f(x)\) 即为下式 ：&lt;/p&gt;
\[
f(x) = \sum _{i = 1} ^{n} y_i \prod _{j \not= i} \frac{x - x_j}{x_i - x_j}\tag{1.1.1}
\]&lt;p&gt;正确性显然。&lt;/p&gt;
&lt;p&gt;容易证明多项式次数至少为 \(n - 1\) 才可以确保穿过 \(n\) 个点，故最优性得证。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n^{2})\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;2e3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;998244353&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Pow&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;S1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;S2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;S1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S1&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;S2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;S1&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;S2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="点值连续的插值"&gt;点值连续的插值&lt;/h3&gt;
&lt;p&gt;当给定的点值连续时，式子可以改写为 ：&lt;/p&gt;
\[
\begin{aligned}
f(x) = \sum _{i = 1} ^{n} y_i \prod _{j \not= i} \frac{x - j}{i - j} = \sum _{i = 1} ^{n} y_i \frac{\prod \limits _{j \not= i}(x - j)}{\prod \limits_{j \not= i}(i - j)}
\end{aligned}
\]&lt;p&gt;考虑计算分子，记 \(pre_{i} = \prod_{j = 1}^{i} (x - j), suf_{i} = \prod_{j = i}^{n} (x - j)\)，显然 \(\prod_{j \not= i}(x - j) = pre_{i - 1}\times suf_{i + 1}\)。&lt;/p&gt;
&lt;p&gt;考虑计算分母，记 \(sym(x) = 1 - 2[x \equiv 1 \pmod 2]\)，显然 \(\prod_{j \not= i}(i - j) = (i - 1)!\times sym(n - i)(n - i)!\)。&lt;/p&gt;
&lt;p&gt;全部带入可将式 \((1.2.1)\) 改写为 ：&lt;/p&gt;
\[
f(x) = \sum _{i = 1} ^n y_i \frac{pre_{i - 1}\times suf_{i + 1}}{(i - 1)!\times sym(n - i)(n - i)!} \tag{1.2.2}
\]&lt;p&gt;时间复杂度 \(\Theta(n)\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;F&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fac&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;pre&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;suf&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;pre&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pre&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;suf&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;suf&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;pre&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;suf&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(((&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="重心拉格朗日插值法"&gt;重心拉格朗日插值法&lt;/h3&gt;
&lt;p&gt;考虑一般插值的优化。&lt;/p&gt;
&lt;p&gt;观察式 \((1.1.1)\)，设 :&lt;/p&gt;
\[
G = \prod _{i = 1} ^n (x - x_i) \tag{1.3.1}
\]\[
T_i = \frac{y_i}{\prod \limits_{j \not= i} (x_i - x_j)} \tag{1.3.2}
\]&lt;p&gt;将式 \((1.3.1)\) 和 \((1.3.2)\) 带入式 \((1.1.1)\) 可得 ：&lt;/p&gt;
\[
f(x) = G \sum _{i = 1} ^{n} \frac{T_i}{x - x_i} \tag{1.3.3}
\]&lt;p&gt;如此一来，新加入一个点就只需要计算它的 \(T\) 值了，时间复杂度为 \(\Theta(n)\)。&lt;/p&gt;
&lt;h3 id="还原插值多项式的系数"&gt;还原插值多项式的系数&lt;/h3&gt;
&lt;p&gt;考虑对式 \((1.1.1)\) 作变形 ：&lt;/p&gt;
\[
f(x) = \sum _{i = 1} ^{n} \frac{y_i}{\prod \limits_{j \not= i}(x_i - x_j)} \prod _{j \not= i} (x - x_j)\tag{1.4.1}
\]&lt;p&gt;可以 \(\Theta(n^{2})\) 预处理 \(\prod_{i = 1}^{n} (x - x_{i})\)，然后在需要求 \(\prod_{j \not= i} (x - x_{j})\) 时将预处理出的多项式除以 \((x - x_{i})\) ，可以做到单次 \(\Theta(n)\) 的时间复杂度。&lt;/p&gt;
&lt;p&gt;还原插值多项式系数的时间复杂度为 \(\Theta(n^{2})\)。&lt;/p&gt;
&lt;h3 id="自然数幂前缀和"&gt;自然数幂前缀和&lt;/h3&gt;
&lt;p&gt;有定理：不大于 \(n\) 的自然数 \(k\) 次幂和是一个关于 \(n\) 的 \(k + 1\) 次多项式。&lt;/p&gt;
&lt;p&gt;\(\rm Proof :\)&lt;/p&gt;
&lt;p&gt;设 \(f_{k}(n) = \sum \limits_{i = 1}^{n} i^{k}\)。&lt;/p&gt;
&lt;p&gt;当 \(k = 1\) 时，\(f_{k}(n) = \sum \limits_{i = 1}^{n} i = \frac{1}{2}n^{2} + \frac{1}{2} n\)，是一个 \(k + 1\) 次多项式。&lt;/p&gt;
&lt;p&gt;假设 \(f_{k - 1}(n)\) 是一个关于 \(n\) 的 \(k\) 次多项式。&lt;/p&gt;
&lt;p&gt;即 \(f_{k - 1}(n) = a_{0} + a_{1} n + a_{2} n^{2} + \cdots + a_{k} n^{k}\)。&lt;/p&gt;
\[
\begin{aligned}
f_k(n) &amp;= \sum _{i = 1} ^n i\times i ^ {k - 1}\\
&amp;= \sum _{i = 0} ^{n - 1} f_{k - 1}(n) - f_{k - 1}(i)\\
&amp;= nf_{k - 1}(n) - \sum _{i = 1} ^{n - 1} f_{k - 1}(i)\\
&amp;= a_0 n + a_1 n ^ 2 + \cdots + a_k n ^ {k + 1} - \sum _{i = 1} ^{n - 1} f_{k - 1}(i)
\end{aligned}
\]&lt;p&gt;容易发现，由于 \(f_{k - 1}(i)\) 中次数最高的项为 \(k\) 次项，并且 \(f_{k}(n)\) 中含有关于 \(n\) 的 \(k + 1\) 次项，所以 \(f_{k}(n)\) 是关于 \(n\) 的 \(k + 1\) 次多项式。&lt;/p&gt;
&lt;p&gt;归纳可得 ：\(\forall k\geqslant 1,\ f_{k}(n)\) 是关于 \(n\) 的 \(k\) 次多项式。&lt;/p&gt;
&lt;p&gt;于是可以使用点值连续的拉格朗日插值计算 \(\sum \limits_{i = 1}^{n} i^{k}\)，时间复杂度 \(\Theta(k)\)。&lt;/p&gt;
&lt;h2 id="快速傅里叶变换"&gt;快速傅里叶变换&lt;/h2&gt;
&lt;p&gt;快速傅里叶变换 \(\rm(Fast\ Fourier\ Transformation,FFT)\) 被用来在 \(\Theta(n\log n)\) 的时间复杂度下求两个多项式的乘积（和卷积）。&lt;/p&gt;
&lt;p&gt;若称 \(h(x) = f(x) \times g(x)\)，则应满足关系式 ：&lt;/p&gt;
\[
h(k) = \sum _{i + j = k} f(i) \times g(j) \tag{2.0.1}
\]&lt;h3 id="单位根"&gt;单位根&lt;/h3&gt;
&lt;p&gt;众所周知，有欧拉公式 ：&lt;/p&gt;
\[
e^{i\theta} = \cos \theta + i\sin \theta \tag{2.1.1}
\]&lt;p&gt;根据高中课本上所讲的，我们知道任意一个复数可以被表示成 \(r(\cos \theta + i\sin \theta)\) 的形式，根据式 \((2.1.1)\)，可以发现其等价于 \(r \cdot e^{i\theta}\)，所以两个复数相乘，模长 \((r)\) 相乘，幅角 \((\theta)\) 相加。&lt;/p&gt;
&lt;p&gt;考虑方程 \(x^{n} = 1\)，容易发现它在复数域内有 \(n\) 个解，解集为 \(\{e^{i\theta} \mid \theta = \frac{2k\pi}{n},k = 0,1,2, \cdots, n - 1 \}\)，将其简记为 \(\omega_{n}^{0},\omega_{n}^{1},\cdots,\omega_{n}^{n - 1}\)，进一步观察可以发现，它们是复平面中单位圆上的 \(n\) 等分点。&lt;/p&gt;
&lt;p&gt;之所以会在 \(\rm FFT\) 中用到单位根，主要是因为它具有以下性质 ：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;折半性质 ：&lt;/strong&gt;&lt;/p&gt;
\[
\omega_{2n} ^ {2k} = \omega _n ^k \tag{2.1.2}
\]&lt;p&gt;\(\rm Proof :\) 显然有 \(\omega_{n}^{k} = (\omega_{n}^{1})^{k}\) 和 \(\omega_{n}^{1} = \omega_{2n}^{2}\)。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;对称性质 ：&lt;/strong&gt;&lt;/p&gt;
\[
\omega _{2n} ^ {k + n} = -\omega _{2n} ^{k} \tag{2.1.3}
\]&lt;p&gt;\(\rm Proof :\) 这里定义 \(-z\) 为 \(z\) 关于原点的对称点，显然有 \(\omega_{2n}^{n} = -1\)，\(\omega_{2n}^{k + n} = \omega_{2n}^{k}\times \omega_{2n}^{n} = -\omega_{2n}^{k}\)。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;求和性质&lt;/strong&gt; ：&lt;/p&gt;
\[
\sum _{i = 0} ^{n - 1} \left(\omega_{n} ^k\right) ^i = n[k = 0] \tag{2.1.4}
\]&lt;p&gt;\(\rm Proof :\)&lt;/p&gt;
&lt;p&gt;首先使用等比数列求和公式 ：&lt;/p&gt;
\[
\sum _{i = 0} ^{n - 1} \left(\omega_{n} ^k\right) ^i = \frac{1 - \left(\omega_{n} ^k\right)^n}{1 - \omega_n^k} \tag{2.1.5}
\]&lt;p&gt;考虑分类讨论 ：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;当 \(k = 0\) 时，原式显然等于 \(n\)。&lt;/li&gt;
&lt;li&gt;当 \(k \not = 0\) 时，\(1 - \omega_{n}^{k} \not = 0\)，\(1 - \left(\omega_{n}^{k}\right)^{n} = 0\)，故原式等于 \(0\)。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="离散傅里叶变换"&gt;离散傅里叶变换&lt;/h3&gt;
&lt;p&gt;离散傅里叶变换 \(\rm(Discrete\ Fourier\ Transform,DFT)\) 被用于求出多项式的 \(n\) 个点值，其中 \(n\) 为多项式的项数，\(\rm DFT\) 是 \(\rm FFT\) 的前半部分。&lt;/p&gt;
&lt;p&gt;对于一个多项式 \(F(x) = a_{0} + a_{1} x + a_{2} x^{2} + \cdots + a_{n - 1} x^{n - 1}\)，不妨设 ：&lt;/p&gt;
\[
\begin{aligned}
F_1(x) = a_0 + a_2x + a_4x^2 + \cdots + a_{n - 2}x^{\frac{n}{2} - 1}\\
F_2(x) = a_1 + a_3x + a_5x^2 + \cdots + a_{n - 1}x^{\frac{n}{2} - 1}
\end{aligned}
\]&lt;p&gt;于是有 \(F(x) = F_{1}(x^{2}) + xF_{2}(x^{2})\)。&lt;/p&gt;
&lt;p&gt;将 \(\omega_{n}^{k}\) 带入可得 ：&lt;/p&gt;
\[
F(\omega_n^k) = F_1(\omega_n^{2k}) + \omega_n^k F_2(\omega_n^{2k}) \tag{2.2.1}
\]&lt;p&gt;根据式 \((2.1.2)\) 可得 ：&lt;/p&gt;
\[
F(\omega_n^k) = F_1(\omega_{n/2}^{k}) + \omega_n^k F_2(\omega_{n/2}^{k}) \tag{2.2.2}
\]&lt;p&gt;考虑分类讨论 ：&lt;/p&gt;
&lt;p&gt;对于 \(k \lt \frac{n}{2} \)，只需要直接递归处理 \(F_{1}\) 和 \(F_{2}\) 即可。
对于 \(k \geqslant \frac{n}{2}\)，我们不妨它为 \(k + \frac{n}{2}\ (k \lt \frac{n}{2})\)，于是有 ：&lt;/p&gt;
\[
F(\omega_n^{k + n/2}) = F_1(\omega_n^{2k + n}) + \omega_n^{k + n/2} F_2(\omega_n^{2k + n}) \tag{2.2.3}
\]&lt;p&gt;根据式 \((2.1.2)\) 和 \((2.1.3)\) 可得 ：&lt;/p&gt;
\[
F(\omega _ n ^ k) = F_1(\omega_{n / 2} ^ k) - \omega _ n ^ k F_2(\omega_{n/2}^k) \tag{2.2.4}
\]&lt;p&gt;观察发现，式 \((2.2.2)\) 和 \((2.2.4)\) 之间仅相差一个符号，这意味着我们只需要递归求出 \(F_{1}\) 和 \(F_{2}\) 的 \(\frac{n}{2}\) 个点值就可以在 \(\Theta(n)\) 的时间复杂度下求出 \(F\) 的 \(n\) 个点值。&lt;/p&gt;
&lt;p&gt;因为最多递归 \(\log n\) 次，每一层的总时间复杂度为 \(\Theta(n)\)，所以 \(\rm DFT\) 过程的时间复杂度为 \(\Theta(n\log n)\)。&lt;/p&gt;
&lt;h3 id="离散傅里叶逆变换"&gt;离散傅里叶逆变换&lt;/h3&gt;
&lt;p&gt;离散傅里叶逆变换 \(\rm(Inverse\ Discrete\ Fourier\ Transform,IDFT)\) 被用于将多项式的点值表示还原成系数表示，是 \(\rm FFT\) 的后半部分。&lt;/p&gt;
&lt;p&gt;在 \(\rm DFT\) 过程中我们已经将待乘函数 \(f(x)\) 和 \(g(x)\) 的点值表示分别求了出来，易知它们卷积的点值序列为它们点值序列各处分别相乘的结果。&lt;/p&gt;
&lt;p&gt;设 \(\{G_{n}\}\) 为 \(F(x)\) 在 \(\rm DFT\) 过程中求出的点值序列，\(\{F_{n}\}\) 是 \(F(x)\) 的系数序列，则根据定义有 ：&lt;/p&gt;
\[
G_k = \sum _{i = 0} ^{n - 1} \left(\omega_{n}^{k}\right) ^ i F_i \tag{2.3.1}
\]&lt;p&gt;此处有反演结论 ：&lt;/p&gt;
\[
nF_k = \sum_{i = 0} ^{n - 1} \left(\omega_{n}^{-k}\right) ^ i G_i \tag{2.3.2}
\]&lt;p&gt;\(\rm Proof :\)&lt;/p&gt;
\[
\begin{aligned}
nF_k &amp;= \sum_{i = 0} ^ {n - 1} \sum _{j = 0} ^ {n - 1} \left(\omega_{n} ^{-k}\right) ^ i \left(\omega_{n} ^{i}\right) ^ j F_j\\
&amp;= \sum_{i = 0} ^ {n - 1} \sum _{j = 0} ^ {n - 1} \omega_{n} ^{i(j - k)} F_j
\end{aligned}
\]&lt;p&gt;将式 \((2.1.4)\) 带入 \((2.3.3)\) 可得 ：&lt;/p&gt;
\[
\begin{aligned}
nF_k &amp;= \sum _{j = 0} ^ {n - 1} \sum_{i = 0} ^ {n - 1} \left(\omega_{n} ^{j - k}\right)^i F_j\\
&amp;= \sum_{j = 0} ^ {n - 1} n[j = k] F_j\\
&amp;= nF_k
\end{aligned}
\]&lt;p&gt;故利用式 \((2.3.2)\) 将 \(\{G_{n}\}\) 带入 \(\rm DFT\) 过程，以 \(\omega_{n}^{-1}\) 作为一次单位根得出的点值即为 \(F(x)\) 的系数序列。&lt;/p&gt;
&lt;p&gt;\(\rm IDFT\) 过程的时间复杂度为 \(\Theta(n\log n)\)。&lt;/p&gt;
&lt;p&gt;至此，我们已经推导出了一个时间复杂度为 \(\Theta(n\log n)\)，可以递归实现的 \(\rm FFT\) 算法，需要注意的是，由于递归时需要两边长度相等，所以 \(F(x)\) 的长度必须是 \(2\) 的幂，少了的部分通过在高次项以 \(0\) 作为系数来补齐。&lt;/p&gt;
&lt;h3 id="位逆序置换"&gt;位逆序置换&lt;/h3&gt;
&lt;p&gt;位逆序置换 \(\rm(Bit-Reversal\ Permutation)\) 是 \(\rm FFT\) 中一个较大的优化，在国内又称蝴蝶变换。&lt;/p&gt;
&lt;p&gt;它的优化主要在于将原本的递归实现变成了迭代实现。&lt;/p&gt;
&lt;p&gt;在递归实现中，我们每一次都会把整个多项式的奇数次项和偶数次项系数分开，一直分到只剩下一个系数。但是我们也可以先把这些系数在原数组中拆分，然后再倍增地去合并这些算出来的值。&lt;/p&gt;
&lt;p&gt;以 \(8\) 项多项式为例，模拟拆分的过程 :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;初始序列为 : \(\left\{x_{0}, x_{1}, x_{2}, x_{3}, x_{4}, x_{5}, x_{6}, x_{7}\right\}\)。&lt;/li&gt;
&lt;li&gt;一次二分之后 : \(\left\{x_{0}, x_{2}, x_{4}, x_{6}\right\},\left\{x_{1}, x_{3}, x_{5}, x_{7}\right\}\)。&lt;/li&gt;
&lt;li&gt;两次二分之后 : \(\left\{x_{0}, x_{4}\right\}, \left\{x_{2}, x_{6}\right\},\left\{x_{1}, x_{5}\right\},\left\{x_{3}, x_{7}\right\}\)。&lt;/li&gt;
&lt;li&gt;三次二分之后 : \(\left\{x_{0}\right\}, \left\{x_{4}\right\}, \left\{x_{2}\right\}, \left\{x_{6}\right\}, \left\{x_{1}\right\}, \left\{x_{5}\right\}, \left\{x_{3}\right\}, \left\{x_{7}\right\}\)。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;可以发现，只要把最后一层每个位置对应的坐标求出来，然后每次迭代时插空合并相邻两项即可。&lt;/p&gt;
&lt;p&gt;记 \(R(x)\) 表示 \(x\) 在全部分治完后去到的位置，观察发现 \(R(x)\) 是 \(x\) 在二进制意义下翻转后的值。&lt;/p&gt;
&lt;p&gt;首先有 \(R(0) = 0\)，剩下的考虑从小到大求解，显然有 ：&lt;/p&gt;
\[
R(x) = \left\lfloor\frac{R\left(\left\lfloor\frac{x}{2}\right\rfloor\right)}{2}\right\rfloor+(x \bmod 2) \times 2^{k - 1} \tag{2.4.1}
\]&lt;p&gt;求解 \(R(x)\) 并将每个数换到应该去的位置时间复杂度为 \(\Theta(n)\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;3e6&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;Pi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;acos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="nc"&gt;Complex&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Complex&lt;/span&gt; &lt;span class="k"&gt;operator&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Complex&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Complex&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Complex&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Complex&lt;/span&gt; &lt;span class="k"&gt;operator&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Complex&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Complex&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Complex&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Complex&lt;/span&gt; &lt;span class="k"&gt;operator&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Complex&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Complex&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Complex&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;FFT&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Complex&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;swap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Complex&lt;/span&gt; &lt;span class="n"&gt;eps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Complex&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="n"&gt;cos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Pi&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Pi&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Complex&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Complex&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;eps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Complex&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%lf&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%lf&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;FFT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;FFT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;FFT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="快速数论变换"&gt;快速数论变换&lt;/h2&gt;
&lt;p&gt;由于 \(\rm FFT\) 对单位根的依赖，所以该算法必须使用浮点数保存，进而引发精度问题。糟糕的是，数学家已经证明了在复数域内仅有单位根满足所需性质。&lt;/p&gt;
&lt;p&gt;值得庆幸的是，大多数计数问题是在模意义下完成的，于是我们希望为 \(\rm FFT\) 找一个模意义下的替代品，最终方案为快速数论变换 \(\rm(Number\ Theoretic\ Transform,NTT)\)。&lt;/p&gt;
&lt;h3 id="原根"&gt;原根&lt;/h3&gt;
&lt;p&gt;原根的定义如下 ：&lt;/p&gt;
&lt;p&gt;如果有 \(a^{n} \equiv 1 \pmod p\)，则称满足此条件最小的 \(n\) 为 \(a\) 在模 \(p\) 意义下的阶。若一个数 \(g\) 在模 \(p\) 意义下的原根为 \(\varphi(p)\)，那么称 \(g\) 为 \(p\) 的原根。&lt;/p&gt;
&lt;p&gt;我们尝试用原根代替单位根进行运算，所以需要先证明以下几条性质 ：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;不重性质：&lt;/strong&gt;&lt;/p&gt;
\[
\forall 0\leqslant i \lt j \lt \varphi (p),g^i \not \equiv g^j \pmod p \tag{3.1.1}
\]&lt;p&gt;\(\rm Proof :\) 若存在 \(0\leqslant i \lt j \lt \varphi (p)\) 满足 \(g^{i} \equiv g^{j} \pmod p\)，那么 \(0\leqslant j - i \lt \varphi (p)\) 且 \(g^{j - i} \equiv 1 \pmod p\)，与原根的定义矛盾，故原命题得证。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;折半性质：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;定义 \(g_{n}^{1} = g^{\frac{p - 1}{n}},g_{n}^{k} = (g_{n}^{1})^{k}\) 则 ：&lt;/p&gt;
\[
g_{2n}^{2k} \equiv g_n^k \pmod p \tag{3.1.2}
\]&lt;p&gt;\(\rm Proof :\) 由式 \((3.1.1)\) 可得 \(g_{n}^{0},g_{n}^{1},g_{n}^{2},\cdots,g_{n}^{n - 1}\) 互不相同。将 \(g_{n}^{k}\) 的定义带入易证式 \((3.1.2)\)。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;对称性质：&lt;/strong&gt;&lt;/p&gt;
\[
g_{2n}^{k + n} \equiv -g_{2n}^k \pmod p \tag{3.1.3}
\]&lt;p&gt;\(\rm Proof :\)&lt;/p&gt;
&lt;p&gt;参照式 \((2.1.3)\) 的证明方法，我们只需要证明 \(g_{2n}^{n} \equiv -1 \pmod p\) 即可。&lt;/p&gt;
\[
(g_{2n}^n) ^ 2 \equiv (g^{\frac{p - 1}{2}}) ^ 2 \equiv g^{p - 1} \equiv 1 \pmod p \tag{3.1.4}
\]&lt;p&gt;所以 \(g_{2n}^{n} \equiv 1\ or-1 \pmod p\)。&lt;/p&gt;
&lt;p&gt;根据式 \((3.1.1)\)，我们知道 \(g_{2n}^{n} \not \equiv g^{p - 1} \pmod p\)，又因为 \(g^{p - 1} \equiv 1 \pmod p\)，故 \(g_{2n}^{n} \equiv -1 \pmod p\)。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;求和性质：&lt;/strong&gt;&lt;/p&gt;
\[
\sum _{i = 0} ^{n - 1} \left(g_{n} ^k\right) ^i \equiv n[k = 0] \pmod p \tag{3.1.5}
\]&lt;p&gt;\(\rm Proof :\) 参照式 \((2.1.4)\) 的证明。&lt;/p&gt;
&lt;p&gt;有了以上 \(4\) 条性质，我们就可以直接将原根带入 \(\rm DFT\) 运算了。&lt;/p&gt;
&lt;p&gt;另外，由于 \(\rm DFT\) 运算中的多项式长度 \(n\) 均为 \(2\) 的幂，并且我们取的模数 \(p\) 需要满足 \(p - 1\) 能整除足够大的 \(n\)，所以 \(p - 1\) 要包含一个较大的因子是 \(2\) 的幂。&lt;/p&gt;
&lt;p&gt;比较常用的 \(\rm NTT\) 模数是 \(998244353 = 119 \times 2^{23} + 1\)，它的最小原根是 \(3\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;3e6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;998244353&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Pow&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;NTT&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;swap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;eps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;332748118&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;eps&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%lld &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="chirp-z-变换"&gt;Chirp Z 变换&lt;/h3&gt;
&lt;p&gt;\(\rm Chirp\ Z-Transform\) 又称 \(\rm Bluestein\) 算法，与 \(\rm DFT\) 类似，它被用于在 \(\Theta[(n + m) \log n]\) 的时间复杂度内求解如下问题 ：&lt;/p&gt;
&lt;p&gt;给定 \(n\) 次多项式 \(F(x)\)，求出 \(F(1),F(c),F(c^{2}),\cdots,F(c^{m})\)，\(c \in \mathbb{C}\)。&lt;/p&gt;
&lt;p&gt;考虑组合恒等式 ：&lt;/p&gt;
\[
ik = \dbinom{i + k}{2} - \dbinom{i}{2} - \dbinom{k}{2} \tag{3.2.1}
\]&lt;p&gt;\(\rm Proof :\)&lt;/p&gt;
\[
\begin{aligned}
ik &amp;= \frac{2ik}{2}\\
&amp;= \frac{(i ^ 2 + 2ik + k ^ 2 - i - k) - (i ^ 2 - i) - (k ^ 2 - k)}{2}\\
&amp;= \dbinom{i + k}{2} - \dbinom{i}{2} - \dbinom{k}{2}
\end{aligned}
\]&lt;p&gt;于是有 ：&lt;/p&gt;
\[
\begin{aligned}
F(c ^ k) &amp;= \sum _{i = 0} ^ {n - 1} a_i c ^ {ik}\\
&amp;= \sum _{i = 0} ^ {n - 1} a_i c ^ {\binom{i + k}{2} - \binom{i}{2} - \binom{k}{2}}\\
&amp;= c ^ {-\binom{k}{2}} \sum _{i = 0} ^{n - 1} \left[a_i c ^ {-\binom{i}{2}} \right] \left[c ^ {\binom{i + k}{2}} \right]
\end{aligned}
\]&lt;p&gt;设 \(f(x) = c^{\binom{x}{2}}, g(x) = a_{xc}^{-\binom{x}{2}}\)，则有 ：&lt;/p&gt;
\[
\frac{F(c ^ k)}{c ^ {-\binom{k}{2}}} = \sum _ {i - j = k} f(i) \times g(j) \tag{3.2.4}
\]&lt;p&gt;可以使用减法卷积来计算，时间复杂度 \(\Theta[(n + m) \log n]\)。&lt;/p&gt;
&lt;p&gt;具体来说，计算减法卷积时一般将 \(g(x)\) 翻转，即 \(g'(i) = g(m - i)\)，于是有 ：&lt;/p&gt;
\[
\begin{aligned}
\frac{F(c ^ k)}{c ^ {-\binom{k}{2}}} &amp;= \sum _ {i - j = k} f(i) \times g(j)\\
&amp;= \sum _ {i + j = m + k} f(i) \times g'(j)
\end{aligned}
\]&lt;p&gt;计算式 \((3.2.5)\) 时可以先对 \(f(x)\) 和 \(g(x)\) 求和卷积，称得到的多项式为 \(F(x)\)。&lt;/p&gt;
&lt;p&gt;假设 \(f(x)\) 的次数为 \(n\)，\(g(x)\) 的次数为 \(m\)，那么 \(F(x)\) 有 \(n + m + 1\) 项。可以发现，现在 \(F(x)\) 的第 \(k\) 个位置实际上为答案的第 \(m + k\) 项，所以要将多项式向左平移 \(m\) 位，即 \(F'(k) = F(k + m)\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;3e6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;998244353&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Pow&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;NTT&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;swap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;332748118&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;E&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d%d%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;inv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;reverse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="分治多项式乘法"&gt;分治多项式乘法&lt;/h3&gt;
&lt;p&gt;有些时候我们知道 \(G(x)\) 的所有项，需要计算 \(F(x)\)，并且它们满足关系 ：&lt;/p&gt;
\[
F_k = \sum _{i = 0} ^ {k - 1} F_iG_{k - i} \tag{3.3.1}
\]&lt;p&gt;这时候可以考虑采用 \(\rm CDQ\) 分治的思想，先递归计算左边半部分，再计算左边对右边的贡献。可以发现贡献是卷积的形式，于是可以用 \(\rm FFT/NTT\) 以 \(\Theta(n \log n)\) 的时间复杂度计算。&lt;/p&gt;
&lt;p&gt;分治多项式乘法的时间复杂度为 \(T(n) = 2T(\frac{n}{2}) + \Theta(n \log n) = \Theta(n \log^{2} n)\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;3e5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;998244353&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;Ft&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;Gt&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Pow&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;NTT&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;swap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;eps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;332748118&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;eps&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;cdq&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cdq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Ft&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Ft&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Gt&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Ft&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Gt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Ft&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Ft&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Gt&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Ft&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Ft&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cdq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cdq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="快速沃尔什变换"&gt;快速沃尔什变换&lt;/h2&gt;
&lt;p&gt;快速沃尔什变换 \(\rm(Fast\ Walsh-Hadamard\ Transform,FWT)\) 被用来在 \(\Theta(n\log n)\) 的时间复杂度下求两个多项式的位运算卷积。&lt;/p&gt;
&lt;p&gt;若称 \(h(x) = f(x) \oplus g(x)\)，其中 \(\oplus\) 是 \(\rm or,and\) 或 \(\rm xor\)，则应满足关系式 ：&lt;/p&gt;
\[
h(k) = \sum _{i \oplus j = k} f(i) \times g(j) \tag{4.0.1}
\]&lt;h3 id="构造-fwt-函数"&gt;构造 FWT 函数&lt;/h3&gt;
&lt;p&gt;在 \(\rm FFT\) 中，我们通过将多项式转换成点值表示并进行点积的方法避开了卷积，于是我们自然也希望将位运算卷积通过某种方式转换成点积运算。&lt;/p&gt;
&lt;p&gt;设 \(F' = FWT(F)\) 表示幂级数 \(F\) 经过 \(\rm FWT\) 变换后得到的幂级数。&lt;/p&gt;
&lt;p&gt;容易发现，我们构造的 \(\rm FWT\) 变换需要满足 ：&lt;/p&gt;
\[
A \times B = C \iff FWT(A) \cdot FWT(B) = FWT(C) \tag{4.1.1}
\]&lt;p&gt;由于 \(\rm DFT\) 是线性变换，我们自然希望 \(\rm FWT\) 也是线性变换。&lt;/p&gt;
&lt;p&gt;因此，考虑设 \(k_{i, j}\) 表示 \(F_{j}\) 对 \(F'_{i}\) 的贡献系数，故有 ：&lt;/p&gt;
\[
F'_i = \sum _{j = 0} ^ {n - 1} k_{i, j} F_j \tag{4.1.2}
\]&lt;p&gt;根据 \(FWT(A) \cdot FWT(B) = FWT(C)\) 可以得到 ：&lt;/p&gt;
\[
A'_i \times B'_i = C'_i \tag{4.1.3}
\]\[
\left(\sum _{j = 0} ^ {n - 1} k_{i, j} A_j\right)\left(\sum _{p = 0} ^ {n - 1} k_{i, p} B_p\right) = \sum_{j = 0} ^ {n - 1} k_{i, j} C_j \tag{4.1.4}
\]\[
\sum _{j = 0} ^ {n - 1}\sum _{p = 0} ^ {n - 1} k_{i, j} k_{i, p} A_j B_p = \sum_{j = 0} ^ {n - 1} k_{i, j} C_j \tag{4.1.5}
\]&lt;p&gt;根据 \(A \times B = C\) 可以得到 ：&lt;/p&gt;
\[
C_p = \sum _{i \oplus j = p} A_i\times B_j \tag{4.1.6}
\]\[
\sum_{p = 0} ^ {n - 1} k_{i, p} C_p = \sum_{p = 0} ^ {n - 1} k_{i, p}\sum _{t \oplus j = p} A_t B_j \tag{4.1.7}
\]\[
\begin{aligned}
\sum _{j = 0} ^ {n - 1}\sum _{p = 0} ^ {n - 1} k_{i, j} k_{i, p} A_j B_p &amp;= \sum_{p = 0} ^ {n - 1} k_{i, p}\sum _{t \oplus j = p} A_t B_j \\
&amp;= \sum _{p = 0} ^{n - 1} \sum _{t \oplus j = p} k_{i, t \oplus j} A_t B_j\\
&amp;= \sum _{t = 0} ^ {n - 1} \sum_{j = 0} ^ {n - 1} k_{i, t \oplus j} A_t B_j
\end{aligned}
\]&lt;p&gt;对比式 \((4.1.8)\) 中两边系数可以发现只需要满足 ：&lt;/p&gt;
\[
k_{i, j}k_{i, p} = k_{i, j \oplus p} \tag{4.1.9}
\]&lt;p&gt;假设我们已经求出了 \(k_{0, 0},k_{0,1},k_{1,0},k_{1,1}\)，那么可以构造 \(k_{i, j} = \prod_{t} k_{i_{t},j_{t}}\)，其中 \(a_{t}\) 表示 \(a\) 在二进制下的第 \(t\) 位。这种构造方式导出的变换系数 \(k\) 推导 \(k_{i, j}k_{i, p} = k_{i, j \oplus p}\) 的充分性容易证明。&lt;/p&gt;
&lt;h3 id="求解-fwt-变换"&gt;求解 FWT 变换&lt;/h3&gt;
&lt;p&gt;现在我们需要快速求解下式 ：&lt;/p&gt;
\[
F'_i = \sum _{j = 0} ^{n - 1} k_{i, j} F_j \tag{4.2.1}
\]&lt;p&gt;我们考虑按位折半计算，下面设 \(\hat{x}\) 表示 \(x\) 去除二进制首位以后的值。&lt;/p&gt;
\[
\begin{aligned}
F'_i &amp;= \sum _{j = 0} ^{n / 2 - 1} k_{i, j} F_j + \sum _{j = n / 2} ^{n - 1} k_{i, j} F_j \\
&amp;= \sum _{j = 0} ^{n / 2 - 1} k_{i_0, j_0}k_{\hat{i}, \hat{j}} F_j + \sum _{j = n / 2} ^{n - 1} k_{i_0, j_0}k_{\hat{i}, \hat{j}} F_j \\
&amp;= k_{i_0, 0}\sum _{j = 0} ^{n / 2 - 1} k_{\hat{i}, \hat{j}} F_j + k_{i_0, 1}\sum _{j = n / 2} ^{n - 1} k_{\hat{i}, \hat{j}} F_j
\end{aligned}
\]&lt;p&gt;设 \(F^{0}\) 表示幂级数 \(F'\) 下标的二进制首位为 \(0\) 的部分，相似地定义 \(F^{1}\)。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;若 \(i_{0} = 0\)，则有 \(F'_{i} = k_{0, 0} F^{0}_{i} + k_{0, 1} F^{1}_{i}\)。&lt;/li&gt;
&lt;li&gt;若 \(i_{0} = 1\)，则有 \(F'_{i + n/2} = k_{1, 0} F^{0}_{i} + k_{1, 1} F^{1}_{i}\)。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;在该算法中，每次迭代会将长度减半，合并一层的时间复杂度为 \(\Theta(n)\)，所以总时间复杂度为 \(\Theta(n\log n)\)。&lt;/p&gt;
&lt;p&gt;此外，逆变换 \(\rm(IFWT)\) 时对变换矩阵 \(k\) 求个逆即可。&lt;/p&gt;
&lt;h3 id="构造位矩阵"&gt;构造位矩阵&lt;/h3&gt;
&lt;p&gt;针对不同的位运算，我们需要构造不同的位矩阵 \(k\) 以拟合 \(\rm FWT\) 变换。&lt;/p&gt;
&lt;h4 id="或卷积"&gt;或卷积&lt;/h4&gt;
&lt;p&gt;首先我们知道 ：&lt;/p&gt;
\[
k_{p, i}\times k_{p, j} = k_{p, i | j} \tag{4.3.1}
\]&lt;p&gt;首先可以观察到 \(k_{p, i} \times k_{p, i} = k_{p, i}\)，故 \(k_{p, i} \in \{0, 1\}\)。&lt;/p&gt;
&lt;p&gt;然后可以发现 \(k_{p, 0} \times k_{p, 1} = k_{p, 1}\)，所以 \(k_{p, 0} = 1\)。 又因为矩阵如果一列都是 \(1\)，那么它没有逆，故 \(k\) 仅可能为以下两种之一 ：&lt;/p&gt;
\[
\begin{bmatrix} 1&amp;0\\ 1&amp;1 \end{bmatrix}~or~\begin{bmatrix} 1&amp;1\\ 1&amp;0 \end{bmatrix} \tag{4.3.2}
\]&lt;p&gt;由于右边那种等价于高维前缀和，所以我选择右边那种（事实上两种都可以）。&lt;/p&gt;
\[
\begin{aligned}
F'_i &amp;= F^0_i\\
F'_{i + n/2} &amp;= F^0_i + F^1_i
\end{aligned}
\]&lt;p&gt;对于逆变换，将矩阵求个逆就可以得到 \(k^{-1} = \begin{bmatrix} 1&amp;0\\ -1&amp;1 \end{bmatrix}\)。&lt;/p&gt;
\[
\begin{aligned}
IF_i &amp;= IF^{0}_i\\
IF_{i + n/2} &amp;= -IF^0_i + IF^1_i
\end{aligned}
\]&lt;h4 id="与卷积"&gt;与卷积&lt;/h4&gt;
&lt;p&gt;可以发现与卷积同或卷积几乎完全一样，此处不赘述，仅给出其位矩阵和逆位矩阵 ：&lt;/p&gt;
\[
k = \begin{bmatrix} 1&amp;1\\ 0&amp;1 \end{bmatrix},k^{-1} = \begin{bmatrix} 1&amp;-1\\ 0&amp;1 \end{bmatrix} \tag{4.3.5}
\]&lt;h4 id="异或卷积"&gt;异或卷积&lt;/h4&gt;
&lt;p&gt;首先我们知道 ：&lt;/p&gt;
\[
k_{p, i}\times k_{p, j} = k_{p, i~xor~j} \tag{4.3.6}
\]&lt;p&gt;因为 \(k_{0, 0} \times k_{x, y} = k_{x, y}\)，所以 \(k_{0, 0} = 1\)。&lt;/p&gt;
&lt;p&gt;因为 \(k_{1, 1} \times k_{1, 1} = k_{1, 0}\)，此时若 \(k_{1, 1} = k_{1, 0} = 0\)，则有一行为 \(0\)，矩阵无逆，故 \(k_{1, 1},k_{1, 0} \not= 0\)。&lt;/p&gt;
&lt;p&gt;因为 \(k_{1, 0} \times k_{1, 1} = k_{1, 1}\)，又因为 \(k_{1, 1} \not = 0\)，所以 \(k_{1, 0} = 1\)。&lt;/p&gt;
&lt;p&gt;因为 \(k_{1, 1} \times k_{1, 1} = k_{1, 0} = 1\)，所以 \(k_{1, 1} \in \{1, -1\}\)。&lt;/p&gt;
&lt;p&gt;因为 \(k_{0,1} \times k_{0, 1} = k_{0, 0} = 1\)，所以 \(k_{0, 1} \in \{1, -1\}\)。&lt;/p&gt;
&lt;p&gt;因为 \(k_{0, 1}\) 和 \(k_{1, 1}\) 不能相等，否则行列式为 \(0\)，矩阵无逆，所以 \(k\) 仅可能为以下两种之一 ：&lt;/p&gt;
\[
\begin{bmatrix} 1&amp;1\\ -1&amp;1 \end{bmatrix}~or~\begin{bmatrix} 1&amp;1\\ 1&amp;-1 \end{bmatrix} \tag{4.3.7}
\]&lt;p&gt;我们采用第二种，可推知 ：&lt;/p&gt;
\[
\begin{aligned}
F'_i &amp;= F^0_i + F^1_i\\
F'_{i + n/2} &amp;= F^0_i - F^1_i
\end{aligned}
\]&lt;p&gt;对 \(k\) 求逆可以得到 \(k^{-1} = \begin{bmatrix} \frac{1}{2}&amp;\frac{1}{2}\\ \frac{1}{2}&amp;-\frac{1}{2} \end{bmatrix}\)。&lt;/p&gt;
\[
\begin{aligned}
IF_i &amp;= \frac{IF^0_i + IF^1_i}{2}\\
IF_{i + n/2} &amp;= \frac{IF^0_i - IF^1_i}{2}
\end{aligned}
\]&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;2e5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;998244353&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;499122177&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;OR&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;AND&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;tmp1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nl"&gt;tmp2&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;XOR&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;2ll&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;2ll&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;OR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;OR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;OR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt; &lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;AND&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;AND&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;AND&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt; &lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;XOR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;XOR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;XOR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt; &lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="多项式基本操作"&gt;多项式基本操作&lt;/h2&gt;
&lt;p&gt;多项式之间除了乘法，还可以做一些其它的基本操作，但它们都是基于多项式乘法的。&lt;/p&gt;
&lt;h3 id="多项式求逆"&gt;多项式求逆&lt;/h3&gt;
&lt;p&gt;若两个多项式 \(F(x)\) 和 \(G(x)\) 满足 \(F(x)G(x) = 1\)，则称它们互为逆元，记作 \(G(x) = F^{-1}(x)\)。&lt;/p&gt;
&lt;p&gt;求解多项式乘法逆元的时候考虑使用倍增的思想，不断扩大倍增上界。&lt;/p&gt;
&lt;p&gt;当多项式的界为 \(\bmod\ x\) 时，直接对多项式的常数项求逆元即可。&lt;/p&gt;
&lt;p&gt;设 \(G(x) = F^{-1}(x) \pmod {x^{n}}\)，如果我们已经求出了 \(G'(x) = F^{-1}(x) \pmod {x^{n/2}}\)，那么 ：&lt;/p&gt;
\[
G(x) - G'(x) \equiv 0 \pmod {x^{n/2}} \tag{5.1.1}
\]&lt;p&gt;为了能配出 \(x^{n}\) 作为模数，考虑将式子两边同时平方，得到 ：&lt;/p&gt;
\[
G^2(x) - 2G(x)G'(x) + G'^2(x) \equiv 0 \pmod {x ^ n} \tag{5.1.2}
\]&lt;p&gt;因为 \(F(x)G(x) = 1\)，所以式子两边同时乘 \(F(x)\) 并整理可得 ：&lt;/p&gt;
\[
G(x) = 2G'(x) - G'^2(x)F(x) \pmod {x ^ n} \tag{5.1.3}
\]&lt;p&gt;根据式 \((5.1.3)\) 可以倍增求出 \(F^{-1}(x)\)，时间复杂度为 \(T(n) = T(\frac{n}{2}) + \Theta(n \log n) = \Theta(n\log n)\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;3e5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;998244353&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Pow&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;NTT&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;swap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;eps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;332748118&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;eps&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;INV&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;INV&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="多项式开方"&gt;多项式开方&lt;/h3&gt;
&lt;p&gt;若两个多项式 \(F(x)\) 和 \(G(x)\) 满足 \(G^{2}(x) = F(x)\)，则称 \(F(x)\) 开根后为 \(G(x)\)，记作 \(G(x) = F^{\frac{1}{2}}(x)\)。&lt;/p&gt;
&lt;p&gt;与多项式求逆一样，多项式开根也利用了倍增法。&lt;/p&gt;
&lt;p&gt;当多项式的界为 \(\bmod\ x\) 时，直接对常数项使用二次剩余即可。&lt;/p&gt;
&lt;p&gt;设 \(G(x) = F^{\frac{1}{2}}(x) \pmod {x^{n}}\)，如果我们已经求出了 \(G'(x) = F^{\frac{1}{2}}(x) \pmod {x^{n / 2}}\)，那么 ：&lt;/p&gt;
\[
G'^2 (x) - F(x) \equiv 0 \pmod {x ^ {n / 2}} \tag{5.2.1}
\]&lt;p&gt;对式 \((5.2.1)\) 两边同时平方并作简单变换，得到 ：&lt;/p&gt;
\[
\left[G'^2(x) + F(x)\right] ^ 2 \equiv 4G'^2(x)F(x) \pmod {x ^ n} \tag{5.2.2}
\]&lt;p&gt;对式子两边同时除以 \(4G'^{2}(x)\)，可以得到 ：&lt;/p&gt;
\[
\left[\frac{G'^2(x) + F(x)}{2G'(x)}\right] ^ 2 \equiv F(x) \pmod {x ^ n} \tag{5.2.3}
\]&lt;p&gt;结合 \(G(x)\) 的定义，可以发现 ：&lt;/p&gt;
\[
G(x) = \frac{1}{2}G'(x) + \frac{1}{2}G'^{-1}(x)F(x) \pmod {x ^ n} \tag{5.2.4}
\]&lt;p&gt;根据式 \((5.2.4)\) 可以倍增求出 \(F^{\frac{1}{2}}(x)\)，时间复杂度为 \(T(n) = T(\frac{n}{2}) + \Theta(n \log n) = \Theta(n\log n)\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;3e5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;998244353&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;iG&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;GS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;FS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Pow&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;NTT&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;swap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;eps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;332748118&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;eps&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;INV&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;iG&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;SQR&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;FS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;GS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;GS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;FS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;INV&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;GS&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;GS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;FS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;iG&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;499122177ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;GS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;FS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;iG&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;GS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;GS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;GS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;SQR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="多项式带余除法"&gt;多项式带余除法&lt;/h3&gt;
&lt;p&gt;给定多项式 \(F(x)\) 和 \(G(x)\)，若满足关系式 \(Q(x)G(x) + R(x) = F(x)\)，则称 \(Q(x)\) 和 \(R(x)\) 分别是 \(F(x)\) 除以 \(G(x)\) 的商和余数。&lt;/p&gt;
&lt;p&gt;可以发现如果能消除 \(R(x)\) 的影响则可以直接使用多项式求逆。&lt;/p&gt;
&lt;p&gt;考虑构造变换 ：&lt;/p&gt;
\[
F' = x ^ {\deg F} F\left(\frac{1}{x}\right) \tag{5.3.1}
\]&lt;p&gt;可以发现，其本质就是翻转多项式系数。&lt;/p&gt;
&lt;p&gt;设 \(n = \deg F,m = \deg G\)，将多项式带余除法定义式中的 \(x\) 替换成 \(\frac{1}{x}\)，并将两边同时乘 \(x^{n}\) 可得 ：&lt;/p&gt;
\[
x ^ n F\left(\frac{1}{x}\right) = x ^ {n - m} Q\left(\frac{1}{x}\right) x ^ m G\left(\frac{1}{x}\right) + x ^ {n - m + 1} x ^ {m - 1} R\left(\frac{1}{x}\right) \tag{5.3.2}
\]&lt;p&gt;将式 \((5.3.1)\) 带入可得 ：&lt;/p&gt;
\[
F'(x) = Q'(x) G'(x) + x ^ {n - m + 1} R'(x) \tag{5.3.3}
\]&lt;p&gt;注意到式 \((5.3.3)\) 中 \(R'(x)\) 带了一个 \(x^{n - m + 1}\) 作为系数，于是将上式放在 \(\bmod\ x^{n - m + 1}\) 意义下计算即可将这一项消去。又因为 \(\deg Q' = n - m \lt n - m + 1\)，故 \(Q'(x)\) 的计算不会受到影响。&lt;/p&gt;
&lt;p&gt;综上，有 ：&lt;/p&gt;
\[
F'(x) = Q'(x)G'(x) \pmod {x ^ {n - m + 1}} \tag{5.3.4}
\]&lt;p&gt;使用多项式求逆即可计算 \(Q(x)\)，将其带入定义式可以得到 \(R(x)\)。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n \log n)\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;3e5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;998244353&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;FR&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;GR&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Pow&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;NTT&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;swap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;eps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;332748118&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;eps&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;INV&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;DIV&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;FR&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GR&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GR&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;INV&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;GR&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;FR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;GR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;FR&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;FR&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;GR&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;FR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;FR&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt; &lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;DIV&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="多项式指对函数"&gt;多项式指对函数&lt;/h3&gt;
&lt;p&gt;两者均由麦克劳林级数定义 ：&lt;/p&gt;
\[
\begin{aligned}
\ln F(x) &amp;= -\sum_{i \geqslant 1} \frac{[1 - F(x)] ^ i}{i}\\
\exp F(x) &amp;= \sum _{i \geqslant 0} \frac{F^i(x)}{i!}
\end{aligned}
\]&lt;p&gt;之所以用麦克劳林级数这么复杂的方式，是因为这样就可以只用加法和乘法定义多项式指对函数了。&lt;/p&gt;
&lt;p&gt;众所周知有多项式的求导 ：&lt;/p&gt;
\[
F'(x) = \sum _{i \geqslant 1} iF_i\cdot x ^ {i - 1} \tag{5.4.2}
\]&lt;p&gt;还有多项式的积分 ：&lt;/p&gt;
\[
F(x) = C + \sum _{i \geqslant 0} \frac{F'_i}{i} \cdot x ^ {i + 1} \tag{5.4.3}
\]&lt;h4 id="多项式对数函数"&gt;多项式对数函数&lt;/h4&gt;
&lt;p&gt;首先，对于多项式 \(F(x)\)，若 \(\ln F(x)\) 存在，则按照其定义，必须满足 ：&lt;/p&gt;
\[
[x ^ 0]F(x) = 1 \tag{5.4.4}
\]&lt;p&gt;先对 \(\ln F(x)\) 求导 ：&lt;/p&gt;
\[
\frac{\mathrm{d}\ln F(x)}{\mathrm{d} x} \equiv \frac{F'(x)}{F(x)} \pmod {x ^ n} \tag{5.4.5}
\]&lt;p&gt;再对其积分 ：&lt;/p&gt;
\[
\ln F(x) \equiv \int \mathrm{d}\ln F(x) \equiv \int \frac{F'(x)}{F(x)}\mathrm{d} x \pmod {x ^ n} \tag{5.4.6}
\]&lt;p&gt;多项式的求导和积分时间复杂度均为 \(\Theta(n)\)，多项式求逆和乘法的时间复杂度为 \(\Theta(n \log n)\)，所以求解多项式对数函数的时间复杂度为 \(\Theta(n \log n)\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;4e5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;998244353&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;iF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Pow&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;NTT&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;swap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;eps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;332748118&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;eps&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;INV&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;iF&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;iF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;iF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;LN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;INV&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;iF&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;iF&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;iF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;LN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34; &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="多项式指数函数"&gt;多项式指数函数&lt;/h4&gt;
&lt;p&gt;首先，对于多项式 \(F(x)\)，若 \(\exp F(x)\) 存在，则按照其定义，必须满足 ：&lt;/p&gt;
\[
[x ^ 0] F(x) = 1 \tag{5.4.7}
\]&lt;p&gt;否则 \(\exp F(x)\) 的常数项不收敛。&lt;/p&gt;
&lt;p&gt;对 \(\exp F(x)\) 求导可得 ：&lt;/p&gt;
\[
\frac{\mathrm{d} \exp F(x)}{\mathrm{d}x} \equiv F'(x) \exp F(x) \pmod {x ^ n} \tag{5.4.8}
\]&lt;p&gt;若记 \(\exp F(x)\) 为 \(G(x)\)，则可以得到 ：&lt;/p&gt;
\[
G'(x) \equiv F'(x)G(x) \pmod {x ^ n} \tag{5.4.9}
\]&lt;p&gt;用系数关系表示为 ：&lt;/p&gt;
\[
G'_n = \sum _{i = 0} ^ n F'_i G_{n - i} \tag{5.4.10}
\]&lt;p&gt;将导函数积回来，可以得到 ：&lt;/p&gt;
\[
G_{n + 1} = \frac{1}{n + 1}\sum _{i = 0} ^ n (i + 1)F_{i + 1}G_{n - i} \tag{5.4.11}
\]&lt;p&gt;上式的递推可以用分治多项式乘法优化至 \(\Theta(n \log^{2} n)\)。&lt;/p&gt;
&lt;h3 id="多项式牛顿迭代"&gt;多项式牛顿迭代&lt;/h3&gt;
&lt;p&gt;定义多项式的复合 ：&lt;/p&gt;
\[
F \circ G (x) = \sum _{i\geqslant 0} F_i G^i(x) \tag{5.5.1}
\]&lt;p&gt;已知函数 \(G(x)\)，求多项式 \(F(x) \pmod {x^{n}}\)，满足 \(G \circ F(x) = 0\)。&lt;/p&gt;
&lt;p&gt;首先当多项式的界为 \(\bmod\ x\) 时，可以手算出 \(F(x) \pmod x\)。&lt;/p&gt;
&lt;p&gt;假设现在已经求得 \(\bmod\ x^{n / 2}\) 意义下的解 \(F_{0}(x)\)，要进一步求出 \(\bmod\ x^{n}\) 意义下的解 \(F(x)\)。&lt;/p&gt;
&lt;p&gt;众所周知有泰勒公式 ：&lt;/p&gt;
\[
f(x) = \sum _{i = 0} ^ {\infty} \frac{f^{(i)}(x_0)}{i!}(x - x_0) ^ i \tag{5.5.2}
\]&lt;p&gt;将 \(G[F(x)]\) 在 \(F_{0}(x)\) 处进行泰勒展开，有 ：&lt;/p&gt;
\[
\sum _{i = 0} ^ {\infty} \frac{G^{(i)}[F_0(x)]}{i!}[F(x) - F_0(x)] ^ i \equiv 0 \pmod {x ^ n} \tag{5.5.3}
\]&lt;p&gt;由于当 \(i\) 取大于 \(1\) 的值时 \([F(x) - F_{0}(x)]^{i}\) 的最低次项都会超过 \(x^{n}\)，所以 ：&lt;/p&gt;
\[
G[F_0(x)] + G'[F_0(x)][F(x) - F_0(x)] \equiv 0 \pmod {x ^ n} \tag{5.5.4}
\]&lt;p&gt;化简得到牛顿迭代的经典公式 ：&lt;/p&gt;
\[
F(x) = F_0(x) - \frac{G[F_0(x)]}{G'[F_0(x)]} \pmod {x ^ n} \tag{5.5.5}
\]&lt;p&gt;使用多项式牛顿迭代也可以解决一些其它的多项式基本操作。&lt;/p&gt;
&lt;h4 id="多项式求逆-1"&gt;多项式求逆&lt;/h4&gt;
&lt;p&gt;设需要求逆的函数为 \(H(x)\)，\(F(x) = H^{-1}(x)\)，有方程 ：&lt;/p&gt;
\[
G \circ F(x) \equiv \frac{1}{F(x)} - H(x) \equiv 0 \pmod {x ^ n} \tag{5.5.6}
\]&lt;p&gt;运用式 \((5.5.5)\) 可得 ：&lt;/p&gt;
\[
F(x) \equiv F_0(x) - \frac{\frac{1}{F_0(x)} - H(x)}{-\frac{1}{F_0^{2}(x)}} \equiv 2F_0(x) - F_0^2(x)H(x) \pmod {x ^ n} \tag{5.5.7}
\]&lt;p&gt;时间复杂度 \(T(n) = T\left(\frac{n}{2}\right) + \Theta(n \log n) = \Theta(n \log n)\)。&lt;/p&gt;
&lt;h4 id="多项式开方-1"&gt;多项式开方&lt;/h4&gt;
&lt;p&gt;设需要开方的函数为 \(H(x)\)，\(F(x) = H^{\frac{1}{2}}(x)\)，有方程 ：&lt;/p&gt;
\[
G \circ F(x) \equiv F^2(x) - H(x) \equiv 0 \pmod {x ^ n} \tag{5.5.8}
\]&lt;p&gt;运用式 \((5.5.5)\) 可得 ：&lt;/p&gt;
\[
F(x) \equiv F_0(x) - \frac{F_0^2(x) - H(x)}{2F_0(x)} \equiv 2F_0^{-1}(x)[F_0^2(x) + H(x)] \pmod {x ^ n} \tag{5.5.9}
\]&lt;p&gt;时间复杂度 \(T(n) = T\left(\frac{n}{2}\right) + \Theta(n \log n) = \Theta(n \log n)\)。&lt;/p&gt;
&lt;h4 id="多项式指数函数-1"&gt;多项式指数函数&lt;/h4&gt;
&lt;p&gt;设需要求 \(\exp\) 的函数为 \(H(x)\)，\(F(x) = \exp H(x)\)，有方程 ：&lt;/p&gt;
\[
G \circ F(x) \equiv \ln F(x) - H(x) \equiv 0 \pmod {x ^ n} \tag{5.5.10}
\]&lt;p&gt;运用式 \((5.5.5)\) 可得 ：&lt;/p&gt;
\[
F(x) \equiv F_0(x) - \frac{\ln F_0(x) - H(x)}{\frac{1}{F_0(x)}} \equiv F_0(x)[1 - \ln F_0(x) + H(x)] \pmod {x ^ n} \tag{5.5.11}
\]&lt;p&gt;时间复杂度 \(T(n) = T\left(\frac{n}{2}\right) + \Theta(n \log n) = \Theta(n \log n)\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define rep(i, l, r) for (int i = l; i &amp;lt;= r; i++)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define dep(i, r, l) for (int i = r; i &amp;gt;= l; i--)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;3e5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;998244353&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;iF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;FE&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;GE&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Pow&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;NTT&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;swap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;eps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;332748118&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;eps&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nl"&gt;mod&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tmp1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;INV&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;FI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;iF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;GI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;LN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;INV&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;iF&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;iF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;EXP&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="n"&gt;FE&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;GE&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;GE&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;exp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;FE&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;GE&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;LN&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;GE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;FE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GE&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;GE&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;lnF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;FE&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;NTT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;GE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GE&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;GE&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Inv&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;GE&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;read&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getchar&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;0&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;9&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getchar&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;0&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;9&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10ll&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getchar&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;EXP&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%d &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="多项式三角函数"&gt;多项式三角函数&lt;/h3&gt;
&lt;h4 id="三角函数"&gt;三角函数&lt;/h4&gt;
&lt;p&gt;给定多项式 \(F(x)\)，求模 \(x^{n}\) 意义下的 \(\sin F(x), \cos F(x)\) 与 \(\tan F(x)\)。&lt;/p&gt;
&lt;p&gt;首先由欧拉公式 \(\left(e^{i x}=\cos x+i \sin x\right)\) 可以得到三角函数的另一个表达式 ：&lt;/p&gt;
\[
\begin{aligned}
&amp;\sin x=\frac{e^{i x}-e^{-i x}}{2 i} \\
&amp;\cos x=\frac{e^{i x}+e^{-i x}}{2}
\end{aligned}
\]&lt;p&gt;那么代入 \(F(x)\) 就有 :&lt;/p&gt;
\[
\begin{aligned}
\sin F(x) &amp;=\frac{\exp [iF(x)] - \exp [-iF(x)]}{2i} \\
\cos F(x) &amp;=\frac{\exp [iF(x)] + \exp [-iF(x)]}{2}
\end{aligned}
\]&lt;p&gt;直接按上述表达式编写程序即可得到模 \(x^{n}\) 意义下的 \(\sin F(x)\) 与 \(\cos F(x)\)。&lt;/p&gt;
&lt;p&gt;再由 \(\tan F(x)=\frac{\sin F(x)}{\cos F(x)}\) 可求得 \(\tan F(x)\)。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n \log n)\)。&lt;/p&gt;
&lt;h4 id="反三角函数"&gt;反三角函数&lt;/h4&gt;
&lt;p&gt;仿照求多项式对数函数的方法，对反三角函数求导再积分可得 ：&lt;/p&gt;
\[
\begin{aligned}
\frac{\mathrm{d}}{\mathrm{d} x} \arcsin x &amp;=\frac{1}{\sqrt{1-x^{2}}} \\
\arcsin x &amp;=\int \frac{1}{\sqrt{1-x^{2}}} \mathrm{~d} x \\
\frac{\mathrm{d}}{\mathrm{d} x} \arccos x &amp;=-\frac{1}{\sqrt{1-x^{2}}} \\
\arccos x &amp;=-\int \frac{1}{\sqrt{1-x^{2}}} \mathrm{~d} x \\
\frac{\mathrm{d}}{\mathrm{d} x} \arctan x &amp;=\frac
\arctan x &amp;=\int \frac{1}{1+x^{2}} \mathrm{~d} x
\end{aligned}
\]&lt;p&gt;那么代入 \(F(x)\) 就有:&lt;/p&gt;
\[
\begin{aligned}
\frac{\mathrm{d}}{\mathrm{d} x} \arcsin F(x) &amp;=\frac{F^{\prime}(x)}{\sqrt{1-F^{2}(x)}} \\
\arcsin F(x) &amp;=\int \frac{F^{\prime}(x)}{\sqrt{1-F^{2}(x)}} \mathrm{d} x \\
\frac{\mathrm{d}}{\mathrm{d} x} \arccos F(x) &amp;=-\frac{F^{\prime}(x)}{\sqrt{1-F^{2}(x)}} \\
\arccos F(x) &amp;=-\int \frac{F^{\prime}(x)}{\sqrt{1-F^{2}(x)}} \mathrm{d} x \\
\frac{\mathrm{d}}{\mathrm{d} x} \arctan F(x) &amp;=\frac{F^{\prime}(x)}{1+F^{2}(x)} \\
\arctan F(x) &amp;=\int \frac{F^{\prime}(x)}{1+F^{2}(x)} \mathrm{d} x
\end{aligned}
\]&lt;p&gt;直接按式子求就可以了。&lt;/p&gt;
&lt;p&gt;时间复杂度均为 \(\Theta(n \log n)\)。&lt;/p&gt;</description></item><item><title>差分约束</title><link>https://sichen-wang.github.io/blog/%E5%B7%AE%E5%88%86%E7%BA%A6%E6%9D%9F/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E5%B7%AE%E5%88%86%E7%BA%A6%E6%9D%9F/</guid><description>&lt;p&gt;差分约束是用来解形如 \(x_{1}-x_{2}\leqslant k\) 的若干个方程的算法。&lt;/p&gt;
&lt;p&gt;我们发现可以将方程移项成 \(x_{1}\leqslant x_{2}+k\)，解方程的时候考虑建图，从 \(x_{2}\) 向 \(x_{1}\) 连一条长度为 \(k\) 的边，然后对这张图建一个超级源点，向所有点连一条长度为 \(0\) 的边，最后跑最短/最长路得出的 \(dis\) 就是每个变量的一个取值。&lt;/p&gt;
&lt;p&gt;为什么这样做是对的呢？因为如果有一条 \(u\) 到 \(v\) 的长度为 \(w\) 的边，那么跑完最短路以后 \(dis_{v}\) 一定不大于 \(dis_{u} + w\)，恰好满足一个方程。那么将所有边连上以后再跑最短路就可以满足所有方程，最长路同理。&lt;/p&gt;
&lt;p&gt;另外，如果有负环则无解。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(\rm SPFA)\)。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;需要注意的是，最短路求的是以起始点为基准的最大解，而最长路求的是以起始点为基准的最小解。&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>常见函数图像</title><link>https://sichen-wang.github.io/blog/%E5%B8%B8%E8%A7%81%E5%87%BD%E6%95%B0%E5%9B%BE%E5%83%8F/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E5%B8%B8%E8%A7%81%E5%87%BD%E6%95%B0%E5%9B%BE%E5%83%8F/</guid><description>&lt;p&gt;注意需要从定义域，奇偶性，单调性，特殊点，趋势等方面分析。&lt;/p&gt;
&lt;h2 id="y--x-ex"&gt;y = x e^x&lt;/h2&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="https://s1.ax1x.com/2022/05/16/Ofx8qU.png" alt="" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;首先容易知道 \(y = xe^{x}\) 的定义域为 \(\mathbb{R}\)。&lt;/p&gt;
&lt;p&gt;然后考虑对其求导，得到 \(y' = e^{x}(x + 1)\)。&lt;/p&gt;
&lt;p&gt;可以发现 \(e^{x}\) 恒大于 \(0\)，\(x + 1\) 在 \(x\) 小于 \(-1\) 时小于 \(0\)，在 \(x\) 不小于 \(-1\) 时不小于 \(0\)。&lt;/p&gt;
&lt;p&gt;于是我们可以初步以 \((1, -\frac{1}{e})\) 作为分界点，继续分析。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;当 \(x \lt -1\) 时，可以发现 \(e^{x}\) 变小得越来越慢，并且导数为负，所以函数从 \((1, -\frac{1}{e})\) 开始向左以 \(x\) 轴为渐近线递增。&lt;/li&gt;
&lt;li&gt;当 \(x \gt -1\) 时，可以发现 \(e^{x}\) 增长得很快，与 \(x + 1\) 完全不是一个量级的，于是函数图像主要由 \(e^{x}\) 产生影响，画出的图像与指数函数类似，要稍微陡一点点。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;另外一个需要注意的是，函数过点 \((0, 0)\)。&lt;/p&gt;
&lt;h2 id="y--ex--x"&gt;y = e^x / x&lt;/h2&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="https://s1.ax1x.com/2022/05/16/Ohp5sx.png" alt="" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;首先容易知道 \(y = \frac{e^{x}}{x}\) 的定义域为 \(\mathbb{R}\backslash\{0\}\)。&lt;/p&gt;
&lt;p&gt;然后考虑对其求导，得到 \(y' = \frac{e^{x}(x - 1)}{x^{2}}\)，容易发现需要以 \(x = 0, 1\) 作为分界点进行分析：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;当 \(x \lt 0\) 时，在靠左边的地方 \(e^{x}\) 的影响非常大，于是往左的函数图像与 \(y = xe^{x}\) 类似。但是在接近 \(x = 0\) 的地方 \(e^{x}\) 的影响较小，剩下部分的结构与 \(\frac{1}{x}\) 类似，于是函数图像也是类似的。&lt;/li&gt;
&lt;li&gt;当 \(0 \lt x \lt 1\) 时，在接近 \(x = 0\) 的地方 \(e^{x}\) 的影响较小，剩下部分的结构与 \(\frac{1}{x}\) 类似，于是函数图像也是类似的。&lt;/li&gt;
&lt;li&gt;当 \(x \gt 1\) 时， \(e^{x}\) 的影响逐渐变大，于是函数图像类似于指数函数，要稍微缓一点点。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="y--x--ex"&gt;y = x / e^x&lt;/h2&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="https://s1.ax1x.com/2022/05/16/OhPeaT.png" alt="" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;首先容易知道 \(y = \frac{x}{e^{x}}\) 的定义域为 \(\mathbb{R}\)。&lt;/p&gt;
&lt;p&gt;然后考虑对其求导，得到 \(y' = \frac{1 - x}{e^{x}}\)，容易发现需要以 \(x = 1\) 作为分界点进行分析。分析过程与 \(y = xe^{x}\) 类似（所以图像也是类似的），此处不做赘述。&lt;/p&gt;
&lt;h2 id="y--x-ln-x"&gt;y = x ln x&lt;/h2&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="https://s1.ax1x.com/2022/05/16/OhiQk8.png" alt="" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;首先容易知道 \(y = x \ln x\) 的定义域为 \(\mathbb{R}^{+}\)。&lt;/p&gt;
&lt;p&gt;然后对其求导，得到 \(y' = \ln x + 1\)。&lt;/p&gt;
&lt;p&gt;可以发现从 \(x = 0\) 开始，\(y'\) 从 \(- \infty\) 开始快速增大，在 \(\frac{1}{e}\) 处取到 \(0\)，然后继续缓慢增大。&lt;/p&gt;
&lt;p&gt;于是 \(y\) 一开始快速下降，在 \((\frac{1}{e}, -\frac{1}{e})\) 处取到最小值，然后加速上升，加速度略大于 \(y = x\)，远小于 \(y = x^{2}\)。&lt;/p&gt;
&lt;h2 id="y--ln-x--x"&gt;y = (ln x) / x&lt;/h2&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="https://s1.ax1x.com/2022/05/16/OhAa7t.png" alt="" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;容易知道 \(y = \frac{\ln x}{x}\) 的定义域为 \(\mathbb{R}^{+}\)。&lt;/p&gt;
&lt;p&gt;然后对其求导，得到 \(y' =\frac{1 - \ln x}{x^{2}}\)，容易发现需要以 \(x = 1, e\) 作为分界点进行分析。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;当 \(0 \lt x \lt 1\) 时，往左 \(1 - \ln x\) 快速增大，\(x^{2}\) 快速缩小，于是 \(y'\) 总体快速增大，所以 \(y\) 从 \((1, 0)\) 开始向左以 \(y\) 轴为渐近线快速下降。&lt;/li&gt;
&lt;li&gt;当 \(1 \lt x \lt e\) 时，\(1 - \ln x \gt 0, x^{2} \gt 0\)，并且 \(y'\) 的值不大，所以 \(y\) 从 \((1, 0)\) 开始缓慢上升，以 \((e, \frac{1}{e})\) 作为最高点。&lt;/li&gt;
&lt;li&gt;当 \(x \gt e\) 时，\(1 - \ln x \lt 0, x^{2} \gt 0\)，并且 \(1 - \ln x\) 的下降速度远不如 \(x^{2}\) 的上升速度，于是 \(y' \lt 0\) 且以 \(0\) 为渐近线不断变大，体现在图像上即为 \(y\) 从 \((e, \frac{1}{e})\) 开始减速下降。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="y--x--ln-x"&gt;y = x / ln x&lt;/h2&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="https://s1.ax1x.com/2022/05/16/OhVqFx.png" alt="" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;容易知道 \(y = \frac{x}{\ln x}\) 的定义域为 \(\mathbb{R}^{+} \backslash\{1\}\)。&lt;/p&gt;
&lt;p&gt;然后对其求导，得到 \(y' = \frac{\ln x - 1}{\ln^{2} x}\)，容易发现需要以 \(x = 1, e\) 作为分界点进行分析。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;当 \(0 \lt x \lt 1\) 时，\(\ln x - 1\) 始终小于 \(0\)，\(\ln^{2} x\) 始终大于 \(0\)。在靠近 \(x = 0\) 时，\(\ln x \to - \infty\)，故 \(\frac{\ln x - 1}{\ln^{2} x} \to \frac{1}{-\infty}\)，于是 \(y\) 下降幅度很小；在靠近 \(x = 1\) 时，\(\ln x \to 0\)，所以 \(\frac{\ln x - 1}{\ln^{2} x} \to -\infty\)，于是 \(y\) 下降幅度很大。&lt;/li&gt;
&lt;li&gt;当 \(1 \lt x \lt e\) 时，\(\ln x - 1\) 始终小于 \(0\)，\(\ln^{2} x\) 始终大于 \(0\)。由于在 \(x\) 仅比 \(1\) 大一点点的时候 \(\ln x\) 非常接近 \(0\)，所以 \(y\) 从 \((1, +\infty)\)（一个虚拟的点）开始以非常快的速度下降，然后逐渐变得平缓，在 \((e, e)\) 取到最小值。&lt;/li&gt;
&lt;li&gt;当 \(x \gt e\) 时，\(\ln x - 1\) 以缓慢的速度从 \(0\) 开始变大，\(\ln^{2} x\) 以比 \(\ln x\) 快一些，但仍然十分缓慢的速度从 \(1\) 开始变大。由于其结构上与 \(\frac{1}{\ln x}\) 十分类似，所以它以非常缓慢的速度减小。体现在图像上即为 \(y\) 不断上升，但上升速度越来越慢。&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>数列分块</title><link>https://sichen-wang.github.io/blog/%E6%95%B0%E5%88%97%E5%88%86%E5%9D%97/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E6%95%B0%E5%88%97%E5%88%86%E5%9D%97/</guid><description>&lt;h2 id="基本思想"&gt;基本思想&lt;/h2&gt;
&lt;p&gt;考虑一些在序列上的区间操作，如区间加和区间求和。&lt;/p&gt;
&lt;p&gt;直接暴力做单次操作复杂度是 \(\Theta(n)\)，总时间复杂度 \(\Theta(qn)\).&lt;/p&gt;
&lt;p&gt;如果将序列分成 \(\sqrt{n}\) 块，每块长度为 \(\sqrt{n}\)，并且对每个块维护里面所有元素的和，即可在 \(\Theta(\sqrt{n})\) 的复杂度内进行单次操作。&lt;/p&gt;
&lt;p&gt;具体实现如下：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;令块的数量为 \(num=\sqrt{n}\)，单个块的长度为 \(siz=\lceil\frac{n}{num}\rceil\).&lt;/li&gt;
&lt;li&gt;记 \(bel_{i}\) 表示 \(i\) 号节点属于第几个块。&lt;/li&gt;
&lt;li&gt;可以记录一些题目需要用到的信息，如 \(sum_{i}\) 表示第 \(i\) 个块内所有元素的和。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="数列分块入门-9-题"&gt;数列分块入门 9 题&lt;/h2&gt;
&lt;h3 id="t1-区间修改-单点查询"&gt;T1 区间修改, 单点查询&lt;/h3&gt;
&lt;p&gt;对每个块维护整块加的值，查询的时候加上即可。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\sqrt{n})\)。&lt;/p&gt;
&lt;h3 id="t2-区间修改-查区间内小于某个数的个数"&gt;T2 区间修改, 查区间内小于某个数的个数&lt;/h3&gt;
&lt;p&gt;对每个块内的元素排序，区间修改时整块大小顺序不变，散块暴力排序，查询时二分即可。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\sqrt{n}\log n)\)。&lt;/p&gt;
&lt;p&gt;排序使用归并可以将复杂度优化到 \(\Theta(n\sqrt{n\log n})\)。&lt;/p&gt;
&lt;h3 id="t3-区间修改-区间查前驱"&gt;T3 区间修改, 区间查前驱&lt;/h3&gt;
&lt;p&gt;同样是排序后在块内二分，只不过是把求比他小的数的数量改成求比它小的数中最大的那个。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\sqrt{n}\log n)\)。&lt;/p&gt;
&lt;p&gt;排序使用归并可以将复杂度优化到 \(\Theta(n\sqrt{n\log n})\)。&lt;/p&gt;
&lt;h3 id="t4-区间修改-区间求和"&gt;T4 区间修改, 区间求和&lt;/h3&gt;
&lt;p&gt;维护每个块的和以及加的数，用类似 \(\rm T1\) 的方法维护。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\sqrt{n})\)。&lt;/p&gt;
&lt;h3 id="t5-区间开方-区间求和"&gt;T5 区间开方, 区间求和&lt;/h3&gt;
&lt;p&gt;我们发现开方操作是没办法全局维护的，于是考虑寻找开方操作的性质。&lt;/p&gt;
&lt;p&gt;观察到每个数被开方很少的次数以后就会变成 \(1\)（或者它本身就是 \(0\)，但这部分显然没有贡献，可以直接删去），于是对每个块记录一下里面 \(1\) 的个数，如果全都是 \(1\)，就不对它进行开方，否暴力开方即可。&lt;/p&gt;
&lt;p&gt;求区间和还是维护一下每个块的和。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\sqrt{n})\)。&lt;/p&gt;
&lt;h3 id="t6-单点插入-单点查询"&gt;T6 单点插入, 单点查询&lt;/h3&gt;
&lt;p&gt;我们发现暴力做的时候需要将所有数向后移一位，单次时间复杂度 \(\Theta(n)\)。&lt;/p&gt;
&lt;p&gt;于是考虑分块，给每个块预留 \(\sqrt{n}\) 的剩余空间用来后移，记一下当前块的长度即可。查询的时候每访问一个块就把查询编号减去当前块的长度。不难发现这样做单次操作时间复杂度 \(\Theta(\sqrt{n}).\)&lt;/p&gt;
&lt;p&gt;但是我们发现一个问题，如果插入全在一个块内的话复杂度很快就会变成 \(\Theta(n)\)，于是考虑每进行插入操作 \(\sqrt{n}\) 次就重构分块即可。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\sqrt{n})\)。&lt;/p&gt;
&lt;h3 id="t7-区间修改包含加和乘-单点查询"&gt;T7 区间修改(包含加和乘), 单点查询&lt;/h3&gt;
&lt;p&gt;考虑对每个块记 \(\rm add\) 和 \(\rm mul\)，表示块内元素的真实值为 \(a\times \rm mul+add\)，区间加的时候，给 \(\rm add\) 加上 \(k\) 即可，区间乘的时候，不仅需要给 \(\rm mul\) 乘上 \(k\)，还需要给 \(\rm add\) 乘上 \(k.\)&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\sqrt{n})\)。&lt;/p&gt;
&lt;h3 id="t8-区间查询数的个数并全部修改成这个数"&gt;T8 区间查询数的个数并全部修改成这个数&lt;/h3&gt;
&lt;p&gt;我们发现如果询问区间小的话查询和修改都很容易，如果询问区间大的话会把很长一段都变成相同的数。如果记录一个块是否都是同一个数的话就很容易维护了。&lt;/p&gt;
&lt;p&gt;不难发现这样做复杂度是 \(\Theta(n\sqrt{n})\) 的。&lt;/p&gt;
&lt;h3 id="t9-询问区间最小众数"&gt;T9 询问区间最小众数&lt;/h3&gt;
&lt;p&gt;记 \(s_{i,j}\) 表示前 \(i\) 个块中 \(j\) 出现的次数，\(p_{i,j}\) 表示第 \(i\) 个块到第 \(j\) 个块的众数。&lt;/p&gt;
&lt;p&gt;我们发现，对于一次询问，答案一定是整块的众数或散块的众数，这个只需要对比一下即可。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\sqrt{n})\)。&lt;/p&gt;
&lt;h2 id="经典例题"&gt;经典例题&lt;/h2&gt;
&lt;h3 id="tjoi2009-开关"&gt;[TJOI2009] 开关&lt;/h3&gt;
&lt;p&gt;记 \(c_{i}\) 表示第 \(i\) 盏灯是否开着，\(sum_{i}\) 表示第 \(i\) 个块中有多少盏灯开着，\(d_{i}\) 表示第 \(i\) 个块的状态是否整体改变。&lt;/p&gt;
&lt;p&gt;对于区间取反操作，零散操作直接修改 \(c_{i}\)，并根据 \(c_{i}\) 和 \(d_{i}\) 决定 \(sum_{i}+1\) 或 \(-1\). 整块操作不用改变 \(c\)，直接令 \(sum_{i}=R_{i}-L_{i}+1-sum_{i}\)，并且将 \(d_{i}\) 取反。&lt;/p&gt;
&lt;p&gt;对于区间求和操作，零散点求和直接加上 \(c_{i}\oplus d_{i}\)，整块求和则加上 \(sum_{i}\)。&lt;/p&gt;
&lt;p&gt;单次操作复杂度 \(\Theta(\sqrt{n})\)，总时间复杂度 \(\Theta(q\sqrt{n})\)。&lt;/p&gt;
&lt;h3 id="lg3396-哈希冲突"&gt;[LG3396] 哈希冲突&lt;/h3&gt;
&lt;p&gt;转化题意，设计一种数据结构，支持：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;单点修改&lt;/li&gt;
&lt;li&gt;求从某一点 \(pos(pos\leqslant d)\) 开始，以步长 \(d\) 遍历数列，求所经过的所有数之和。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;考虑根号分治。&lt;/p&gt;
&lt;p&gt;对于 \(d\geqslant \sqrt{n}\) 的询问，直接暴力查询。&lt;/p&gt;
&lt;p&gt;对于 \(d \leqslant \sqrt{n}\) 的询问，记 \(sum_{i,j}\) 表示从 \(i(i\leqslant \sqrt{n})\) 开始，步长为 \(j(j\leqslant \sqrt{n})\) 的答案。预处理的时候直接枚举计算即可，时间复杂度 \(\Theta(n\sqrt{n})\)。&lt;/p&gt;
&lt;p&gt;对于修改操作 \(a[pos]\leftarrow x\)，先直接在原数列上进行修改，再考虑其对 \(sum\) 数组造成了什么影响。易知，对于步长为 \(d\) 的预处理数组，只会对 \(sum_{pos\%d,d}\) 造成影响，于是对每个 \(d(d\leqslant \sqrt{n})\) 修改一下即可，单次修改时间复杂度 \(\Theta(\sqrt{n})\)。&lt;/p&gt;
&lt;p&gt;总时间复杂度 \(\Theta[(n+q)\sqrt{n}]\)。&lt;/p&gt;
&lt;h3 id="lg2801-教主的魔法"&gt;[LG2801] 教主的魔法&lt;/h3&gt;
&lt;p&gt;考虑分块。&lt;/p&gt;
&lt;p&gt;记原数列为 \(A\)，将 \(A\) 复制一份记为 \(B\)，将 \(B\) 分块，块内排序。&lt;/p&gt;
&lt;p&gt;对于修改操作，整块直接打标记，散点修改完后再块内排序，这样完成操作后仍能保持分块数列的性质，单次操作复杂度 \(\Theta(\sqrt{n}\log\sqrt{n})\)。&lt;/p&gt;
&lt;p&gt;对于查询操作，二分查找第 \(i\) 个块内有多少个元素不小于 \(k-add_{i}\)，单次操作复杂度 \(\Theta(\sqrt{n}\log \sqrt{n})\)。&lt;/p&gt;
&lt;p&gt;总时间复杂度 \(\Theta[(n+q\sqrt{n})\log n]\)。&lt;/p&gt;
&lt;p&gt;考虑再对复杂度做一些优化，令块的大小为 \(s\)，则修改操作若采用归并排序，单次操作复杂度为 \(\Theta(s+\frac{n}{s})\)，同时单次查询复杂度为 \(\Theta(s+\frac{n}{s}\log s)\)。当询问次数为 \(q\) 时，总复杂度为 \(\Theta[q(s+\frac{n}{s}\log n)]\geqslant \Theta(q\sqrt{n\log n})\)，取最小值当且仅当 \(s=\sqrt{n\log n}\)。&lt;/p&gt;
&lt;h3 id="国家集训队-排队"&gt;[国家集训队] 排队&lt;/h3&gt;
&lt;p&gt;分块 \(+\) 树状数组。&lt;/p&gt;
&lt;p&gt;考虑交换两个数 \(a_{u}\) 和 \(a_{v}\) 的贡献：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;显然 \(u\) 左边的数和 \(v\) 右边的数没有贡献。&lt;/li&gt;
&lt;li&gt;对于 \(a_{u}\) 来说，贡献为 \(u\) 到 \(v\) 之间比它大的数的数量减去比它小的数的数量。&lt;/li&gt;
&lt;li&gt;对于 \(a_{v}\) 来说，贡献为 \(u\) 到 \(v\) 之间比它小的数的数量减去比它大的数的数量。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;至于如何计算 \(u\) 到 \(v\) 之间比某个数大或小的值的数量，分块后散块直接暴力，整块建两颗树状数组即可。&lt;/p&gt;
&lt;p&gt;令块大小为 \(siz\)，则时间复杂度为 \(\Theta[nlogn+q(siz+\frac{n}{siz}logn)]\geqslant nlogn+q\sqrt{nlogn}\)，取最小值当且仅当 \(siz=\sqrt{nlogn}\)，此时块的数量 \(num=\sqrt{\frac{n}{logn}}\)。&lt;/p&gt;
&lt;h3 id="lg4168-violet-蒲公英"&gt;[LG4168] Violet 蒲公英&lt;/h3&gt;
&lt;p&gt;考虑分块，记 \(s_{i,j}\) 表示前 \(i\) 个块中颜色为 \(j\) 的数量，\(p_{i,j}\) 表示第 \(i\) 个块到第 \(j\) 个块的众数。&lt;/p&gt;
&lt;p&gt;对于一次询问，先求出整块中的众数、众数的出现次数和所有在零散块中出现了的颜色的数量。显然，如果零散块中出现的颜色没有一个比众数出现的次数多，那么要求的众数就是整块的众数，否则是出现次数最多的颜色。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\sqrt{m})\)。此时块大小 \(B=\frac{n}{\sqrt{m}}\)。&lt;/p&gt;</description></item><item><title>最小生成树</title><link>https://sichen-wang.github.io/blog/%E6%9C%80%E5%B0%8F%E7%94%9F%E6%88%90%E6%A0%91/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E6%9C%80%E5%B0%8F%E7%94%9F%E6%88%90%E6%A0%91/</guid><description>&lt;h2 id="kruskal"&gt;Kruskal&lt;/h2&gt;
&lt;p&gt;最常用且大部分情况下效率最高的最小生成树算法。&lt;/p&gt;
&lt;p&gt;将边按长度从小到大排序，每次贪心选择最短的一条边，若这条边连接的两个点还为连通，则将两个点所在的连通块用这条边连接，连通块用并查集维护。&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;证明: 使用归纳法，证明任何时候 Kruskal 算法选择的边集都被某棵 MST 所包含。
基础: 对于算法刚开始时，显然成立（最小生成树存在）。
归纳: 假设某时刻成立，当前边集为 \(F\)，令 \(T\) 为这棵 MST，考虑下一条加入的边 \(e\)。
如果 \(e\) 属于 \(T\)，那么成立。
否则，\(T+e\) 一定存在一个环，考虑这个环上不属于 \(F\) 的另一条边 \(f\)（一定只有一条）。
首先，\(f\) 的权值一定不会比 \(e\) 小，不然 \(f\) 会在 \(e\) 之前被选取。
然后，\(f\) 的权值一定不会比 \(e\) 大，不然 \(T+e-f\) 就是一棵比 \(T\) 还优的生成树了。
所以，\(T+e-f\) 包含了 \(F\)，并且也是一棵最小生成树，归纳成立。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;时间复杂度 \(\Theta(m\log m)\)。&lt;/p&gt;
&lt;h3 id="kruskal-重构树"&gt;Kruskal 重构树&lt;/h3&gt;
&lt;p&gt;这是 Kruskal 算法除了求最小生成树以外的一个重要应用。&lt;/p&gt;
&lt;p&gt;在使用 \(\rm kruskal\) 最小生成树算法的时候会从小到大加入 \(n-1\) 条边。现在仍按照这个顺序，每次加入一条边时将其变成一个点权等于边权的点，然后把它作为所连接两个连通块的父亲节点。&lt;/p&gt;
&lt;p&gt;不难发现两个结点在 MST 上的最短路径上的边权最大值为它们在 \(\rm kruskal\) 重构树上 \(\rm LCA\) 的点权，并且从一个点 \(u\) 出发只经过边权小于某值的边能够到达的点集为 \(\rm Kruskal\) 重构树上某点的子树内所有的叶子结点。&lt;/p&gt;
&lt;h2 id="prim"&gt;Prim&lt;/h2&gt;
&lt;p&gt;在稠密图上复杂度最优的最小生成树算法。&lt;/p&gt;
&lt;p&gt;与 Dijkstra 算法类似，选择一个点作为起点，每次选择到&lt;strong&gt;当前已选的点集中任意一个点&lt;/strong&gt;距离最短的未选择的点并向其连边，再递归操作。&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;证明: 还是说明在每一步，都存在一棵最小生成树包含已选边集。
基础: 只有一个结点的时候，显然成立。
归纳: 如果某一步成立，当前边集为 \(F\)，属于 \(T\) 这棵 MST，接下来要加入边 \(e\)。
如果 \(e\) 属于 \(T\)，那么成立。
否则考虑 \(T+e\) 中环上另一条可以加入当前边集的边 \(f\)。
首先，\(f\) 的权值一定不小于 \(e\) 的权值，否则就会选择 \(f\) 而不是 \(e\) 了。
然后，\(f\) 的权值一定不大于 \(e\) 的权值，否则 \(T+e-f\) 就是一棵更小的生成树了。
因此，\(e\) 和 \(f\) 的权值相等，\(T+e-f\) 也是一棵最小生成树，且包含了 \(F\)。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;时间复杂度 \(\Theta[(n+m)\log n]\)。&lt;/p&gt;
&lt;h2 id="boruvka"&gt;Boruvka&lt;/h2&gt;
&lt;p&gt;在大多数完全图上求最小生成树所使用的算法。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;每次遍历所有的点，求出它当前属于哪个连通块。&lt;/li&gt;
&lt;li&gt;遍历所有的边 \(u-v\)，如果 \(u\) 和 \(v\) 不在同一个连通块，就分别用 \(u\) 和 \(v\) 去更新它们所在连通块的最小出边。&lt;/li&gt;
&lt;li&gt;将每个连通块的最小出边加入 MST 的边集。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;由于每次连通块数量减半，所以时间复杂度 \(\Theta(m\log n)\)。&lt;/p&gt;</description></item><item><title>最短路</title><link>https://sichen-wang.github.io/blog/%E6%9C%80%E7%9F%AD%E8%B7%AF/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E6%9C%80%E7%9F%AD%E8%B7%AF/</guid><description>&lt;h2 id="最短路算法拓展技巧"&gt;最短路算法拓展技巧&lt;/h2&gt;
&lt;h3 id="floyd-传递闭包"&gt;Floyd 传递闭包&lt;/h3&gt;
&lt;p&gt;有时候我们需要维护一些具有传递性的关系，如相等，连通等。&lt;/p&gt;
&lt;p&gt;初始条件往往是给定几组关系，要把所有的关系求出来。&lt;/p&gt;
&lt;p&gt;可以把 Floyd 算法做一些调整：&lt;/p&gt;
\[
dis_{i,j}=dis_{i,j}~|~(dis_{i,k}~\mathbin{\&amp;}~dis_{k,j})
\]&lt;p&gt;时间复杂度还是 \(\Theta(n^{3})\)，但由于位运算的特殊性，有些时候可以使用 &lt;code&gt;bitset&lt;/code&gt; 优化到 \(\Theta\left(\frac{n^{3}}{\omega}\right)\)。&lt;/p&gt;
&lt;h3 id="johnson-重赋权"&gt;Johnson 重赋权&lt;/h3&gt;
&lt;p&gt;对于多源最短路，如果我们枚举一个点然后跑堆优化的 Dijkstra，那么复杂度是 \(\Theta(nm \log n)\) 的，在图比较稀疏的情况下，这个复杂度要优于 Floyd 算法的 \(\Theta(n^{3})\)。&lt;/p&gt;
&lt;p&gt;但是 Dijkstra 算法要求所有边权均非负，于是就有了重赋权的技巧。&lt;/p&gt;
&lt;p&gt;具体来说，我们新建一个 \(0\) 号点，并且从这个点出发向所有点连一条边权为 \(0\) 的边，然后跑单源最短路(SPFA 或者 Bellman-Ford)。设距离数组为 \(h\)， 接下来对于每条边 \((u, v)\)， 令&lt;/p&gt;
\[
w^{\prime}(u, v)=w(u, v)+h(u)-h(v)
\]&lt;p&gt;这样所有的边权都变成非负的，我们就可以跑 Dijkstra 算法了。&lt;/p&gt;
&lt;p&gt;接下来证明这样做为什么是对的：&lt;/p&gt;
&lt;p&gt;首先由于 \(h(v) \leqslant h(u)+w(u, v),\) 所以新图的边权一定非负。&lt;/p&gt;
&lt;p&gt;设新图上的最短路径为 \(d^{\prime}\)，原图上的最短路径为 \(d\)。&lt;/p&gt;
\[
\begin{aligned}
d^{\prime}(u, v) &amp;= \min_{a_{1}, a_{2}, \ldots, a_{k}} w^{\prime}\left(u, a_{1}\right)+w^{\prime}\left(a_{1}, a_{2}\right)+\cdots+w^{\prime}\left(a_{k}, v\right) \\
&amp;= \min_{a_{1}, a_{2}, \ldots, a_{k}} w\left(u, a_{1}\right)+\left(h(u)-h\left(a_{1}\right)\right)+w\left(a_{1}, a_{2}\right)+\left(h\left(a_{2}\right)-h\left(a_{1}\right)\right)+\cdots+w\left(a_{k}, v\right)+\left(h(v)-h\left(a_{k}\right)\right) \\
&amp;= h(u)-h(v)+\min_{a_{1}, a_{2}, \ldots, a_{k}} w\left(u, a_{1}\right)+\cdots+w\left(a_{k}, v\right) \\
&amp;= h(u)-h(v)+d(u, v)
\end{aligned}
\]&lt;p&gt;这个证明用到了势能分析的思想，如果想进一步了解话可以参考本站《「杂项」复杂度分析》一文。&lt;/p&gt;
&lt;h3 id="最短路图"&gt;最短路图&lt;/h3&gt;
&lt;p&gt;所谓最短路图，就是在求完从 \(S\) 出发的单源最短路之后，只保留最短路上的边形成的有向图。&lt;/p&gt;
&lt;p&gt;只需要在求的过程中维护一个 \(pre_{u}\) 数组表示点 \(u\) 的前驱即可。&lt;/p&gt;
&lt;p&gt;很多最短路的变种都需要用这个算法，有时候考虑最短路图也有利于发现一些隐藏的性质。&lt;/p&gt;
&lt;h2 id="经典例题"&gt;经典例题&lt;/h2&gt;
&lt;h3 id="lg1266-速度限制"&gt;[LG1266] 速度限制&lt;/h3&gt;
&lt;p&gt;记 \(dis_{i,j}\) 表示当前已经到 \(i\)，上一个点是 \(j\) 的时间最短路。&lt;/p&gt;
&lt;p&gt;本质上是个分层图最短路，直接跑 Dijkstra 就好了。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(nm\log n)\)。&lt;/p&gt;
&lt;h3 id="icpc-bj2006-狼抓兔子"&gt;[ICPC-BJ2006] 狼抓兔子&lt;/h3&gt;
&lt;p&gt;首先有定义 ：&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;ul&gt;
&lt;li&gt;平面图是指的存在某种方式使得图上所有边平铺在平面上无交。&lt;/li&gt;
&lt;li&gt;对偶图是指的将平面图上的每个区域看作一个点，两点连边当且仅当两区域相邻，边权为将两区域分隔开的边的权值。&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;有定理 ：&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;平面图两点间最小割等于对偶图两点间最短路。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;于是在这道题中我们就可以将每个三角形区域看作一个点，相邻区域连边后跑从左下角到右上角的最短路。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n^{2}\log n)\)。&lt;/p&gt;
&lt;h3 id="gxoigzoi2019-旅行者"&gt;[GXOI/GZOI2019] 旅行者&lt;/h3&gt;
&lt;p&gt;我们发现可以对 \(k\) 个点二进制分组，每次将 \(k\) 个点分成两个集合 \(S_{1}\) 和 \(S_{2}\)，建一个源点 \(s\) 向所有 \(S_{1}\) 中的结点连长度为 \(0\) 的边，建一个汇点 \(t\) 从所有 \(S_{2}\) 中的结点开始向它连长度为 \(0\)，的边，求从 \(s\) 到 \(t\) 的最短路。&lt;/p&gt;
&lt;p&gt;可以发现，若答案为两点 \(x\) 和 \(y\) 之间的最短路，那么一定有 \(x\not= y\)，这意味着它们至少在某一次二进制分组中被分到了不同的集合，所以这样一定可以找到两点间的最短路。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(Tn\log n\log k)\)。&lt;/p&gt;</description></item><item><title>杜教筛</title><link>https://sichen-wang.github.io/blog/%E6%9D%9C%E6%95%99%E7%AD%9B/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E6%9D%9C%E6%95%99%E7%AD%9B/</guid><description>&lt;p&gt;杜教筛被用来求积性函数的前缀和。&lt;/p&gt;
&lt;p&gt;设有积性函数 \(f(x)\)，其前缀和为 \(S(n) = \sum \limits_{i = 1}^{n} f(i)\)。&lt;/p&gt;
&lt;p&gt;考虑构造 \(h(x)\) 和 \(g(x)\)，满足 \(h = f \times g\)。&lt;/p&gt;
&lt;p&gt;推一下式子 ：&lt;/p&gt;
\[
\begin{aligned}
\sum _ {i = 1} ^ n h(i) &amp;= \sum _ {i = 1} ^ n \sum _ {d | i} g(d) \times f\left(\frac{i}{d}\right) \\
&amp;= \sum _ {d = 1} ^ n g(d) \sum _ {i = 1} ^ {\left\lfloor\frac{n}{d}\right\rfloor} f(i) \\
&amp;= \sum _ {d = 1} ^ n g(d) S\left(\left\lfloor\frac{n}{d}\right\rfloor\right)
\end{aligned}
\]&lt;p&gt;众所周知有数论分块。&lt;/p&gt;
&lt;p&gt;具体来说，观察到式子右边的 \(S\left(\left\lfloor\frac{n}{d}\right\rfloor\right)\) 最多有 \(2\sqrt{n}\) 种取值。证明考虑 \(\sum \limits_{d = 1}^{\sqrt{n}} \left\lfloor\frac{n}{d}\right\rfloor\) 显然最多有 \(\sqrt{n}\) 种取值，\(\forall d \gt \sqrt{n},\left\lfloor\frac{n}{d}\right\rfloor \lt \sqrt{n}\)，故 \(\sum \limits_{d = \sqrt{n} + 1}^{n} \left\lfloor\frac{n}{d}\right\rfloor\) 也最多有 \(\sqrt{n}\) 种取值。&lt;/p&gt;
&lt;p&gt;于是这时候只需要考虑对于一个数 \(i\)，满足 \(\left\lfloor\frac{n}{i}\right\rfloor = \left\lfloor\frac{n}{j}\right\rfloor\) 的最大的 \(j\) 是多少。&lt;/p&gt;
&lt;p&gt;设 \(k = \left\lfloor\frac{n}{i}\right\rfloor\)，则有 \(\left\lfloor\frac{n}{j}\right\rfloor = k\)，将向下取整去掉，有 \(k \leqslant \frac{n}{j} \lt k + 1\)，取倒数，得到 \(\frac{1}{k + 1} \lt \frac{j}{n} \leqslant \frac{1}{k}\)，全部乘上 \(n\) 得到 \(\frac{n}{k + 1} \lt j \leqslant \frac{n}{k}\)，又因为 \(j\) 为整数，所以 \(j_{\max} = \left\lfloor\frac{n}{k}\right\rfloor = \left\lfloor\frac{n}{\left\lfloor\frac{n}{i}\right\rfloor}\right\rfloor\)。&lt;/p&gt;
&lt;p&gt;言归正传，求解杜教筛最终式子时可以直接递归，中间需要记忆化一下，但其实不需要用到 \(\rm map\) 系列 \(\rm STL\)，因为可以证明需要求解的 \(S(x)\) 中 \(x \in \{\left\lfloor\frac{n}{d}\right\rfloor{}|d \in [1, n]\}\)。&lt;/p&gt;
&lt;p&gt;稍加思考就可以发现，上式的一个充分条件为 \(\left\lfloor\frac{\left\lfloor\frac{n}{i}\right\rfloor}{j}\right\rfloor = \left\lfloor\frac{n}{ij}\right\rfloor\)，考虑其证明：\(\forall x \in Z\)，若有 \(x \leqslant \left\lfloor\frac{\left\lfloor\frac{n}{i}\right\rfloor}{j}\right\rfloor\)，那么有 \(xj \leqslant \left\lfloor\frac{n}{i}\right\rfloor\)，进一步有 \(xij \leqslant n\)，再将 \(ij\) 放回去有 \(x \leqslant \left\lfloor\frac{n}{ij}\right\rfloor\)，原式得证。&lt;/p&gt;
&lt;p&gt;故我们只需要将 \(\left\lfloor\frac{n}{d}\right\rfloor\ (d \in [1, n] \cap Z)\) 的所有取值映射到一个数组上就可以直接记忆化了。&lt;/p&gt;
&lt;p&gt;考虑复杂度证明，记忆化以后每个 \(S(x)\) 只需要算一次，而算一次 \(S(x)\) 的时间复杂度为 \(\Theta(\sqrt{x})\)。 故总时间复杂度为 \(\sum\limits_{x} \sqrt{x}\ (x \in \{\left\lfloor\frac{n}{d}\right\rfloor|d \in [1, n] \cap Z\})\)。 对于不大于 \(\sqrt{n}\) 的 \(d\)，其贡献的复杂度上界为 \(\sum \limits_{i = 1}^{\sqrt{n}} \Theta\left(\sqrt{\frac{n}{i}}\right)\)，而对于大于 \(\sqrt{n}\) 的 \(d\)，\(\left\lfloor\frac{n}{d}\right\rfloor\) 的取值不大于 \(\sqrt{n}\)，所以其贡献的上界为 \(\sum \limits_{i = 1}^{\sqrt{n}} \Theta(\sqrt{i})\)，其和为 \(T(n) = \sum \limits_{i = 1}^{\sqrt{n}} \Theta\left(\sqrt{\frac{n}{i}}\right) + \sum \limits_{i = 1}^{\sqrt{n}} \Theta(\sqrt{i})\)，积分求个近似可以得到 \(T(n) \approx \int_{1}^{\sqrt{n}} \Theta\left(\sqrt{\frac{n}{x}}\right) dx + \int_{1}^{\sqrt{n}} \Theta(\sqrt{x}) dx = \Theta(n^{\frac{3}{4}})\)。&lt;/p&gt;
&lt;p&gt;事实上还可以做到更优，线性预处理 \(f\) 的前 \(m\) 项，易知复杂度变成了 \(\Theta(m) + \Theta\left(\sum \limits_{i = 1}^{\frac{n}{m}} \sqrt{\frac{n}{i}}\right)\)，跟之前一样积分近似一下可以得到复杂度即为 \(\Theta(m + nm^{-\frac{1}{2}})\)，易知其下界为 \(\Theta(n^{\frac{2}{3}})\)。&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;在此列举一些常见的构造（其证明需要用到迪利克雷生成函数，略过）：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;\((id^{k} \cdot \mu) \times id^{k} = \varepsilon\)&lt;/li&gt;
&lt;li&gt;\((id^{k} \cdot \varphi) \times id^{k} = id^{k + 1}\)&lt;/li&gt;
&lt;li&gt;\((id^{k} \cdot \sigma_{k}) \times (id^{k} \cdot \mu) = id^{2k}\)&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>欧拉回路</title><link>https://sichen-wang.github.io/blog/%E6%AC%A7%E6%8B%89%E5%9B%9E%E8%B7%AF/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E6%AC%A7%E6%8B%89%E5%9B%9E%E8%B7%AF/</guid><description>&lt;h3 id="定义"&gt;定义&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;欧拉路径&lt;/strong&gt;：如果图中的一个路径包括每个边恰好一次，则该路径称为欧拉路径。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;欧拉回路&lt;/strong&gt;：首尾相接的欧拉路径被称为欧拉回路。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="判定"&gt;判定&lt;/h3&gt;
&lt;p&gt;由于每一条边都要经过&lt;strong&gt;恰好一次&lt;/strong&gt;，因此对于除了起点和终点之外的任意一个节点，只要进来，一定要出去，故有如下结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;一个&lt;strong&gt;无向图&lt;/strong&gt;存在欧拉&lt;strong&gt;回路&lt;/strong&gt;，当且仅当该图所有顶点&lt;strong&gt;度数都为偶数&lt;/strong&gt;，且该图只有一个存在边的连通块。&lt;/li&gt;
&lt;li&gt;一个&lt;strong&gt;无向图&lt;/strong&gt;存在欧拉&lt;strong&gt;路径&lt;/strong&gt;，当且仅当该图中&lt;strong&gt;奇点的数量为&lt;/strong&gt; \(0\) &lt;strong&gt;或&lt;/strong&gt; \(2\) 且该图只有一个存在边的连通块。&lt;/li&gt;
&lt;li&gt;一个&lt;strong&gt;有向图&lt;/strong&gt;存在欧拉&lt;strong&gt;回路&lt;/strong&gt;，当且仅当&lt;strong&gt;所有点的入度等于出度&lt;/strong&gt;。&lt;/li&gt;
&lt;li&gt;一个&lt;strong&gt;混合图&lt;/strong&gt;存在欧拉&lt;strong&gt;回路&lt;/strong&gt;，当且仅当&lt;strong&gt;存在一个对所有无向边定向的方案，使得所有点的入度等于出度&lt;/strong&gt;。求解需要用到网络流相关算法。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="求解"&gt;求解&lt;/h3&gt;
&lt;p&gt;一般使用 \(\rm dfs\) 算法求出一张图的欧拉回路。&lt;/p&gt;
&lt;p&gt;给每一条边记一个 \(\rm vis\) 数组，表示其是否被访问过，然后从一个点出发，遍历所有的边。&lt;/p&gt;
&lt;p&gt;直接 \(\rm dfs\) 的话可能会有一些点无法被遍历到，于是在记录答案的时候可以倒着记录，即当通过 \(u\to v\) 这条边的时候，可以先将点 \(v\ \rm dfs\) 完，再加入 \(u\to v\) 这条边。这样做相当于如果碰到两个相邻的环，但只遍历了其中一个就走到头了，于是我们需要走完另一个环后将两个环拼起来。&lt;/p&gt;
&lt;p&gt;由于只需要将图遍历一遍，所以时间复杂度是 \(\Theta(n + m)\) 的。&lt;/p&gt;
&lt;h3 id="参考代码"&gt;参考代码&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;dfs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;record&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dfs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;record&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>生成函数</title><link>https://sichen-wang.github.io/blog/%E7%94%9F%E6%88%90%E5%87%BD%E6%95%B0/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E7%94%9F%E6%88%90%E5%87%BD%E6%95%B0/</guid><description>&lt;h2 id="普通生成函数"&gt;普通生成函数&lt;/h2&gt;
&lt;p&gt;序列 \(a\) 的普通生成函数 \(\rm(Ordinary\ Generating\ Function,OGF)\) 被定义为形式幂级数 ：&lt;/p&gt;
\[
F(x) = \sum _n a_n x ^ n \tag{1.0.1}
\]&lt;p&gt;\(a\) 既可以是有穷序列也可以是无穷序列，\(x\) 不具有实际意义，仅作为一个形式上的变量参与运算。&lt;/p&gt;
&lt;h3 id="两种基本形式"&gt;两种基本形式&lt;/h3&gt;
&lt;h4 id="加法与乘法"&gt;加法与乘法&lt;/h4&gt;
&lt;p&gt;假设两个序列 \(a,b\) 的 \(\rm OGF\) 分别为 \(F(x),G(x)\)。&lt;/p&gt;
&lt;p&gt;加减不必多说 ：&lt;/p&gt;
\[
F(x) \pm G(x) = \sum _n (a_n \pm b_n) x ^ n \tag{1.1.1}
\]&lt;p&gt;乘法用卷积定义 ：&lt;/p&gt;
\[
F(x)G(x) = \sum _n x ^ n \sum _{i = 0} ^n a_ib_{n - i} \tag{1.1.2}
\]&lt;h4 id="封闭形式"&gt;封闭形式&lt;/h4&gt;
&lt;p&gt;在使用生成函数的过程中，我们不会一直使用形式幂级数形式，有时候会为了计算方便将其替换成封闭形式。&lt;/p&gt;
&lt;p&gt;\(F(x) = \sum_{n} x^{n}\)&lt;/p&gt;
\[
F(x) - xF(x) = 1
\]\[
F(x) = \frac{1}{1 - x} \tag{1.2.1}
\]&lt;p&gt;\(F(x) = \sum_{n} q^{n} x^{n}\)&lt;/p&gt;
\[
F(x) - qxF(x) = 1
\]\[
F(x) = \frac{1}{1 - qx} \tag{1.2.2}
\]&lt;p&gt;\(F(x) = \sum_{n} (n + 1)x^{n}\)&lt;/p&gt;
\[
\begin{aligned}
F(x) &amp;= \sum _{n \geqslant 1} nx ^ {n - 1}\\
&amp;= \sum _ {n} (x ^ n)'\\
&amp;= \left(\frac{1}{1 - x}\right)'
\end{aligned}
\]\[
F(x) = \frac{1}{(1 - x) ^ 2} \tag{1.2.3}
\]&lt;p&gt;\(F(x) = \sum_{n} \binom{m}{n} x^{n}\)&lt;/p&gt;
\[
F(x) = (1 + x) ^ m \tag{1.2.4}
\]&lt;p&gt;\(F(x) = \sum_{n} \binom{n + m}{n} x^{n}\)&lt;/p&gt;
\[
F(x) = \frac{1}{(1 - x) ^ {m + 1}} \tag{1.2.5}
\]&lt;p&gt;考虑归纳证明 ：&lt;/p&gt;
&lt;p&gt;显然当 \(m = 0\) 时，有 \(F(x) = \sum_{n} \binom{n}{n} x^{n} = \frac{1}{1 - x}\)。&lt;/p&gt;
&lt;p&gt;当 \(m \gt 0\) 时 ：&lt;/p&gt;
\[
\begin{aligned}
\frac{1}{(1 - x) ^ {m + 1}} &amp;= \frac{1}{(1 - x) ^ m}\frac{1}{1 - x}\\
&amp;= \left[\sum _ n \dbinom{m + n - 1}{n} x ^ n\right] \left(\sum _n x ^ n\right)\\
&amp;= \sum _ n x ^ n \sum _ {i = 0} ^ n \dbinom{m + i - 1}{i}\\
&amp;= \sum _ n \dbinom{m + n}{n} x ^ n
\end{aligned}
\]&lt;p&gt;关于上述推导过程中最后一步用到的组合恒等式 ：&lt;/p&gt;
\[
\sum _ {i = 0} ^ n \dbinom{m + i - 1}{i} = \dbinom{m + n}{n} \tag{1.2.6}
\]&lt;p&gt;考虑其组合意义，左边相当于将 \(i\) 个无标号石子放进 \(m\) 个有标号盒子里，盒子允许为空的方案数。&lt;/p&gt;
&lt;p&gt;考虑将 \(n\) 个石子放进 \(m + 1\) 个盒子中的方案数，规则同上，显然方案数为 \(\binom{m + n}{n}\)。 假设从 \(m + 1\) 个盒子中取出一个，枚举要将 \(n\) 个石子中的多少个放入剩下的 \(m\) 个盒子中，剩余的石子就只能放进取出的盒子中了，则方案数为 \(\sum_{i = 0}^{n} \binom{m + i - 1}{i}\)。 故组合恒等式 \((1.2.6)\) 得证。&lt;/p&gt;
&lt;p&gt;还有另一种仅通过组合意义证明式 \((1.2.5)\) 的方法 ：&lt;/p&gt;
&lt;p&gt;可以发现 \(\frac{1}{(1 - x)^{m + 1}} = \left(\frac{1}{1 - x}\right)^{m + 1}\)，相当于将初始仅有 \(a_{0} = 1\) 的序列做了 \(m + 1\) 遍前缀和。又因为每做一遍前缀和的组合意义是一个位置可以走到任意一个不在自己左边的位置，所以实际上 \(\frac{1}{(1 - x)^{m + 1}}\) 的第 \(n\) 项系数即为从 \(0\) 开始，每次向右走非负整数步，走 \(m + 1\) 步到达 \(n\) 的方案数。归约到一个更加经典的问题，就是不定方程 \(\sum_{i = 1}^{m + 1} x_{i} = n\) 的非负整数解数量，众所周知，其值为 \(\binom{m + n}{n}\)。&lt;/p&gt;
&lt;h4 id="部分分式定理"&gt;部分分式定理&lt;/h4&gt;
&lt;p&gt;在上文中，我们已经知道了形如 \(F(x) = \frac{1}{(1 - qx)^{m}}\) 的部分分式可以简单地被转换为形式幂级数形式，于是我们想找到一种方法能够将形如 \(\frac{P(x)}{Q(x)}\) 的一般分式拆成若干个部分分式之和。&lt;/p&gt;
&lt;p&gt;部分分式定理指出，如果 \(\deg P \lt \deg Q\)，那么可以先将 \(Q(x)\) 因式分解，然后使用待定系数法构造若干个形如 \(\frac{A}{(1 - ax)^{p}}\) 的式子，使它们的和为 \(\frac{P(x)}{Q(x)}\)。&lt;/p&gt;
&lt;p&gt;例如 \(F(x) = \frac{P(x)}{(x - 1)^{2} (x + 2)}\)，那么构造 \(\frac{A}{x - 1} + \frac{B}{(x - 1)^{2}} + \frac{C}{x + 2} = \frac{P(x)}{(x - 1)^{2} (x + 2)}\)。&lt;/p&gt;
&lt;h3 id="两个经典数列的生成函数"&gt;两个经典数列的生成函数&lt;/h3&gt;
&lt;h4 id="斐波那契数列"&gt;斐波那契数列&lt;/h4&gt;
&lt;p&gt;斐波那契数列 \(\rm(Fibonacci\ Sequence)\) 被定义为 \(a_{0} = 0, a_{1} = 1,a_{n} = a_{n - 1} + a_{n - 2}(n \gt 1)\)。&lt;/p&gt;
&lt;p&gt;设 \(F(x) = \sum_{n} a_{n} x^{n}\)，显然有 ：&lt;/p&gt;
\[
F(x) = xF(x) + x ^ 2 F(x) - a_0x + a_1x + a_0
\]&lt;p&gt;解得 ：&lt;/p&gt;
\[
F(x) = \frac{x}{1 - x - x ^ 2} \tag{1.3.1}
\]&lt;p&gt;考虑使用部分分式定理，观察到分母多项式次数为 \(2\)，那么设 ：&lt;/p&gt;
\[
\frac{A}{1 - ax} + \frac{B}{1 - bx} = \frac{x}{1 - x - x ^ 2}
\]&lt;p&gt;解得 ：&lt;/p&gt;
\[
\begin{aligned}
F(x) &amp;= \frac{x}{1 - x - x ^ 2}\\
&amp;= \frac{\frac{\sqrt{5}}{5}}{1 - \frac{1 + \sqrt{5}}{2}x} + \frac{-\frac{\sqrt{5}}{5}}{1 - \frac{1 - \sqrt{5}}{2}x}\\
&amp;= \sum _ n x ^ n \frac{\sqrt{5}}{5}\left[\left(\frac{1 + \sqrt{5}}{2}\right) ^ n - \left(\frac{1 - \sqrt{5}}{2}\right) ^ n\right]
\end{aligned}
\]&lt;p&gt;于是上式即为斐波那契数列的形式幂级数形式和通项。&lt;/p&gt;
&lt;h4 id="卡特兰数"&gt;卡特兰数&lt;/h4&gt;
&lt;p&gt;首先引入牛顿二项式定理。&lt;/p&gt;
&lt;p&gt;让我们重定义组合数的运算 ：&lt;/p&gt;
\[
\dbinom{r}{k} = \frac{r ^ {\underline{k}}}{k!}~~(r \in \mathbb{C}, k \in \mathbb{N}) \tag{1.3.3}
\]&lt;p&gt;在这种情况下，对于 \(\alpha \in \mathbb{C}\)，有 ：&lt;/p&gt;
\[
(1 + x) ^ {\alpha} = \sum _n \dbinom{\alpha}{n} x ^ n \tag{1.3.4}
\]&lt;p&gt;对于卡特兰数序列，令 \(a_{0} = a_{1} = 1, a_{n} = \sum\limits_{i = 0}^{n - 1} a_{i} \times a_{n - i - 1}(n \gt 1)\)&lt;/p&gt;
&lt;p&gt;令其 \(\rm OGF\) 为 \(F(x) = \sum\limits_{n} a^{n} x^{n}\)。&lt;/p&gt;
&lt;p&gt;不难发现其递推式是一个卷积的形式，于是有：&lt;/p&gt;
\[
xF ^ 2(x) + 1 = F(x)
\]&lt;p&gt;解之得：&lt;/p&gt;
\[
F(x) = \frac{1 \pm \sqrt{1 - 4x}}{2x} \tag{1.3.5}
\]&lt;p&gt;要保留哪个根呢？&lt;/p&gt;
&lt;p&gt;求解上式在 \(x \to 0\) 时的极限可以发现，当 \(F(x) = \dfrac{1 + \sqrt{1 - 4x}}{2x}\) 时不收敛。&lt;/p&gt;
&lt;p&gt;原因是：&lt;/p&gt;
\[
F(x) = \dfrac{1 + \sqrt{1 - 4x}}{2x} = \frac{2}{1 - \sqrt{1 - 4x}}
\]&lt;p&gt;则有：&lt;/p&gt;
\[
\lim\limits_{x \to 0 ^ {+}} \frac{2}{1 - \sqrt{1 - 4x}} = \infty
\]\[
\lim\limits_{x \to 0 ^ {-}} \frac{2}{1 - \sqrt{1 - 4x}} = -\infty
\]&lt;p&gt;故此时 \(x \to 0\) 时极限不存在。&lt;/p&gt;
&lt;p&gt;因此可以得到：&lt;/p&gt;
\[
F(x) = \dfrac{1 - \sqrt{1 - 4x}}{2x} \tag{1.3.6}
\]&lt;p&gt;将分子部分单独拿出来考虑，令 \(G(x) = 1 - \sqrt{1 - 4x} = 1 - (1 - 4x)^{\frac{1}{2}}\)，使用牛顿二项式定理展开：&lt;/p&gt;
\[
\begin{aligned}
G(x) &amp;= 1 - \sum\limits_{n \geqslant 0} \dbinom{\frac{1}{2}}{n} (-4x) ^ n \\
&amp;= 1 - \sum\limits_{n \geqslant 0} \frac{\frac{1}{2} ^ {\underline n}}{n!} (-4x) ^ n \\
&amp;= 1 - \sum\limits_{n \geqslant 0} \frac{\frac{1}{2} \times (-\frac{1}{2}) \times (-\frac{3}{2}) \times \cdots \times (-\frac{2n - 3}{2})}{n!} (-4x) ^ n \\
\end{aligned}
\]&lt;p&gt;特别要注意的是 \(\binom{\frac{1}{2}}{0} = \frac{\frac{1}{2}^{0}}{0!} = 1\) 但是用上面那个式子是不正确的，因此需要特别考虑：&lt;/p&gt;
\[
\begin{aligned}
G(x) &amp;= \sum\limits_{n \geqslant 1} (-1) ^ {2n - 1} \frac{(2n - 3)!!}{n!2 ^ n} (4x) ^ n \\
&amp;= \sum\limits_{n \geqslant 1} \frac{(2n - 2)!}{n!(2n - 2)!!2 ^ n} (4x) ^ n \\
&amp;= \sum\limits_{n \geqslant 1} \frac{2(2n - 2)!}{n!(n - 1)!} x ^ n \\
&amp;= \sum\limits_{n \geqslant 1} \frac{\binom{2n - 1}{n}}{2n - 1} 2x ^ n
\end{aligned}
\]&lt;p&gt;带回原式有：&lt;/p&gt;
\[
\begin{aligned}
F(x) &amp;= \frac{\sum\limits_{n \geqslant 1} \frac{\binom{2n - 1}{n}}{2n - 1} 2x ^ n}{2x} \\
&amp;= \sum\limits_{n \geqslant 0} \frac{\binom{2n + 1}{n + 1}}{2n + 1} x ^ n \\
&amp;= \sum\limits_{n \geqslant 0} \frac{\binom{2n}{n}}{n + 1} x ^ n
\end{aligned}
\tag{1.3.9}
\]&lt;p&gt;因此可知 \(a_{n} = \dfrac{\binom{2n}{n}}{n + 1}\)。&lt;/p&gt;
&lt;h3 id="欧拉变换"&gt;欧拉变换&lt;/h3&gt;
&lt;p&gt;考虑求解形如下式的 \(\rm OGF\) ：&lt;/p&gt;
\[
F_i(x) = \left(\sum _ j x ^ {ji}\right) ^ {f _ i} = \left(\frac{1}{1 - x ^ i}\right) ^ {f _ i} \tag{2.3.1}
\]\[
\varepsilon\circ F(x) = \prod _ i F_i(x) = \prod _ i \left(\frac{1}{1 - x ^ i}\right) ^ {f _ i} \tag{2.3.2}
\]&lt;p&gt;这个 \(\rm OGF\) 的组合意义是将 \(n\) 个互不区分的小球分进若干个非空集合，大小为 \(i\) 的集合有 \(f_{i}\) 种方案的总方案数。&lt;/p&gt;
&lt;p&gt;注意到式 \((2.3.2)\) 右边是连乘，于是对其取 \(\ln :\)&lt;/p&gt;
\[
\begin{aligned}
\ln \varepsilon \circ F(x) &amp;= \sum _ i \ln \left(\frac{1}{1 - x ^ i}\right) ^ {f _ i}\\
&amp;= \sum _ i f_i \times \ln\left(\frac{1}{1 - x ^ i}\right)\\
&amp;= -\sum _ i f_i \times \ln (1 - x ^ i)\\
&amp;= \sum _ i \sum _ j \frac{f_i}{j + 1} x ^ {i(j + 1)}
\end{aligned}
\]&lt;p&gt;关于上式中化简 \(\ln (1 - x^{i})\) 的步骤可以参考后文中式 \((2.1.5)\)。&lt;/p&gt;
&lt;p&gt;由于我们一般只需求生成函数的前 \(n\) 项，观察到 \(i\) 和 \(j\) 的枚举构成了调和级数的关系，可以直接暴力计算。&lt;/p&gt;
&lt;p&gt;最后将求出的幂级数 \(\rm exp\) 回去即可得到 \(\varepsilon \circ F(x)\)。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n \log n)\)。&lt;/p&gt;
&lt;h2 id="指数型生成函数"&gt;指数型生成函数&lt;/h2&gt;
&lt;p&gt;序列 \(a\) 的指数型生成函数 \(\rm(Exponential\ Generating\ Function,EGF)\) 被定义为形式幂级数 ：&lt;/p&gt;
\[
\hat{F}(x) = \sum _n a_n \frac{x ^ n}{n!}\tag{2.0.1}
\]&lt;h3 id="两种基本形式-1"&gt;两种基本形式&lt;/h3&gt;
&lt;h4 id="加法与乘法-1"&gt;加法与乘法&lt;/h4&gt;
&lt;p&gt;形式幂级数形式的加减法与 \(\rm OGF\) 基本相同，也是对应系数相加。&lt;/p&gt;
&lt;p&gt;乘法被定义为 ：&lt;/p&gt;
\[
\begin{aligned}
\hat{F}(x)\hat{G}(x) &amp;= \sum _ i a _ i \frac{x ^ i}{i!} \sum _ j b _ j \frac{x ^ j}{j!}\\
&amp;= \sum _ n x ^ n \sum _ {i = 0} ^ n a _ i b _ {n - i} \frac{1}{i!(n - i)!}\\
&amp;= \sum _ n \frac{x ^ n}{n!} \sum _ {i = 0} ^ n\dbinom{n}{i} a _ i b _ {n - i}
\end{aligned}
\]&lt;h4 id="麦克劳林级数"&gt;麦克劳林级数&lt;/h4&gt;
&lt;p&gt;众所周知有泰勒展开 ：&lt;/p&gt;
\[
F(x) = \sum _ n \frac{F^{(n)}(x _ 0)}{n!}(x - x _ 0) ^ n \tag{2.1.2}
\]&lt;p&gt;取 \(x_{0} = 0\) 时的特殊情况可以得到麦克劳林级数 ：&lt;/p&gt;
\[
F(x) = \sum _ n F^{(n)}(0)\frac{x ^ n}{n!} \tag{2.1.3}
\]&lt;p&gt;有 \(\exp(0) = 1\)，故 \(e^{x}\) 的 \(\rm EGF\) 为 ：&lt;/p&gt;
\[
\hat{\exp}(x) = \sum _ n \frac{x ^ n}{n!} \tag{2.1.4}
\]&lt;h4 id="常见幂级数的封闭形式"&gt;常见幂级数的封闭形式&lt;/h4&gt;
\[
\begin{aligned}
e ^ {qx} &amp;= \sum _ n q ^ n \frac{x ^ n}{n!}\\
\frac{e^{x}+e^{-x}}{2}&amp;=\sum_{n}\frac{x^{2 n}}{(2 n) !} \\
\frac{e^{x}-e^{-x}}{2}&amp;=\sum_{n}\frac{x^{2 n+1}}{(2 n+1) !} \\
\ln (1-x)&amp;=-\sum_{n} \frac{x ^ {n + 1}}{n + 1}\\
\ln (1+x)&amp;=\sum_{n}(-1)^{n} \frac{x^{n+1}}{n+1} \\
(1+x)^{\alpha}&amp;=\sum_{n} \alpha^{\underline{n}} \frac{x^{n}}{n !}
\end{aligned}
\]&lt;h3 id="组合意义"&gt;组合意义&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;结论：设 \(\hat{G}(x)\) 表示集合内部分配方案数关于集合大小的 \(\rm EGF\)，\(\hat{F}(x)\) 表示将问题划分成若干个无标号非空子问题，子问题的方案数为 \(\hat{G}(x)\) 的关于问题总规模的方案数的 \(\rm EGF\)。那么有关系式 ：&lt;/strong&gt;&lt;/p&gt;
\[
\hat{F}(x) = \exp \hat{G}(x) \tag{2.2.1}
\]&lt;p&gt;考虑证明上述结论，设 \(f_{i, j}\) 表示将 \(j\) 个&lt;strong&gt;有标号&lt;/strong&gt;小球放进 \(i\) 个&lt;strong&gt;有标号&lt;/strong&gt;盒子中的方案数，\(g_{i}\) 表示集合内有 \(i\) 个元素的方案数，显然有 ：&lt;/p&gt;
\[
f_{i, j} = \sum _{k = 1} ^ {j - i + 1} \dbinom{j}{k} f_{i - 1, j - k} \times g_k
\]&lt;p&gt;考虑到 \(f_{i - 1, j - k}\) 在 \(k \gt j - i + 1\) 时的值为 \(0\)，所以可以将 \(k\) 的枚举上界换成 \(j\)，发现有 ：&lt;/p&gt;
\[
\hat{F}_i(x) = \hat{F}_{i - 1}(x)\hat{G}(x)
\]&lt;p&gt;化简得到并根据 \(\hat{F}_{i}(x)\) 的定义得到 ：&lt;/p&gt;
\[
\hat{F}_i(x) = \sum _ j f_{i, j} \frac{x ^ j}{j!} = \hat{G}^i(x) \tag{2.2.2}
\]&lt;p&gt;于是有 ：&lt;/p&gt;
\[
\begin{aligned}
\exp \hat{G}(x) &amp;= \sum_n \frac{\hat{G}^n(x)}{n!}\\
&amp;= \sum _ n \frac{1}{n!} \sum _ i f_{n, i} \frac{x ^ i}{i!}\\
&amp;= \sum _ i \left(\sum _ n \frac{f _ {n, i}}{n!}\right) \frac{x ^ i}{i!}
\end{aligned}
\]&lt;p&gt;这恰好对应了 \(\hat{F}(x)\) 的定义，于是 \(\hat{F}(x) = \exp \hat{G}(x)\)。&lt;/p&gt;</description></item><item><title>生成函数强化训练</title><link>https://sichen-wang.github.io/blog/%E7%94%9F%E6%88%90%E5%87%BD%E6%95%B0%E5%BC%BA%E5%8C%96%E8%AE%AD%E7%BB%83/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E7%94%9F%E6%88%90%E5%87%BD%E6%95%B0%E5%BC%BA%E5%8C%96%E8%AE%AD%E7%BB%83/</guid><description>&lt;h1 id="heading"&gt;
&lt;/h1&gt;
&lt;p&gt;考虑 \(\rm EGF\) 的组合意义，可以发现若设任意图方案数的 \(\rm EGF\) 为 \(F(x)\)，连通图的 \(\rm EGF\) 为 \(G(x)\)，显然任意图计数可以被看做先将 \(n\) 个点分进若干个非空子集，然后做连通图计数的方案数，那么根据之前的结论，有 ：&lt;/p&gt;
\[
F(x) = \exp G(x) \iff G(x) = \ln F(x)
\]&lt;p&gt;显然有 \(F(x) = \sum_{n} 2^{\binom{n}{2}} x^{n}\)，于是只需直接对其求 \(\ln\) 即可。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n \log n).\)&lt;/p&gt;
&lt;h2 id="code-link"&gt;
&lt;/h2&gt;
&lt;h1 id="heading-1"&gt;
&lt;/h1&gt;
&lt;p&gt;首先可以考虑一个 \(\rm DP\)，设 \(f_{S}\) 表示点权之和为 \(S\) 的二叉树数量，迭代时可以考虑枚举左子树的权值和 \(S_{l}\)，右子树的权值和 \(S_{r}\) 和根节点的权值 \(w\)，那么有 \(f_{S_{l} + S_{r} + w} = \sum_{S_{l}} \sum_{S_{r}} \sum_{w \in C} f_{S_{l}} f_{S_{r}}.\)&lt;/p&gt;
&lt;p&gt;容易发现，这个式子可以用三个多项式的卷积来拟合，设 \(F(x) = \sum_{n} f_{n} x^{n}, G(x) = \sum_{n} [n \in C] x^{n}\)，于是有 ：&lt;/p&gt;
\[
F = F ^ 2 G + 1
\]&lt;p&gt;最后的 \(+1\) 是为了补齐常数项，因为 \(f_{0}\) 为 \(1.\)&lt;/p&gt;
&lt;p&gt;解方程可以得到 ：&lt;/p&gt;
\[
F = \frac{1 \pm \sqrt{1 - 4G}}{2G}
\]&lt;p&gt;由于有两个解，显然不可能都成立，于是考虑 \(x \to 0\) 时的特殊情况。&lt;/p&gt;
&lt;p&gt;当 \(x \to 0\) 时，\(F(x) \to 1,G(x) \to 0.\)&lt;/p&gt;
\[
\lim _ {x \to 0} \frac{1 + \sqrt{1 - 4G}}{2G} = +\infty \not= \lim _ {x \to 0} F
\]\[
\lim _ {x \to 0} \frac{1 - \sqrt{1 - 4G}}{2G} = 1 = \lim _ {x \to 0} F
\]&lt;p&gt;于是选取 \(F= \frac{1 - \sqrt{1 - 4G}}{2G}\) 作为方程的解。&lt;/p&gt;
&lt;p&gt;到这一步，我们发现一个问题，因为 \(G(x)\) 的常数项为 \(0\)，所以 \(G(x)\) 不可以求逆。&lt;/p&gt;
&lt;p&gt;考虑对解做变换，这里选取分子有理化 ：&lt;/p&gt;
\[
F = \frac{\left(1 - \sqrt{1 - 4G}\right)\left(1 + \sqrt{1 - 4G}\right)}{2G\left(1 + \sqrt{1 - 4G}\right)} = \frac{2}{1 + \sqrt{1 - 4G}}
\]&lt;p&gt;可以发现分母的常数项必定不为 \(0\)，于是做多项式开方和多项式求逆即可。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n \log n).\)&lt;/p&gt;
&lt;h2 id="code-link-1"&gt;
&lt;/h2&gt;
&lt;h1 id="heading-2"&gt;
&lt;/h1&gt;
&lt;p&gt;设 \(\{f_{n}\},\{g_{n}\}\) 分别为斐波那契数列和答案序列，\(F(x)\) 和 \(G(x)\) 分别为它们的生成函数。&lt;/p&gt;
&lt;p&gt;显然有斐波那契数列的生成函数 ：&lt;/p&gt;
\[
F(x) = \frac{x}{1 - x - x ^ 2}
\]&lt;p&gt;而对于 \(G(x)\)，可以发现如果 \(g_{i}\) 已经被求出来了，那么给所有的拆分加上一个数 \(n - i\) 即可得到 \(g_{n}\) 的所有拆分，\(g_{i}\) 对 \(g_{n}\) 的贡献为 \(g_{i} \times f_{n - i}.\) 于是有 \(g_{n}\) 的递推式 ：&lt;/p&gt;
\[
g_n = \sum _ {i = 0} ^ {n- 1} g_i \times f_{n - i}
\]&lt;p&gt;将 \(\{g_{n}\}\) 带入 \(G(x)\) 可得 ：&lt;/p&gt;
\[
G(x) = \sum _ n x ^ n \sum _ {i = 0} ^ {n - 1} g_i f_{n - i}
\]&lt;p&gt;可以发现等式右边实际上是卷积的形式，于是有 ：&lt;/p&gt;
\[
G = GF
\]&lt;p&gt;但是我们发现这样的话 \(G(x) = 0\)，原因是 \(g_{0} = 0\)，于是我们强制 \(g_{0} = 1\)，得到 ：&lt;/p&gt;
\[
G = GF + 1
\]\[
G(x) = \frac{1}{1 - F(x)} = 1 + \frac{x}{1 - 2x - x ^ 2}
\]&lt;p&gt;可以发现现在求出的 \(G(x)\) 比实际值多了 \(1\)，因为我们将 \(g_{0} = 0\) 强制变成了 \(g_{0} = 1\)，修正后有 ：&lt;/p&gt;
\[
G(x) = \frac{x}{1 - 2x - x ^ 2} = \frac{\frac{\sqrt{2}}{4}}{1 - (1 + \sqrt{2})x} + \frac{-\frac{\sqrt{2}}{4}}{1 - (1 - \sqrt{2})x}
\]\[
[x ^ n]G(x) = \frac{\sqrt{2}}{4}(1 + \sqrt{2}) ^ n - \frac{\sqrt{2}}{4}(1 - \sqrt{2}) ^ n
\]&lt;p&gt;最后求出 \(\sqrt{2}\) 在模 \(10^{9} + 7\) 意义下的二次剩余，并且用拓展欧拉定理即可计算出答案。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(\log n).\)&lt;/p&gt;
&lt;h2 id="code-link-2"&gt;
&lt;/h2&gt;
&lt;h1 id="heading-3"&gt;
&lt;/h1&gt;
&lt;p&gt;首先考虑二项式反演 ：&lt;/p&gt;
&lt;p&gt;设 \(f_{i}\) 表示恰好有 \(i\) 个数的数量为 \(S\) 的方案数，\(g_{i}\) 表示钦点 \(i\) 个数的数量为 \(S\) 的方案数，显然有 ：&lt;/p&gt;
\[
g_k = \dbinom{m}{k} \times \frac{n ^ {\underline{kS}}}{(S!) ^ k} \times (m - k) ^ {n - kS}
\]\[
g_k = \sum_{i = k} ^ m \dbinom{i}{k} f_i \iff f_k = \sum _ {i = k} ^ m (-1) ^ {i - k} \dbinom{i}{k} g_i
\]\[
Ans = \sum _ {i = 0} ^ m w_if_i
\]&lt;p&gt;于是我们考虑如何对于每个 \(i \in [0, m]\) 求出 \(f_{i}\)，这里有个技巧 ：&lt;/p&gt;
\[
\begin{aligned}
f_k &amp;= \sum _ {i = k} ^ m (-1) ^ {i - k} \frac{i!}{k!(i - k)!} g_i\\
&amp;= k! \sum _ {i = k} ^ m i! g_i \times \frac{(-1) ^ {i - k}}{(i - k)!}
\end{aligned}
\]&lt;p&gt;容易发现上式可以用差值卷积计算，时间复杂度 \(\Theta(n \log n).\)&lt;/p&gt;
&lt;h1 id="付公主的背包"&gt;
&lt;/h1&gt;
&lt;p&gt;容易发现若设每种大小的物品的数量为 \(f_{i}\)，那么答案的生成函数为 ：&lt;/p&gt;
\[
\prod _ i \left (\sum _ j x ^ {ji}\right) ^ {f _ i} = \prod _ i \left(\frac{1}{1 - x ^ i}\right) ^ {f _ i}
\]&lt;p&gt;可以直接使用欧拉变换的求解方式。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n \log n).\)&lt;/p&gt;
&lt;h1 id="无标号无根树计数"&gt;
&lt;/h1&gt;
&lt;p&gt;考虑设 \(f_{n}\) 表示大小为 \(n\) 的无标号有根树的方案数，\(F(x)\) 为数列 \(f\) 的生成函数。&lt;/p&gt;
&lt;p&gt;可以发现，如果将一颗大小为 \(n\) 的无标号有根树的根去除，那么剩下的子树是一个个相同的子问题，只要子树大小的和为 \(n - 1\)，再加上根结点就可以唯一确定地拼出一颗无标号有根树。于是有生成函数方程 ：&lt;/p&gt;
\[
F(x) = x \cdot \varepsilon \circ F(x)
\]&lt;p&gt;求解这个生成函数方程有两种方法，第一种是直接化简，分治多项式乘法求解 ：&lt;/p&gt;
\[
F(x) = x \prod _ i (1 - x ^ i) ^ {-f_i}
\]&lt;p&gt;考虑对两边取 \(\ln\)，将连乘转连加 ：&lt;/p&gt;
\[
\ln F(x) = \ln x - \sum _ i f_i \ln (1 - x ^ i)
\]&lt;p&gt;对数不好处理，考虑求导 ：&lt;/p&gt;
\[
\frac{F'(x)}{F(x)} = \frac{1}{x} + \sum _ i if_i \times \frac{x ^ {i - 1}}{1 - x ^ i}
\]&lt;p&gt;将两边同时乘以 \(xF(x)\) ：&lt;/p&gt;
\[
xF'(x) = F(x) + F(x) \sum _ i if_i \frac{x ^ i}{1 - x ^ i}
\]&lt;p&gt;考虑将右半部分还原成 \(F(x)\) 表示 ：&lt;/p&gt;
\[
xF'(x) = F(x) + F(x)\left(\sum _ {i \geqslant 1} x ^ i F'(x ^ i)\right)
\]&lt;p&gt;设 \(G(x) = \sum_{k} x^{k} F'(x^{k})\)，简单推一推 ：&lt;/p&gt;
\[
G(x) = \sum _ k x ^ k \sum _ {i\geqslant 1} if _ i \left(x ^ {k}\right) ^ {i - 1} = \sum _ k \sum _ i i f _ i x ^ {ik} = \sum _ n x ^ n \sum _ {d | n} d f _ d
\]&lt;p&gt;故 \(g_{n} = \sum_{d | n} df_{d},g_{1} = f_{1} = 1.\)&lt;/p&gt;
&lt;p&gt;因此 ：&lt;/p&gt;
\[
f_n = \frac{1}{n - 1} \sum _ {k = 1} ^ {n - 1} f _ k g _ {n - k}
\]&lt;p&gt;\(f\) 使用分治多项式乘法求解，\(g\) 暴力求解即可做到 \(\Theta(n \log^{2} n).\)&lt;/p&gt;
&lt;p&gt;另一种方法是使用牛顿迭代 ：&lt;/p&gt;
&lt;p&gt;显然我们要求解方程 \(G \circ F(x) = F(x) - x \cdot \varepsilon \circ F(x) = 0\).&lt;/p&gt;
&lt;p&gt;假设当前已经求出了方程在模 \(x^{n}\) 意义下的解 \(F_{0}(x)\)，设方程在模 \(x^{2n}\) 意义下的解为 \(F(x)\)，众所周知有 ：&lt;/p&gt;
\[
F(x) = F_0(x) - \frac{G \circ F_0(x)}{G' \circ F_0(x)}
\]&lt;p&gt;我们知道，\(\varepsilon \circ F(x)\) 可以在 \(\Theta(n \log n)\) 的时间复杂度内求出，\(F'(x)\) 可以 \(\Theta(n)\) 求，所以可以在 \(\Theta(n \log n)\) 的时间复杂度内求下式 ：&lt;/p&gt;
\[
F(x) = F_0(x) - \frac{F_0(x) - x \cdot \varepsilon \circ F_0(x)}{[F_0(x) - x \cdot \varepsilon \circ F_0(x)]'}
\]&lt;p&gt;用上式迭代即可算出 \(F(x)\)，时间复杂度 \(\Theta(n \log n).\)&lt;/p&gt;
&lt;p&gt;现在我们已经求出了无标号有根树的方案数，考虑将无标号无根树的方案数容斥出来。&lt;/p&gt;
&lt;p&gt;考虑钦点无标号无根树的根是它的重心，于是只需要去掉根不是重心的无标号有根树的方案数可以了，分类讨论 ：&lt;/p&gt;
&lt;p&gt;如果重心唯一，那么一定存在一颗子树的大小大于 \(\left\lfloor\frac{n}{2}\right\rfloor\)，考虑枚举它的大小 \(i\)，容易发现这颗子树的方案数和将它切除后树的方案数都是无标号有根树计数问题，其答案我们已经算出，于是总方案数需要减去 \(\sum_{i = \left\lfloor\frac{n}{2}\right\rfloor + 1}^{n - 1} f_{i} \times f_{n - i}.\)&lt;/p&gt;
&lt;p&gt;如果重心不唯一，那么一棵树还会在两个重心上分别被计算，这种方案只会在 \(n\) 为偶数的情况下出现。考虑到这两个重心一定相连，于是将它们之间的连边断开后形成的两个子树的方案数是独立的。但是我们发现，当两颗子树完全相同时，分别以它的两个重心为根时形成的有根树是同构的，所以我们还是只会将它计算一次，故算重的方案中不包括两颗子树相同的情况，于是总方案数还需要减去 \(\binom{f_{\frac{n}{2}}}{2}.\)&lt;/p&gt;
&lt;p&gt;综上，问题得到解决，时间复杂度为 \(\Theta(n \log^{2} n)\) 或 \(\Theta(n \log n).\)&lt;/p&gt;
&lt;h1 id="heading-4"&gt;
&lt;/h1&gt;
&lt;p&gt;考虑构造 \(F_{i}(x) = \sum_{j = 0}^{m_{i}} x^{j}\)，容易发现题目要求的就是 \(\prod_{i = 1}^{n} F_{i}(x)\) 的系数前缀和。&lt;/p&gt;
&lt;p&gt;于是再构造 \(F_{0}(x) = \sum_{i} x^{i}\)，将它和原本的 \(n\) 个幂级数卷在一起，现在考虑求 \(F(x) = \prod_{i = 0}^{n} F_{i}(x)\) 的第 \(L\) 项系数。&lt;/p&gt;
&lt;p&gt;容易发现有 ：&lt;/p&gt;
\[
F(x) = \frac{(1 - x ^ {m_1 + 1})(1 - x ^ {m_2 + 1})\cdots(1 - x ^ {m_n + 1})}{(1 - x) ^ {n + 1}}
\]&lt;p&gt;观察到 \(n\) 很小，考虑暴力将分子拆开，于是分式变成了 \(2^{n}\) 个形如 \(\frac{x^{k}}{(1 - x)^{n + 1}}\) 的部分之和。&lt;/p&gt;
&lt;p&gt;容易发现 ：&lt;/p&gt;
\[
[x ^ L]\frac{x ^ k}{(1 - x) ^ {n + 1}} = \dbinom{n + L - k}{n}
\]&lt;p&gt;于是只需要求 \(2^{n + 1}\) 次形如 \(\binom{t}{n}\) 的组合数即可。&lt;/p&gt;
&lt;p&gt;到这里我们又发现模数 \(p\) 不是质数，于是考虑将式子变形 ：&lt;/p&gt;
\[
\dbinom{t}{n}~\bmod~p = \frac{t^{\underline{n}}}{n!}~\bmod~p = \frac{t ^ {\underline{n}}~\bmod~n!\cdot p}{n!}~\bmod~p
\]&lt;p&gt;于是这样就可以 \(\Theta(n)\) 求解组合数了，总时间复杂度 \(\Theta(2^{n} n).\)&lt;/p&gt;
&lt;h1 id="heading-5"&gt;
&lt;/h1&gt;
&lt;p&gt;简化题意 ：求有多少个从 \(\{1,2,\cdots,n\}\) 到 \(\{1,2,\cdots,n\}\) 的映射 \(f\)，满足 ：&lt;/p&gt;
\[
\underbrace{f \circ f \circ \cdots \circ f}_{k}=\underbrace{f \circ f \circ \cdots \circ f}_{k-1}
\]&lt;p&gt;保证 \(nk \leqslant 2 \times 10^{6},1\leqslant k \leqslant 3.\)&lt;/p&gt;
&lt;p&gt;可以发现这题本质上就是在求深度不超过 \(k\)，环大小为 \(1\) 的基环内向树森林的数量，进一步发现其等价于树高不超过 \(k\) 的有标号有根树森林的数量。&lt;/p&gt;
&lt;p&gt;考虑设树高不超过 \(k\) 的有标号有根树数量的 \(\rm EGF\) 为 \(\hat{F}_{k}(x).\) 计算考虑递推，深度不超过 \(k\) 的树可以看作若干棵深度不超过 \(k - 1\) 的树全部接在一个点上，于是有 ：&lt;/p&gt;
\[
\hat{F}_k(x) = x\cdot \exp \hat{F}_{k - 1}(x)
\]&lt;p&gt;考虑到需要求的是森林的数量，于是答案的指数型生成函数为 \(\exp \hat{F}_{k}(x).\)&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(kn\log n).\)&lt;/p&gt;
&lt;h1 id="heading-6"&gt;
&lt;/h1&gt;
&lt;p&gt;考虑一次对 \(x\) 的操作造成的影响，他会使 \(a_{x}\) 减少 \(1\)，答案增加 \(\prod_{i \not= x} a_{i}\)，\(\prod_{i} a_{i}\) 减少 \(\prod_{i \not= x} a_{i}.\)&lt;/p&gt;
&lt;p&gt;于是我们可以发现，一次操作对答案的贡献等于 \(\prod_{i} a_{i}\) 的变化量。进一步的，最终答案等于 \(k\) 次操作进行完后 \(\prod_{i} a_{i}\) 的变化量。假设第 \(a_{i}\) 被操作了 \(b_{i}\) 次，那么答案为 \(\prod_{i} a_{i} - \prod_{i} (a_{i} - b_{i}).\)&lt;/p&gt;
&lt;p&gt;考虑计算所有情况下 \(\prod_{i} (a_{i} - b_{i})\) 的和，最后再将答案除以 \(n^{k}.\)&lt;/p&gt;
&lt;p&gt;假设有两个集合 \(S,T,S \cap T = \varnothing\)，\(f_{i}\) 表示 \(\sum b_{k} = i,k\in S\) 对答案的贡献，\(g_{i}\) 表示 \(\sum b_{k} = i,k\in T\) 对答案的贡献，\(h_{i}\) 表示 \(\sum b_{k} = i,k\in S \cup T\) 对答案的贡献，那么显然有 ：&lt;/p&gt;
\[
g_n = \sum _ {i = 0} ^ n \dbinom{n}{i} f_i \times g_{n - i}
\]&lt;p&gt;因为 \(f_{i}\) 和 \(g_{n - i}\) 联合起来的贡献是它们的乘积，并且由于操作有序，所以将 \(n\) 次操作分配到它们还导致要乘上 \(\binom{n}{i}\) 的方案数。&lt;/p&gt;
&lt;p&gt;很明显，这个式子可以用 \(\rm EGF\) 来拟合，设 \(\hat{F}_{i}(x) = \sum_{j} (a_{i} - j) \frac{x^{j}}{j!}\)，那么答案的生成函数为 ：&lt;/p&gt;
\[
\begin{aligned}
\hat{F}(x) &amp;= \prod _ i F_i(x)\\
&amp;= \prod _ i \left( \sum _ j (a_i - j) \frac{x ^ j}{j!} \right)\\
&amp;= \prod _ i \left( a_i \sum _ j \frac{x ^ j}{j!} - \sum _ {j} \frac{x ^ {j + 1}}{j!} \right)\\
&amp;= \prod _ i (a_i - x)e ^ x\\
&amp;= e ^ {nx} \prod _ i (a_i - x)
\end{aligned}
\]&lt;p&gt;\(\prod_{i} (a_{i} - x)\) 直接分治乘可以做到 \(\Theta(n \log^{2} n)\)，\(e^{nx}\) 的系数可以直接求，由于 \(\prod_{i} (a_{i} - x)\) 的最高次数为 \(n\)，所以直接枚举计算即可。&lt;/p&gt;
&lt;p&gt;总时间复杂度 \(\Theta(n \log^{2} n).\)&lt;/p&gt;</description></item><item><title>简单的代数反演</title><link>https://sichen-wang.github.io/blog/%E7%AE%80%E5%8D%95%E7%9A%84%E4%BB%A3%E6%95%B0%E5%8F%8D%E6%BC%94/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E7%AE%80%E5%8D%95%E7%9A%84%E4%BB%A3%E6%95%B0%E5%8F%8D%E6%BC%94/</guid><description>&lt;h2 id="二项式反演"&gt;二项式反演&lt;/h2&gt;
&lt;h3 id="数列形式"&gt;数列形式&lt;/h3&gt;
\[
g(x)=\sum_{i=x}^n\dbinom{i}{x}f(i)\iff f(x)=\sum_{i=x}^n (-1)^{i-x}\dbinom{i}{x}g(i)
\]&lt;p&gt;\(\large\rm Proof:\)&lt;/p&gt;
&lt;p&gt;将上式带入下式得 \(:\)&lt;/p&gt;
\[
f(x)=\sum_{i=x}^n (-1)^{i-x}\dbinom{i}{x}\sum_{j=i}^n\dbinom{j}{i}f(j)
\]&lt;p&gt;整理得 \(:\)&lt;/p&gt;
\[
f(x)=\sum_{i=x}^n\sum_{j=i}^n(-1)^{i-x}\dbinom{j}{i}\dbinom{i}{x}f(j)
\]&lt;p&gt;根据组合恒等式 \(\dbinom{i}{j}\dbinom{j}{k}=\dbinom{i}{k}\dbinom{i-k}{j-k}\) 得 \(:\)&lt;/p&gt;
\[
f(x)=\sum_{i=x}^n\sum_{j=i}^n(-1)^{i-x}\dbinom{j}{x}\dbinom{j-x}{i-x}f(j)
\]&lt;p&gt;交换枚举顺序得 \(:\)&lt;/p&gt;
\[
f(x)=\sum_{j=x}^n\sum_{i=x}^j(-1)^{i-x}\dbinom{j}{x}\dbinom{j-x}{i-x}f(j)
\]&lt;p&gt;改变代表字母，整理得 \(:\)&lt;/p&gt;
\[
f(x)=\sum_{i=x}^n\dbinom{i}{x}f(i)\sum_{j=x}^i(-1)^{j-x}\dbinom{i-x}{j-x}
\]&lt;p&gt;将靠后的 \(\sum\) 枚举的 \(j\) 替换成 \(j+x\) 得 \(:\)&lt;/p&gt;
\[
f(x)=\sum_{i=x}^n\dbinom{i}{x}f(i)\sum_{j=0}^{i-x}(-1)^{j}\dbinom{i-x}{j}
\]\[
\because \sum_{i=0}^k(-1)^i\dbinom{k}{i}=(1-1)^k
\]\[
\therefore \sum_{i=0}^k(-1)^i\dbinom{k}{i}=[k=0]
\]&lt;p&gt;所以此式不为 \(0\) 当且仅当 \(i=x\)，故 \(:\)&lt;/p&gt;
\[
f(x)=\sum_{i=x}\dbinom{x}{x}f(i)=f(x)
\]&lt;p&gt;原式得证。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;我们来看看二项式反演的数列形式有什么应用：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;乱序排列问题：&lt;/strong&gt; 求有多少种不同的长度为 \(n\) 的排列 \(p\)，使得 \(\forall i\in [1,n],p_{i}\not = i\)。&lt;/p&gt;
&lt;p&gt;令 \(g(i)\) 表示钦定有 \(i\) 个数一定在自己的位置上，剩下的随便排的方案数，显然有 :&lt;/p&gt;
\[
g(i)=\dbinom{n}{i}(n-i)!
\]&lt;p&gt;令 \(f(i)\) 表示恰好有 \(i\) 个数在自己的位置上的方案数，考虑到 \(f(i)\) 会被 \(g(j)\ (j\leqslant i)\) 计算 \(\dbinom{i}{j}\) 次，于是有 \(:\)&lt;/p&gt;
\[
g(i)=\sum_{j=i}^n\dbinom{j}{i}f(j)
\]&lt;p&gt;根据二项式反演 \(:\)&lt;/p&gt;
\[
f(i)=\sum_{j=i}^n(-1)^{j-i}\dbinom{j}{i}g(j)
\]&lt;p&gt;将 \(g(i)=\dbinom{n}{i}(n-i)!\) 带入得 \(:\)&lt;/p&gt;
\[
f(i)=\sum_{j=i}^n(-1)^{j-i}\dbinom{j}{i}\dbinom{n}{j}(n-j)!
\]&lt;p&gt;根据组合恒等式 \(\dbinom{i}{j}\dbinom{j}{k}=\dbinom{i}{k}\dbinom{i-k}{j-k}\)，整理得 \(:\)&lt;/p&gt;
\[
f(i)=\dbinom{n}{i}\sum_{j=i}^n(-1)^{j-i}\dbinom{n-i}{j-i}(n-j)!
\]&lt;p&gt;考虑到当 \(i=0\) 时为答案，所以 \(:\)&lt;/p&gt;
\[
\begin{aligned}
Ans=f(0)&amp;=\sum_{i=0}^n(-1)^i\dbinom{n}{i}(n-i)!\\
&amp;=\sum_{i=0}^n(-1)^i\dfrac{n!}{i!}\\
&amp;=(n+1)!\sum_{i=0}^n(-1)^i(i!)^{-1}
\end{aligned}
\]&lt;h3 id="集合形式"&gt;集合形式&lt;/h3&gt;
\[
f(S)=\sum_{S\subseteq T}g(T)\iff g(S)=\sum_{S\subseteq T} (-1)^{|T|-|S|}f(T)
\]&lt;p&gt;\(\large\rm Proof:\)&lt;/p&gt;
&lt;p&gt;同样考虑带入证明 ：&lt;/p&gt;
\[
\begin{aligned}
f(S)&amp;=\sum_{S\subseteq T}\sum_{T\subseteq R}(-1)^{|R|-|T|}f(R)\\
&amp;=\sum_{S\subseteq R}f(R)\sum_{S\subseteq T\subseteq R}(-1)^{|R|-|T|}
\end{aligned}
\]&lt;p&gt;考虑枚举 \(T-S\) 的大小 ：&lt;/p&gt;
\[
\begin{aligned}
f(S)&amp;=\sum_{S\subseteq R}f(R)\sum_{i=0}^{|R|-|S|}\dbinom{|R|-|S|}{i}(-1)^{|R|-(|S|+i)}\\
&amp;=\sum_{S\subseteq R}[|S|=|R|]\\
&amp;=f(S)
\end{aligned}
\]&lt;p&gt;原式得证。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;我们来看看二项式反演的集合形式有什么应用：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;有向图无环子图计数：&lt;/strong&gt; 给定一张 \(n\) 个点的有向图，求其无环子图的数量。&lt;/p&gt;
&lt;p&gt;考虑动态规划，设 \(f_{S}\) 表示点集 \(S\) 导出子图的答案。&lt;/p&gt;
&lt;p&gt;由于是 \(\rm DAG\) 计数，所以我们可以很自然地想到枚举入度为 \(0\) 的点，假设 \(T\) 是 \(S\) 的子集，并且其中的每个点都没有入边，那么显然有转移 ：&lt;/p&gt;
\[
f_S=\sum_{T\subseteq S,T\not = \varnothing}2^{cnt_{T,S-T}}\times f_{S-T}
\]&lt;p&gt;其中 \(cnt_{S,T}\) 表示集合 \(S\) 到集合 \(T\) 的连边总数。&lt;/p&gt;
&lt;p&gt;但我们发现这样做实际上是错的，因为 \(T\) 不一定包含了 \(S\) 中所有入度为 \(0\) 的点，我们考虑容斥。&lt;/p&gt;
&lt;p&gt;设 \(q_{T}=2^{cnt_{T,S-T}}\times f_{S-T}\)，\(p_{T}\) 表示 \(S\) 中恰好有 \(T\) 作为入度为 \(0\) 的点的方案数，有 \(q_{T}=\sum\limits_{T\subseteq S} p_{S}\)。&lt;/p&gt;
&lt;p&gt;由二项式反演的集合形式可以得到 ：&lt;/p&gt;
\[
p_S=\sum_{S\subseteq T}(-1)^{|T|-|S|}q_T
\]&lt;p&gt;回到原本的 \(\rm DP\)，我们需要求 ：&lt;/p&gt;
\[
\begin{aligned}
f_S&amp;=\sum_{T\subseteq S,T\not= \varnothing}p_T\\
&amp;=\sum_{T\subseteq S,T\not= \varnothing}\sum_{T\subseteq R\subseteq S}(-1)^{|R|-|T|}q_R\\
&amp;=\sum_{R\subseteq S,R\not= \varnothing}q_R \sum_{T\subseteq R,T\not=\varnothing}(-1)^{|R|-|T|}\\
&amp;=\sum_{R\subseteq S,R\not= \varnothing}q_R (-1)^{|R|}\left(\sum_{T\subseteq R}(-1)^{-|T|}-1\right)\\
&amp;=\sum_{T\subseteq S,T\not= \varnothing}(-1)^{|T|-1}q_T
\end{aligned}
\]&lt;p&gt;于是转移方程为 ：&lt;/p&gt;
\[
f_S=\sum_{T\subseteq S,T\not= \varnothing}(-1)^{|T|-1}2^{cnt_{T,S-T}}f_{S-T}
\]&lt;p&gt;现在只需要 \(\Theta(1)\) 计算 \(cnt_{T,S-T}\) 即可做到 \(\Theta(3^{n})\) 计算计算答案，考虑预处理。&lt;/p&gt;
&lt;p&gt;可以在枚举了每个 \(S\) 做转移的时候再算这个东西，此时只需要记 \(cnt_{T}\ (T\subseteq S,T\not=\varnothing)\) 表示 \(T\) 恰好作为 \(S\) 中没有入度的点集的路径数。考虑在进行所有计算之前预处理 \(A_{i,S}\) 表示 \(i\) 到 \(S\) 中的边数，\(D_{i,S}\) 表示 \(S\) 中的点到 \(i\) 的边数和，这两个数组都可以 \(\Theta(n2^{n})\) 预处理。&lt;/p&gt;
&lt;p&gt;计算 \(cnt\) 时考虑从小到大枚举每个 \(T\) 计算答案，可以发现 \(T\) 的每个真子集的答案都已经被计算出来了，于是任取一个点从 \(T\) 中移到 \(S-T\) 即可算出答案，这里考虑 \(\Theta(1)\) 枚举 &lt;code&gt;lowbit&lt;/code&gt;. 可以发现，转移式为 ：&lt;/p&gt;
\[
cnt_T=cnt_{T-\{u\}}+A_{u,S-T}-D_{T-\{u\},u}
\]&lt;p&gt;于是本题到此，可以做到时间复杂度 \(\Theta(3^{n})\)，空间复杂度 \(\Theta(n2^{n})\)。&lt;/p&gt;
&lt;h3 id="子集反演"&gt;子集反演&lt;/h3&gt;
\[
f(S)=\sum_{T\subseteq S}g(T)\iff g(S)=\sum_{T\subseteq S}(-1)^{|S|-|T|}f(T)
\]&lt;p&gt;\(\large\rm Proof:\)&lt;/p&gt;
&lt;p&gt;还是考虑带入证明，与二项式反演的集合形式类似 \(:\)&lt;/p&gt;
\[
\begin{aligned}
f(S)&amp;=\sum_{T\subseteq S}\sum_{R\subseteq T}(-1)^{|T|-|R|}f(R)\\
&amp;=\sum_{R\subseteq S}f(R)\sum_{R\subseteq T\subseteq S}(-1)^{|T|-|R|}\\
&amp;=\sum_{R\subseteq S}f(R)\sum_{i=0}^{|S|-|R|}\dbinom{|S|-|R|}{i}(-1)^{(|S|-i)-|R|}\\
&amp;=\sum_{R\subseteq S}[|R|=|S|]\\
&amp;=f(S)
\end{aligned}
\]&lt;p&gt;原式得证。&lt;/p&gt;
&lt;h2 id="斯特林反演"&gt;斯特林反演&lt;/h2&gt;
&lt;h3 id="第二类斯特林数"&gt;第二类斯特林数&lt;/h3&gt;
&lt;h4 id="定义"&gt;定义&lt;/h4&gt;
&lt;p&gt;定义 \(\begin{Bmatrix}n \ m\end{Bmatrix}\) 为将 \(n\) 个有标号小球放入 \(m\) 个无标号盒子，每个盒子不能为空的方案。&lt;/p&gt;
&lt;h4 id="递推式"&gt;递推式&lt;/h4&gt;
\[
\begin{Bmatrix}n \ m\end{Bmatrix} = \begin{Bmatrix}n - 1 \ m - 1\end{Bmatrix} + m \times \begin{Bmatrix}n - 1 \ m\end{Bmatrix}
\]&lt;p&gt;根据组合意义不难证明。&lt;/p&gt;
&lt;h4 id="求一行第二类斯特林数"&gt;求一行第二类斯特林数&lt;/h4&gt;
&lt;p&gt;考虑以下第二类斯特林数的组合意义，我们考虑使用容斥描述第二类斯特林数的答案。&lt;/p&gt;
&lt;p&gt;首先我们求出将 \(n\) 个有标号小球放入 \(m\) 个有标号盒子，盒子不能为空的方案，根据这个问题的特殊性，任意一种无标号盒子的方案恰好双向对应 \(m!\) 中有标号盒子的方案，最后除 \(m!\) 即可。&lt;/p&gt;
&lt;p&gt;对于盒子是否为空进行容斥：&lt;/p&gt;
\[
\begin{Bmatrix}n \ m\end{Bmatrix} = \frac{1}{m!} \sum\limits_i ^ m (-1) ^ i \dbinom{m}{i}(m - i) ^ n
\]&lt;p&gt;显然是一个卷积的形式，\(\rm NTT\) 即可做到 \(\mathcal{O(n \log n)}\)。&lt;/p&gt;
&lt;h4 id="求一列第二类斯特林数"&gt;求一列第二类斯特林数&lt;/h4&gt;
&lt;p&gt;不难发现第二类斯特林数的定义与 \(\exp\) 的组合意义很相似，于是我们考虑 \(\rm EGF:\) \(\widehat F(x) = \sum\limits_{i = 1}^{\infty} \frac{x^{i}}{i!} = e^{x} - 1\)。&lt;/p&gt;
&lt;p&gt;那么根据 \(\rm EGF\) 相乘的组合意义，\([\dfrac{x^{n}}{n!}]\widehat F^{m}(x) = [\dfrac{x^{n}}{n!}](e^{x} - 1)^{m} = \begin{Bmatrix}n \ m\end{Bmatrix}\)。&lt;/p&gt;
&lt;p&gt;使用多项式快速幂即可做到 \(\mathcal{O(n \log n)}\)。&lt;/p&gt;
&lt;h3 id="第一类斯特林数"&gt;第一类斯特林数&lt;/h3&gt;
&lt;h4 id="定义-1"&gt;定义&lt;/h4&gt;
&lt;p&gt;定义 \(\begin{bmatrix}n \ m\end{bmatrix}\) 为将 \(n\) 个数划分成 \(m\) 个互不区分的非空置换的方案数。&lt;/p&gt;
&lt;h4 id="递推式-1"&gt;递推式&lt;/h4&gt;
\[
\begin{bmatrix}n \ m\end{bmatrix} = \begin{bmatrix}n - 1 \ m - 1\end{bmatrix} + (n - 1) \times \begin{bmatrix}n - 1 \ m\end{bmatrix}
\]&lt;p&gt;由组合意义不难证明。&lt;/p&gt;
&lt;h4 id="求一行第一类斯特林数"&gt;求一行第一类斯特林数&lt;/h4&gt;
&lt;p&gt;因为第一类斯特林数不具有较好的组合意义，因此不能像第二类斯特林数那样使用另一种方式来描述其，因此我们直接考虑第一类斯特林数的 \(\rm OGF\)：&lt;/p&gt;
\[
\begin{aligned}
F_i(x) &amp;= \sum\limits_j ^ \infty \begin{bmatrix}i \ j\end{bmatrix} x ^ j \\
&amp;= x \times F_{i - 1}(x) + (i - 1) F_{i - 1}(x) \\
&amp;= (i + x - 1) F_{i - 1}(x) \\
&amp;= \prod\limits_j ^ {i - 1} (x + j)
\end{aligned}
\]&lt;p&gt;那么就有：&lt;/p&gt;
\[
F_n(x) = \prod\limits_i ^ {n - 1} (x + i)
\]&lt;p&gt;当然可以直接使用启发式合并做到 \(\mathcal{O(n \log^{2n})}\)，但还存在一个更加优秀的方法：倍增法。&lt;/p&gt;
\[
F_{2n}(x) = F_n(x) \times F_n(x + n)
\]&lt;p&gt;只需快速计算 \(F_{n}(x + n)\) 即可，令 \(F_{n}(x) = \sum\limits_{i}^{\infty} f_{i} x^{i}\)：&lt;/p&gt;
\[
\begin{aligned}
F_n(x + n) &amp;= \sum\limits_i ^ n f_i(x + n) ^ i \\
&amp;= \sum\limits_i ^ n f_i\sum\limits_j ^ i x ^ j n ^ {i - j}
\end{aligned}
\]&lt;p&gt;后者很明显是一个卷积的形式，直接计算即可，根据倍增的复杂度，可以做到 \(\mathcal{O(n \log n)}\)。&lt;/p&gt;
&lt;h4 id="求一列第一类斯特林数"&gt;求一列第一类斯特林数&lt;/h4&gt;
&lt;p&gt;类似于求一列第二类斯特林数的方法，考虑 \(\rm EGF:\) \(\widehat F(x) = \sum\limits_{i}^{\infty} \dfrac{(i - 1)!x^{i}}{i!} = \sum\limits_{i}^{\infty} \dfrac{x^{i}}{i} = \ln\left(\dfrac{1}{1 - x}\right)\)&lt;/p&gt;
&lt;p&gt;那么就有：&lt;/p&gt;
\[
\begin{bmatrix}n \ m\end{bmatrix} = [\frac{x ^ n}{n!}]\widehat F ^ m(x)
\]&lt;p&gt;使用多项式快速幂即可，复杂度 \(\mathcal{O(n \log n)}\)。&lt;/p&gt;
&lt;h3 id="普通幂-上升幂-下降幂的转换"&gt;普通幂, 上升幂, 下降幂的转换&lt;/h3&gt;
&lt;p&gt;先介绍两个最简单的：上升幂和下降幂的转换：&lt;/p&gt;
\[
x ^ {\underline{n}} = (-1) ^ n (-x) ^ {\overline n}
\]\[
x ^ {\overline{n}} = (-1) ^ n (-x) ^ {\underline n}
\]&lt;p&gt;再根据我们求一行斯特林数的方法，可以得到上升幂转普通幂公式：&lt;/p&gt;
\[
x ^ {\overline n} = \sum\limits_i ^ n \begin{bmatrix} n \ i \end{bmatrix} x ^ i
\]&lt;p&gt;而根据第二类斯特林数的组合意义，再根据普通幂 \(x^{n}\) 的组合意义，可以得到普通幂转下降幂公式：&lt;/p&gt;
\[
x ^ n = \sum\limits_i ^ x \dbinom{x}{i} \begin{Bmatrix} n \ i \end{Bmatrix} i! = \sum\limits_i ^ x \begin{Bmatrix} n \ i \end{Bmatrix} x ^ {\underline{i}}
\]&lt;p&gt;再利用最开始提到的下降幂转上升幂公式变形，我们可以得到普通幂转上升降幂公式：&lt;/p&gt;
\[
\begin{aligned}
(-x) ^ n &amp;= \sum\limits_i ^ x \begin{Bmatrix} n \ i \end{Bmatrix} (-x) ^ {\underline{i}} \\
&amp;= \sum\limits_i ^ x \begin{Bmatrix} n \ i \end{Bmatrix} (-1) ^ i x ^ {\overline{i}}
\end{aligned}
\]\[
\Longleftrightarrow x ^ n = \sum\limits_i ^ x (-1) ^ {n - i}\begin{Bmatrix} n \ i \end{Bmatrix}x ^ {\overline{i}}
\]&lt;p&gt;同理可得下降幂转普通幂公式：&lt;/p&gt;
\[
x ^ {\underline{n}} = \sum\limits_i ^ x (-1) ^ {n - i} \begin{bmatrix} n \ i \end{bmatrix} x ^ i
\]&lt;p&gt;总结一下四个公式，普通幂转出去使用第二类斯特林数，转回来使用第一类斯特林数。阶数上升（下转普，普转上）加 \(-1\)。&lt;/p&gt;
&lt;p&gt;通过这四个公式，我们也能完成一般多项式和上升幂下降幂多项式的互相转化。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;我们来看看这几个式子有什么应用：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;例题：&lt;/strong&gt; 给定 \(k\) 次多项式 \(f(x)\) 的各项系数和一个整数 \(n\)，求以下式子对 \(998244353\) 取模后的值 ：&lt;/p&gt;
\[
\sum_{i=0}^n\dbinom{n}{i}2^{n-i}f(i)
\]&lt;p&gt;我们发现带 \(f(x)\) 的式子没有前途，于是将其拆开 ：&lt;/p&gt;
\[
\sum_{i=0}^n\dbinom{n}{i}2^{n-i}\sum_{j=0}^ka_ji^j
\]&lt;p&gt;这里有个套路是将整数幂转第二类斯特林数 ：&lt;/p&gt;
\[
\begin{aligned}
m^n&amp;=\sum_{k=0}^m\dbinom{m}{k}\begin{Bmatrix}n\\ m-k\end{Bmatrix}(m-k)!\\
&amp;=\sum_{k=0}^m\begin{Bmatrix}n\\ k\end{Bmatrix}m^{\underline{k}}
\end{aligned}
\]&lt;p&gt;转化的含义是将 \(m^{n}\) 看作 \(\rm LLA\) 问题的方案数，我们发现 \(\small\begin{Bmatrix}n\\ m\end{Bmatrix}\) 是 \(\rm LUB\) 问题的方案数，于是枚举 \(m\) 个集合中有 \(k\) 个 \(0\)，然后用第二类斯特林数将 \(\rm LUA\) 算出来后乘上 \((m-k)!\) 得到 \(\rm LLA\) 的方案数。&lt;/p&gt;
&lt;p&gt;于是就可以开始推式子了 ：&lt;/p&gt;
\[
\begin{aligned}
&amp;\quad~\sum_{i=0}^n\dbinom{n}{i}2^{n-i}f(i)\\
&amp;=\sum_{i=0}^n\dbinom{n}{i}2^{n-i}\sum_{j=0}^ka_ji^j\\
&amp;=\sum_{i=0}^n\dbinom{n}{i}2^{n-i}\sum_{j=0}^ka_j\sum_{p=0}^i\dbinom{i}{p}\begin{Bmatrix}j\\ p\end{Bmatrix}p!\\
&amp;=\sum_{i=0}^n\sum_{j=0}^k\sum_{p=0}^i\dbinom{n}{i}\dbinom{i}{p}2^{n-i}a_j\begin{Bmatrix}j\\ p\end{Bmatrix}p!\\
&amp;=\sum_{j=0}^ka_j\sum_{p=0}^n\begin{Bmatrix}j\\ p\end{Bmatrix}p!\sum_{i=p}^n\dbinom{n}{i}\dbinom{i}{p}2^{n-i}\\
&amp;=\sum_{j=0}^ka_j\sum_{p=0}^n\begin{Bmatrix}j\\ p\end{Bmatrix}p!\sum_{i=p}^n\dbinom{n}{p}\dbinom{n-p}{i-p}2^{n-i}\\
&amp;=\sum_{j=0}^ka_j\sum_{p=0}^n\dbinom{n}{p}\begin{Bmatrix}j\\ p\end{Bmatrix}p!\sum_{i=0}^{n-p}\dbinom{n-p}{i}2^{n-p-i}\\
&amp;=\sum_{j=0}^k\sum_{p=0}^na_j\begin{Bmatrix}j\\ p\end{Bmatrix}\dbinom{n}{p}p!3^{n-p}\\
&amp;=\sum_{j=0}^k\sum_{p=0}^j\begin{Bmatrix}j\\ p\end{Bmatrix}a_j\times n^{\underline{p}}\times 3^{n-p}
\end{aligned}
\]&lt;p&gt;最后这个式子可以通过预处理第二类斯特林数，\(3\) 的次幂和 \(n\) 的 \(p\) 阶下降幂做到 \(\Theta(k^{2})\)。&lt;/p&gt;
&lt;h3 id="斯特林反演-1"&gt;斯特林反演&lt;/h3&gt;
&lt;p&gt;非常类似二项式反演的形式，有：&lt;/p&gt;
\[
f_n = \sum\limits_i ^ n \begin{Bmatrix} n \ i \end{Bmatrix} g_i \Longleftrightarrow g_n = \sum\limits_i ^ n (-1) ^ {n - i} \begin{bmatrix} n \ i \end{bmatrix} f_i
\]&lt;p&gt;我们首先需要了解斯特林反演基于的恒等式 \(-\) 反转公式：&lt;/p&gt;
\[
\sum\limits_{i = m} ^ n (-1) ^ {n - i} \begin{Bmatrix} n \ i \end{Bmatrix} \begin{bmatrix} i \ m \end{bmatrix} = [n = m]
\]\[
\sum\limits_{i = m} ^ n (-1) ^ {n - i} \begin{bmatrix} n \ i \end{bmatrix} \begin{Bmatrix} i \ m \end{Bmatrix} = [n = m]
\]&lt;p&gt;不难发现两式的形式非常类似，我们只证明第一条式子，第二条式子是类似的。&lt;/p&gt;
\[
\begin{aligned}
x ^ n &amp;= \sum\limits_i ^ n \begin{Bmatrix} n \ i \end{Bmatrix} x ^ {\underline{i}} \\
&amp;= \sum\limits_i ^ n \begin{Bmatrix} n \ i \end{Bmatrix} (-1) ^ i (-x) ^ {\overline{i}} \\
&amp;= \sum\limits_i ^ n (-1) ^ i \begin{Bmatrix} n \ i \end{Bmatrix} \sum\limits_j ^ i (-1) ^ j \begin{bmatrix} i \ j \end{bmatrix} x ^ j \\
&amp;= \sum\limits_i ^ n \left( \sum\limits_{j = i} ^ n (-1) ^ {i - j} \begin{Bmatrix} n \ j \end{Bmatrix} \begin{bmatrix} j \ i \end{bmatrix}\right) x ^ i
\end{aligned}
\]&lt;p&gt;根据多项式恒等原理即可证明第一条反转公式。&lt;/p&gt;
&lt;p&gt;有了这两条反转公式，就可以直接将斯特林反演左式带入右式以及右式带入左式来证明正确性了，过程是不难的。&lt;/p&gt;
&lt;h2 id="min-max-反演"&gt;Min-Max 反演&lt;/h2&gt;
&lt;p&gt;令 \(\max\limits_{k}(S)\) 表示有限集 \(S\) 中的最大值，\(\min\limits_{k}(S)\) 表示有限集中的最小值。&lt;/p&gt;
&lt;h3 id="基本形式"&gt;基本形式&lt;/h3&gt;
\[
\max(S)=\sum\limits_{T\subseteq S}(-1)^{|T|-1}\min(T)
\]&lt;p&gt;可以发现，对于所有 \(T\subseteq S-\{\max(S)\}\)，均存在 \(T+\max(S)\subseteq S\) 与之一一对应，且 \(\min(T)=\min(T+\max(S))\)。 由于它们的大小恰好相差 \(1\)，故对每个集合 \(S\) 配上 \((-1)^{|S|}\) 的系数可以恰好它们消掉，最后仅剩下集合 \(\{\max(S)\}\)，它的最小值恰好等于 \(\max(S)\)。&lt;/p&gt;
&lt;p&gt;同理 ：&lt;/p&gt;
\[
\min(S)=\sum\limits_{T\subseteq S}(-1)^{|T|-1}\max(T)
\]&lt;h3 id="拓展形式"&gt;拓展形式&lt;/h3&gt;
\[
\max_k(S)=\sum_{T\subseteq S,|T|\geqslant k}(-1)^{|T|-k}\dbinom{|T|-1}{k-1}\min(T)
\]&lt;p&gt;考虑 \(S\) 中的第 \(i\) 大数，它作为最小值被包含在大小为 \(|T|\) 的集合中共 \(\binom{i-1}{|T|-1}\) 次，每次出现会乘上 \(\binom{|T|-1}{k-1}\) 的权值，故一个数 \(\max\limits_{i}(S)\) 的总贡献为 ：&lt;/p&gt;
\[
\begin{aligned}
val_i&amp;=\max_i(S)\sum_{|T|=k}^i(-1)^{|T|-k}\dbinom{i-1}{|T|-1}\dbinom{|T|-1}{k-1}\\
&amp;=\max_i(S)\dbinom{i-1}{k-1}\sum_{|T|=k}^i(-1)^{|T|-k}\dbinom{i-k}{|T|-k}\\
&amp;=\max_i(S)\dbinom{i-1}{k-1}[i=k]
\end{aligned}
\]&lt;p&gt;所有数的贡献之和即为 \(\sum\limits_{i=1}^{|S|}val_{i}=\max\limits_{k}(S)\)，故原式成立。&lt;/p&gt;
&lt;p&gt;另外，由于期望具有线性性，所以上面的式子在期望意义下也成立。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;我们来看看 \(\rm Min-Max\) 反演有什么应用：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
：你需要收集 \(n\) 种物品中的任意 \(k\) 种，每个时刻会有一种物品被生成，第 \(i\) 种物品被生成的概率为 \(\frac{p_{i}}{m}\)，如果你还没有收集这种物品则可以收集它，求你收集到这 \(n\) 个物品中任意 \(k\) 个的期望时间。&lt;/p&gt;
&lt;p&gt;保证 \(k\leqslant n\leqslant 10^{3},|n-k|\leqslant 10,0\leqslant p_{i}\leqslant m,\sum p=m,m\leqslant 10^{4}\)。&lt;/p&gt;
&lt;p&gt;首先可以发现所有物品出现的时间不重，故构成一个集合，所以题目要求的为 \(E\left(\max (S)_{k}\right)\)。&lt;/p&gt;
&lt;p&gt;套用拓展 \(\rm Min -Max\) 得到:&lt;/p&gt;
\[
E\left(\max (S)_{k}\right)=\sum_{T \subseteq S}\left(\begin{array}{c}
|T|-1 \\
k-1
\end{array}\right)(-1)^{|T|-k} E(\min (T))
\]&lt;p&gt;我们知道原来要求的是全集合中出现时间排第 \(k\) 的元素，由于变成了正过来看，此时的 \(k\) 变成了 \(n-k+ 1\) ，它的值非常小。&lt;/p&gt;
&lt;p&gt;我们知道一个集合每次操作出现一个属于它的元素的概率为:&lt;/p&gt;
\[
e(S)=\sum_{i \in S} \frac{p_{i}}{m}
\]&lt;p&gt;于是我们知道期望时间为:&lt;/p&gt;
\[
\sum_{i=1}^{\infty} e(S)(1-e(S))^{i-1}=\frac{1}{e(S)}
\]&lt;p&gt;于是现在我们得到了一个复杂度为 \(\Theta\left(2^{n}\right)\) 的做法，暴力枚举子集，对于每个集合求出此式子并计算贡献。&lt;/p&gt;
&lt;p&gt;然后我们来看这个式子:&lt;/p&gt;
\[
E\left(\max (S)_{k}\right)=\sum_{T \subseteq S}\left(\begin{array}{c}
|T|-1 \\
k-1
\end{array}\right)(-1)^{|T|-k} E(\min (T))
\]&lt;p&gt;考虑一个固定的集合大小 \(|T|\) ，其分配的系数相同均为 \(\left(\begin{array}{c}|T|-1 \ k-1\end{array}\right)(-1)^{|T|-k}\)&lt;/p&gt;
&lt;p&gt;则我们只需要求出 \(\sum_{|T|=x} E(\min (T))\)&lt;/p&gt;
&lt;p&gt;注意到 \(E(\min (T))=\frac{1}{e(S)}\)，于是我们可以给 \(d p\) 加一个维度记录 \(\sum p=e(S)\), 这样只需要统计有多少 个点满足 \(\sum p=i,|T|=j\)。&lt;/p&gt;
&lt;p&gt;于是不妨记 \(d p_{i, j, k}\) 表示考虑到前 \(i\) 个数，满足 \(|T|=j, \sum p=k\) 的集合数，则可以得到转移:&lt;/p&gt;
\[
d p_{i, j, k}=d p_{i-1, j, k}+d p_{i-1, j-1, k-p_{i}}
\]&lt;p&gt;这样便可以得到一个复杂度为 \(\Theta\left(n^{2} m\right)\) 的做法了。&lt;/p&gt;
&lt;p&gt;现在问题在于如何优化复杂度 \(?\)&lt;/p&gt;
&lt;p&gt;我们发现转移已经是最优了，不能从这里下手，于是只能从状态下手。由于 \(k\) 这一维附带了一个 \(\frac{1}{k}\)，于是肯定定是不能省略的，唯一的办法是把记录中的 \(|T|\) 给去掉试试。&lt;/p&gt;
&lt;p&gt;换而言之我们只统计到第 \(i\) 个数，任意放满足 \(\sum p=k\) 的数前面安排的系数之和。考虑系数为:&lt;/p&gt;
\[
\sum\left(\begin{array}{c}
|T|-1 \\
k-1
\end{array}\right)(-1)^{|T|-k}
\]&lt;p&gt;拆开试试 ?&lt;/p&gt;
\[
\sum \frac{(|T|-1) !}{(k-1) !(|T|-k) !}(-1)^{|T|-k}
\]&lt;p&gt;好像还是不行……&lt;/p&gt;
&lt;p&gt;但是这个时候可以得到转移大致为：&lt;/p&gt;
\[
d p_{i, j}=d p_{i-1, j}+\ldots
\]&lt;p&gt;这个奇怪的东西应该表示为:&lt;/p&gt;
&lt;p&gt;对于 \(d p_{i-1, j-p i}\) 的:&lt;/p&gt;
\[
\sum\left(\begin{array}{c}
|T|-1 \\
k-1
\end{array}\right)(-1)^{|T|-k}
\]&lt;p&gt;首先可以注意到所有 \(|T| \rightarrow|T|+1\) 于是整体需要乘一个 \(-1\)，注意到 \(|T| \rightarrow|T|+1\)，于是组合数变成了:&lt;/p&gt;
\[
\left(\begin{array}{c}
|T| \\
k-1
\end{array}\right)
\]&lt;p&gt;但是我们知道组合数可以递推所以有:&lt;/p&gt;
\[
\left(\begin{array}{c}
|T| \\
k-1
\end{array}\right)=\left(\begin{array}{c}
|T|-1 \\
k-1
\end{array}\right)+\left(\begin{array}{c}
|T|-1 \\
k-2
\end{array}\right)
\]&lt;p&gt;然而真正有趣的是这个式子可以放在一起一起递推，因为考虑计算 \(dp\) 时强制放入一个数则等价于 \(|T|\) 必然变大 \(1\)，于是我们可以给 \(dp\) 增加一个维度 \(k\) 来计算 \(dp\) 系数&lt;/p&gt;
\[
d p_{i, j, k}=d p_{i-1, j, k}+(-1) \times d p_{i-1, j-p i, k}+(-1)^{2} \times d p_{i-1, j-p i, k-1}
\]&lt;p&gt;即:&lt;/p&gt;
\[
d p_{i, j, k}=d p_{i-1, j, k}-d p_{i-1, j-p i, k}+d p_{i-1, j-p i, k-1}
\]&lt;p&gt;接下来考虑边界条件，这个好像有点难，因为我们的 \(dp\) 是按照转移的需求设计，所以它存在的实际意义也是为了方便转移而存在的。&lt;/p&gt;
&lt;p&gt;我们知道 \(d p_{0, j, k}\) 的意义应该是: \(\sum_{\sum p=j}\left(\begin{array}{c}|T|-1 \ k-1\end{array}\right)\)，于是考虑前面的数，唯一的一个 \(\sum p=j\) 是空集，即 \(\sum p=0\)，此时有 \(|T|=0\) 求的则是:&lt;/p&gt;
\[
dp_{0,0, k}=\dbinom{-1}{k-1}
\]&lt;p&gt;这个时候我们需要拓宽组合数的意义, 你可以认为 \(\binom{-1}{-1}=1\) 而 \(\binom{x}{y}\) 在 \(x\lt y\) 的时候为 \(0\)，\(x=y\) 的时候为 \(1\)。 所以 \(dp\) 的边界为 \(dp_{0,0,0}=1\)。&lt;/p&gt;
&lt;p&gt;转移的时候可以用滚动数组，总时间复杂度为 \(\Theta(nm(n-k))\)。&lt;/p&gt;
&lt;h3 id="gcd-lcm-反演"&gt;Gcd-Lcm 反演&lt;/h3&gt;
&lt;p&gt;一般地，求 \(\rm lcm\) 通常转化为求解 \(\gcd\)，因为 \(\gcd\) 的性质更为优秀，也可以借助莫比乌斯反演。&lt;/p&gt;
&lt;p&gt;通用形式为：&lt;/p&gt;
\[
\mathrm{lcm}(S) = \prod\limits_{T \subseteq S, T \ne \varnothing} \gcd(T) ^ {(-1) ^ {|T| - 1}}
\]&lt;p&gt;证明考虑使用 \(\rm Min-Max\) 容斥，考虑每个质因子 \(p\) 对左右的贡献：&lt;/p&gt;
\[
\begin{aligned}
p ^ {\max(p, S)} &amp;= p ^ {\sum\limits_{T \subseteq S, T \ne \varnothing} (-1) ^ {|T| - 1} \min(p, T)} \\
&amp;= \prod\limits_{T \subseteq S, T \ne \varnothing} p ^ {(-1) ^ {|T| - 1} \min(p, T)} \\
&amp;= \prod\limits_{T \subseteq S, T \ne \varnothing} \left(p ^ {\min(p, T)}\right) ^ {(-1) ^ {|T| - 1} }
\end{aligned}
\]&lt;p&gt;那么有：&lt;/p&gt;
\[
\begin{aligned}
\mathrm{lcm}(S) &amp;= \prod\limits_p p ^ {\max(p, S)} \\
&amp;= \prod\limits_{p} \prod\limits_{T \subseteq S, T \ne \varnothing} \left(p ^ {\min(p, T)}\right) ^ {(-1) ^ {|T| - 1} } \\
&amp;= \prod\limits_{T \subseteq S, T \ne \varnothing} \left(\prod\limits_p p ^ {\min(p, T)}\right) ^ {(-1) ^ {|T| - 1} } \\
&amp;= \prod\limits_{T \subseteq S, T \ne \varnothing} \gcd(T) ^ {(-1) ^ {|T| - 1}}
\end{aligned}
\]&lt;p&gt;&lt;strong&gt;我们来看看 \(\rm Gcd-Lcm\) 反演有什么应用：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;前路（出题人：本校学长 @\(\rm remoon\)）:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;给定 \(A,B,C\)，求 ：&lt;/p&gt;
\[
\sum_{i=1}^A\sum_{j=1}^B\sum_{k=1}^C\mathrm{lcm}(i,j,k)
\]&lt;p&gt;保证 \(A,B,C\leqslant 5\times 10^{4}\)，答案对 \(10^{9}+7\) 取模。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;首先给出一个复杂度估界为 \(\Theta(n^{2})\) 的做法，但实测非常快。&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;请注意，以下的推导遵循一个原则，对 \(i, j, k\) 做相同变换，不会先处理一部分再处理一部分。&lt;/p&gt;
\[
\begin{aligned}
Ans &amp;= \sum\limits_{i = 1} ^ A \sum\limits_{j = 1} ^ B \sum\limits_{k = 1} ^ C \mathrm{lcm}(i, j, k) \\
&amp;= \sum\limits_{i = 1} ^ A \sum\limits_{j = 1} ^ B \sum\limits_{k = 1} ^ C \frac{ijk(i, j, k)}{(i, j)(j, k)(k, i)} \qquad (\mathrm{Min-Max} ~ for ~ index) \\
&amp;= \sum\limits_{i = 1} ^ A \sum\limits_{j = 1} ^ B \sum\limits_{k = 1} ^ C \frac{ijk}{(i, j)(j, k)(k, i)} \left( f \times \mu \times I \left((i, j, k)\right)\right) \qquad (f(i) = i)\\
&amp;= \sum\limits_{d = 1} ^ A f \times \mu (d) \sum\limits_{i = 1} ^ {A / d} \sum\limits_{i = 1} ^ {B / d} \sum\limits_{i = 1} ^ {C / d} \frac{ijk}{(i, j)(j, k)(k, i)}
\end{aligned}
\]&lt;p&gt;令 \(F(A, B, C) = \sum\limits_{i = 1}^{A} \sum\limits_{i = 1}^{B} \sum\limits_{i = 1}^{C} \dfrac{ijk}{(i, j)(j, k)(k, i)}, g(i) = \dfrac{1}{i}, h = g \times \mu\) 则：&lt;/p&gt;
\[
\begin{aligned}
F(A, B, C) &amp;= \sum\limits_{i = 1} ^ A \sum\limits_{i = 1} ^ B \sum\limits_{i = 1} ^ C ijk ( f \times \mu \times I ((i, j)))( f \times \mu \times I ((j, k)))( f \times \mu \times I ((k, i))) \\
&amp;= \sum\limits_{i = 1} ^ A \sum\limits_{i = 1} ^ B \sum\limits_{i = 1} ^ C ijk \sum\limits_{x \mid (i, j)} g \times \mu(x) \sum\limits_{y \mid (j, k)} g \times \mu(y) \sum\limits_{z \mid (k, i)} g \times \mu(z) \\
&amp;= \sum\limits_{x = 1} ^ A \sum\limits_{y = 1} ^ B \sum\limits_{z = 1} ^ C h(x) h(y) h(z) \sum\limits_{x, z \mid i} i \sum\limits_{x, y \mid j} j \sum\limits_{y, z \mid k} k \\
&amp;= \sum\limits_{x = 1} ^ A \sum\limits_{y = 1} ^ B \sum\limits_{z = 1} ^ C h(x) h(y) h(z) \sum\limits_{i = 1} ^ {A / \mathrm{lcm}(x, z)} i \times \mathrm{lcm}(x, z) \sum\limits_{j = 1} ^ {B / \mathrm{lcm}(x, y)} j \times \mathrm{lcm}(x, y) \sum\limits_{k = 1} ^ {C / \mathrm{lcm}(y, z)} k \times \mathrm{lcm}(y, z) \\
&amp;= \sum\limits_{x = 1} ^ A \sum\limits_{y = 1} ^ B \sum\limits_{z = 1} ^ C h(x) h(y) h(z) S(A, \mathrm{lcm}(x, z)) S(B, \mathrm{lcm}(x, y)) S(C, \mathrm{lcm}(y, z))
\end{aligned}
\]&lt;p&gt;可以发现，后者 \(x \rightarrow y \rightarrow z \rightarrow x\) 构成了一个三元环，我们可以大概给出估界为 \(\mathcal{O(n \log n \log \log n)}\)。 因此暴力找出所有三元环的复杂度为：\(\mathcal{O(n \log n \log \log n\sqrt{n \log n \log \log n})}\)。&lt;/p&gt;
&lt;p&gt;同时，因为这个在 \(n = 5000\) 时与 \(n^{2}\) 无区别，因此连边可以使用暴力。但也可以枚举 \(\mathrm{Lcm}\) 再枚举其约数，使用 \(\mathcal{O(n \log^{3n})}\) 连边。&lt;/p&gt;
&lt;p&gt;此时我们算完了 \(F\)，可知总共需要算的 \(F\) 只有 \(\sqrt{n}\) 种，若将单次复杂度看作 \(n^{2}\)，因此总复杂度：&lt;/p&gt;
\[
\mathcal{O(n ^ 2\sum\limits_{i = 1} ^ {n} \frac{1}{i ^ 2})} = O(n ^ 2)
\]&lt;p&gt;经过卡常之后，效率提升大约五倍多，以下是如何卡常的：&lt;/p&gt;
&lt;p&gt;我写了一个大范围内的打表程序，发现实际原做法的连边数量大约是 \(n \log n \log \log n\) 级别的，因此这个做法很有卡常前途。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;我们把暴力连边换掉，枚举其约数，使用 \(\mathcal{O(n \log^{3n})}\) 连边。连边暴力判断时不要求 \(\rm lcm\) 只需要求 \(\gcd(i / d_{j}, i / d_{k})\) 具体参见代码。如果你想要过本题，是一定要优化连边的。&lt;/li&gt;
&lt;li&gt;可以发现我们需要调用的 \(\rm lcm\) 只有每条边的两个端点，而在枚举 \(\rm Lcm\) 时是可以 \(\mathcal{O(1)}\) 得知的，因此我们在连边时记录这个值。&lt;/li&gt;
&lt;li&gt;可以发现，\(S\) 函数有很多是无用的，有用的第一维只有 \(\sqrt{A}\) 个，因此可以只预处理 \(A \sqrt{A}\) 个值。&lt;/li&gt;
&lt;li&gt;\(\gcd\) 请不要暴力求，我们记忆化 \(a, b \leqslant 2e4\) 的部分，并用 \(\rm short\) 类型存储，减少空间消耗。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;然后我们再给出一个复杂度为 \(\Theta(n^{1.5})\) 的正解做法。&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;方便起见用 \((x, y)\) 代指 \(\operatorname{gcd}(x, y)\)&lt;/p&gt;
\[
\sum_{i=1}^{A} \sum_{j=1}^{B} \sum_{k=1}^{C} \frac{(i, j, k) i j k}{(i, j)(j, k)(i, k)}
\]&lt;p&gt;枚举 \(d\), 设 \(F(A, B, C)=\sum_{i=1}^{A} \sum_{j=1}^{B} \sum_{k=1}^{C} \frac{i j k}{(i, j)(j, k)(i, k)}\) 考虑计算:&lt;/p&gt;
\[
\sum_{d} \varphi(d) F\left(\frac{A}{d}, \frac{B}{d}, \frac{C}{d}\right)
\]&lt;p&gt;令 \(n=\max (A, B, C)\), 假定我们可以在 \(\mathcal{O}\left(n^{c} \log^{k} n\right)\) 的复杂度计算一组 \(F(A, B, C)\), 则当 \(c\gt 1\) 时，恒有 \(\sum \frac{1}{d^{c}}\) 是收敛的，可以认为其为常数。（不过比较大）&lt;/p&gt;
&lt;p&gt;只需要考虑快速计算一组 \(F(A, B, C)\), \(\rm remoon\) 给出的做法是同时反演三组，然后考虑通过三元环计数来计算答案，这里给出略为不同的思路:&lt;/p&gt;
\[
\begin{aligned}
&amp;F(A, B, C)=\sum_{i=1}^{A} \sum_{j=1}^{B} \sum_{k=1}^{C} \frac{i j k}{(i, j)(j, k)(i, k)} \\
&amp;=\sum_{k} k \sum_{d}(f * \mu)(d) \sum_{d \mid i}^{A} \frac{i}{\operatorname{gcd}(i, k)} \sum_{d \mid j}^{B} \frac{j}{\operatorname{gcd}(j, k)} \\
&amp;=\sum_{k} k \sum_{d}(f * \mu)(d) \frac{d^{2}}{\operatorname{gcd}(k, d)^{2}}\left(\sum_{i=1}^{A / d} \frac{i}{\operatorname{gcd}\left(i, \frac{k}{\operatorname{gcd}(k, d)}\right)}\right)\left(\sum_{i=1}^{B / d} \frac{i}{\operatorname{gcd}\left(i, \frac{k}{\operatorname{gcd}(k, d)}\right)}\right)
\end{aligned}
\]&lt;p&gt;不妨设 \(F(t, x)=\sum_{i \leq t} \frac{i}{\operatorname{gcd}(i, x)}\), 记 \(g(d)=(f * \mu)(d) d^{2}\)。&lt;/p&gt;
&lt;p&gt;答案等价于：&lt;/p&gt;
\[
\sum_{k}^{C} k \sum_{d} \frac{g(d)}{\operatorname{gcd}(k, d)^{2}} F\left(\frac{A}{d}, \frac{k}{\operatorname{gcd}(k, d)}\right) F\left(\frac{B}{d}, \frac{k}{\operatorname{gcd}(k, d)}\right)
\]&lt;p&gt;枚举 \(\frac{k}{\operatorname{gcd}(k, d)}\) 为 \(x\), 此时考虑到我们只需要计算 \(\mathcal{O}(n \sqrt{n})\) 组 \(F(n, x)\)。&lt;/p&gt;
&lt;p&gt;考虑到 \(F(n, x)\) 事实上就是:&lt;/p&gt;
\[
\begin{aligned}
&amp;\sum_{i=1}^{n} \frac{i}{\operatorname{gcd}(i, x)} \\
&amp;=\sum_{d \mid x}(f * \mu)(d) \times d S\left(\frac{n}{d}\right)
\end{aligned}
\]&lt;p&gt;枚举这 \(\sqrt{A}\) 种 \(n\), 可以发现后式就是一个高维前缀和的形式，可以在 \(\mathcal{O}\left(n^{1.5} \log \log n \sim n^{1.5} \log n\right)\) 的复杂度完成计算。 考虑前半部分，不妨枚举 \(d, \operatorname{gcd}(k, d)\) （设为 \(t\) ) 以及 \(x\), 此时我们知道:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;\(k=x t\), 故 \(x t \leq C\)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;\(t \mid d\)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;\(\operatorname{gcd}\left(\frac{d}{t}, x\right)=1\)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;固定了 \(\frac{A}{d}, \frac{B}{d}\) 之后，我们可以发现 \(d\) 属于区间 \([l, r]\), 此时我们考虑将答案差分，简而言之，我们的任务是计算 \(n \sqrt{n}\) 次下式:&lt;/p&gt;
\[
\begin{aligned}
&amp;x \sum_{d \leq R} g(d) \sum_{t \mid d} \frac{1}{t}[x t \leq C]\left[\operatorname{gcd}\left(x, \frac{d}{t}\right)=1\right] \\
&amp;=x \sum_{c \mid x} \mu(c) \sum_{c \mid d, d \leq R} g(d) \sum_{t \mid \frac{d}{\epsilon}} \frac{1}{t}\left[t \leq \frac{C}{x}\right]
\end{aligned}
\]&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;首先，我们不难考虑到本质不同的 \(\frac{C}{x}\) 只有 \(\sqrt{n}\) 种，可以考虑枚举每种 \(\frac{C}{x}=m\) ，并在此时预处理:&lt;/p&gt;
\[
g(d) \sum_{t \mid d} \frac{1}{t}[t \leq m]
\]&lt;p&gt;对于某个 \(m\) ，这可以在 \(\mathcal{O}(n \log \log n)\) 的复杂度完成计算，总体而言，此部分可以在 \(\mathcal{O}\left(n^{1.5} \log \log n \sim n^{1.5} \log n\right)\) 完成预处理，设其为 \(G\left(d, \frac{C}{x}\right)\)。&lt;/p&gt;
&lt;p&gt;最后，让我们为每个 \(c\) 考虑，穷举可能的 \(\sqrt{n}\) 种 \(m\) ，并为每个 \(c\) 建立大小为 \(\frac{\max R}{c}\) 的表格，显然表格的总大小为 \(n \log n\), 此时单组查询显然可以做到 \(\mathcal{O}(1)\), 由于 \(x\) 穷举 \(1 \sim n\) ，考察其约数个数和显然为 \(\mathcal{O}(n \log n)\), 总体而言我们可以在 \(\mathcal{O}\left(n^{1.5} \log n\right)\) 解决此问题。&lt;/p&gt;
&lt;p&gt;一点新的思路:&lt;/p&gt;
&lt;p&gt;我们考虑枚举 \(c\), 并为每个 \(c\), 对 \(\frac{C / c}{x}\) 的所有可能的取值进行预处理，不难发现这个部分的复杂度为 \(\sum\left(\frac{n}{c}\right)^{1.5}\)。&lt;/p&gt;
&lt;p&gt;通过积分不难证明这部分等效于 \(n^{1.5}\)。&lt;/p&gt;
&lt;h2 id="莫比乌斯反演"&gt;莫比乌斯反演&lt;/h2&gt;
&lt;h3 id="一些定义和性质"&gt;一些定义和性质&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;\(\rm Dirichlet\) 卷积 :&lt;/strong&gt; \(\sum\limits_{d|n}f(d)g(\frac{n}{d})\) 被定义为 \(\rm Dirichlet\) 卷积。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;莫比乌斯 \((\mu)\) 函数 :&lt;/strong&gt;&lt;/p&gt;
\[
\mu(n)=
\begin{cases}
1 &amp; n=1 \\
0 &amp; n \text{ 含有平方因子 } \\
(-1)^k &amp; k \text{ 为 } n \text{ 的本质不同质因子个数 }
\end{cases}
\]&lt;p&gt;显然，\(\mu\) 是积性函数，且它还有一些更加巧妙的性质，其中最常用的一个是 \(\mu \times 1=\varepsilon\)。&lt;/p&gt;
&lt;p&gt;\(\large\rm Proof:\)&lt;/p&gt;
&lt;p&gt;此处的乘号表示 \(\rm Dirichlet\) 卷积，\(1\) 表示常数函数 \(\forall x\in [1,+\infty),f(x)=1\)，\(\varepsilon\) 表示单位函数 \(\forall x\in [1,+\infty),f(x)=[x=1]\)。&lt;/p&gt;
&lt;p&gt;设 \(n=\prod_{i=1}^{k} p_{i}^{c_{i}}, n^{\prime}=\prod_{i=1}^{k} p_{i}\)。&lt;/p&gt;
&lt;p&gt;那么 \(\sum\limits_{d \mid n} \mu(d)=\sum\limits_{d \mid n^{\prime}} \mu(d)=\sum\limits_{i=0}^{k}\tbinom{k}{i}\cdot(-1)^{i}=(1+(-1))^{k}\)。&lt;/p&gt;
&lt;p&gt;根据二项式定理，易知该式子的值在 \(k=0\) 即 \(n=1\) 时值为 \(1\) 否则为 \(0\)，这也同时证明了 \(\sum\limits_{d \mid n} \mu(d)=[n=1]=\varepsilon(n)\) 以及 \(\mu * 1=\varepsilon\)。&lt;/p&gt;
&lt;h3 id="两个反演式子"&gt;两个反演式子&lt;/h3&gt;
\[
[n=1]=\sum_{d|n}\mu(d)
\]&lt;p&gt;\(\large\rm Proof:\)&lt;/p&gt;
\[
[n=1]=\varepsilon(n)=\mu \times 1(n)=\sum_{d|n}\mu(d)
\]&lt;p&gt;&lt;strong&gt;我们来看看这个式子有什么应用：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
给定一个长度为 \(n\) 的序列 \(a\)，给定 \(m\) 个询问 \(l,r,x\)，求 \(a_{l},a_{l+1}......a_{r}\) 中有多少个数与 \(x\) 互质。&lt;/p&gt;
&lt;p&gt;保证 \(n,m,a_{i},x\leqslant 10^{5}\)。&lt;/p&gt;
&lt;p&gt;考虑莫比乌斯反演: \(\left[\left(a_{i}, x\right)=1\right]=\sum\limits_{\left.d \mid a_{i}, x\right)} \mu(d)=\sum\limits_{d\left|a_{i}, d\right| x} \mu(d)\)。&lt;/p&gt;
&lt;p&gt;由于答案求 \(\sum\limits_{i=l}^{r}\left[\left(a_{i}, x\right)=1\right]=\sum\limits_{i=l}^{r} \sum\limits_{d\left|a_{i}, d\right| x} \mu(d)=\sum\limits_{d \mid x} \mu(d) \sum\limits_{i=l}^{r}\left[d \mid a_{i}\right]_{\text {.}}\)&lt;/p&gt;
&lt;p&gt;考虑对于每一个数, 预处理出它的倍数出现在哪些位置, 然后询问时枚举所有 \(x\) 的因数, 二分一下即可求出 \([l, r]\) 内它的倍数有多少个。时间复杂度 \(\Theta(n \sigma(\operatorname{maxa}) \log n)\)。&lt;/p&gt;
&lt;p&gt;考虑对上述算法进行优化 ：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;我们可以只考虑 \(\mu\) 值不等于 \(0\) 的因数。&lt;/li&gt;
&lt;li&gt;考虑预处理出小于 \(\sqrt{maxa}\) 的所有因数的前缀和，这样对于这些因数的询问是 \(\Theta(1)\) 的。&lt;/li&gt;
&lt;li&gt;考虑我们相当于要求 \(q\) 个询问不大于 \(x\) 的为某个数的倍数的方案数。先将这些点排个序，然后就可以直接 \(\rm two\ pointers\) 求。时间复杂度可以降到 \(\Theta(n\sigma(maxa))\)。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;三者实现其一即可通过本题。&lt;/p&gt;
\[
f(n)=\sum_{d|n}g(d)\iff g(n)=\sum_{d|n}\mu(d)f\left(\frac{n}{d}\right)
\]&lt;p&gt;\(\large\rm Proof:\)&lt;/p&gt;
\[
\because f=g\times I
\]\[
\therefore f\times \mu=g\times I \times \mu
\]\[
\therefore f\times \mu=g\times \varepsilon = g
\]&lt;p&gt;&lt;strong&gt;我们来看看这个式子有什么应用：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
给出 \(n\) 个询问，每个询问给定 \(5\) 个整数 \(a,b,c,d,k\)，求 ：&lt;/p&gt;
\[
\sum_{i=a}^{b}\sum_{j=c}^d[\gcd(i,j)=k]
\]&lt;p&gt;保证 \(n,a,b,c,d,k\leqslant 5\times 10^{4}\)。&lt;/p&gt;
&lt;p&gt;根据容斥原理, 原式可以分成 \(4\) 块来处理，每一块的式子都形如 ：&lt;/p&gt;
\[
\sum_{i=1}^{n} \sum_{j=1}^{m}[\operatorname{gcd}(i, j)=k]
\]&lt;p&gt;考虑化简该式子 ：&lt;/p&gt;
\[
\sum_{i=1}^{\left\lfloor\frac{n}{k}\right\rfloor} \sum_{j=1}^{\left\lfloor\frac{m}{k}\right\rfloor}[\operatorname{gcd}(i, j)=1]
\]&lt;p&gt;因为 \(\operatorname{gcd}(i, j)=1\) 时对答案才有贡献，于是我们可以将其替换为 \(\varepsilon(\operatorname{gcd}(i, j))\)，故原式化为 ：&lt;/p&gt;
\[
\sum_{i=1}^{\left\lfloor\frac{n}{k}\right\rfloor} \sum_{j=1}^{\left\lfloor\frac{m}{k}\right\rfloor} \varepsilon(\operatorname{gcd}(i, j))
\]&lt;p&gt;将 \(\varepsilon\) 函数展开得到 ：&lt;/p&gt;
\[
\sum_{i=1}^{\left\lfloor\frac{n}{k}\right\rfloor} \sum_{j=1}^{\left\lfloor\frac{m}{k}\right\rfloor} \sum_{d \mid \operatorname{gcd}(i, j)} \mu(d)
\]&lt;p&gt;变换求和顺序, 先枚举 \(d \mid \operatorname{gcd}(i, j)\) 可得 ：&lt;/p&gt;
\[
\sum_{d=1}^{\min \left(\left\lfloor\frac{n}{k}\right\rfloor,\left\lfloor\frac{m}{k}\right\rfloor\right)} \mu(d) \sum_{i=1}^{\left\lfloor\frac{n}{k}\right\rfloor}[d \mid i] \sum_{j=1}^{\left\lfloor\frac{m}{k}\right\rfloor}[d \mid j]
\]&lt;p&gt;易知 \(1 \sim\left\lfloor\frac{n}{k}\right\rfloor\) 中 \(d\) 的倍数有 \(\left\lfloor\frac{n}{k d}\right\rfloor\) 个, 故原式化为 ：&lt;/p&gt;
\[
\sum_{d=1}^{\min \left(\left\lfloor\frac{n}{k}\right\rfloor,\left\lfloor\frac{m}{k}\right\rfloor\right)} \mu(d)\left\lfloor\frac{n}{k d}\right\rfloor\left\lfloor\frac{m}{k d}\right\rfloor
\]&lt;p&gt;很显然，式子可以数论分块求解。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(W+n\sqrt{W})\)。&lt;/p&gt;
&lt;h3 id="莫比乌斯反演的非卷积形式"&gt;莫比乌斯反演的非卷积形式&lt;/h3&gt;
&lt;p&gt;对于数论函数 \(f,g\) 和完全积性函数 \(t\)，满足 \(t(1)=1\)，有 ：&lt;/p&gt;
\[
f(n)=\sum_{i=1}^nt(i)g\left(\left\lfloor\frac{n}{i}\right\rfloor\right)\ \iff g(n)=\sum_{i=1}^n\mu(i)t(i)f\left(\left\lfloor\frac{n}{i}\right\rfloor\right)
\]&lt;p&gt;\(\large\rm Proof:\)&lt;/p&gt;
\[
\begin{aligned}
g(n) &amp;= \sum_{i=1}^n\mu(i)t(i)f\left(\left\lfloor\frac{n}{i}\right\rfloor\right) \\
&amp;= \sum_{i=1}^n\mu(i)t(i) \sum_{j=1}^{\left\lfloor\frac{n}{i}\right\rfloor}t(j) g\left(\left\lfloor\frac{\left\lfloor\frac{n}{i}\right\rfloor}{j}\right\rfloor\right) \\
&amp;= \sum_{i=1}^n\mu(i)t(i) \sum_{j=1}^{\left\lfloor\frac{n}{i}\right\rfloor}t(j) g\left(\left\lfloor\frac{n}{ij}\right\rfloor\right) \\
&amp;= \sum_{T=1}^n \sum_{i=1}^n\mu(i)t(i) \sum_{j=1}^{\left\lfloor\frac{n}{i}\right\rfloor}[ij=T] t(j)g\left(\left\lfloor\frac{n}{T}\right\rfloor\right) \\
&amp;= \sum_{T=1}^n \sum_{i \mid T}\mu(i)t(i) t\left(\frac{T}{i}\right)g\left(\left\lfloor\frac{n}{T}\right\rfloor\right) \\
&amp;= \sum_{T=1}^n g\left(\left\lfloor\frac{n}{T}\right\rfloor\right) \sum_{i \mid T}\mu(i)t(i)t\left(\frac{T}{i}\right) \\
&amp;= \sum_{T=1}^n g\left(\left\lfloor\frac{n}{T}\right\rfloor\right) \sum_{i \mid T}\mu(i)t(T) \\
&amp;= \sum_{T=1}^n g\left(\left\lfloor\frac{n}{T}\right\rfloor\right)t(T) \sum_{i \mid T}\mu(i) \\
&amp;= \sum_{T=1}^n g\left(\left\lfloor\frac{n}{T}\right\rfloor\right)t(T) \varepsilon(T) \\
&amp;= g(n)t(1) \\
&amp;= g(n)
\end{aligned}
\]</description></item><item><title>线性同余方程</title><link>https://sichen-wang.github.io/blog/%E7%BA%BF%E6%80%A7%E5%90%8C%E4%BD%99%E6%96%B9%E7%A8%8B/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E7%BA%BF%E6%80%A7%E5%90%8C%E4%BD%99%E6%96%B9%E7%A8%8B/</guid><description>&lt;p&gt;考虑如何求解以下方程 ：&lt;/p&gt;
\[
ax\equiv 1\pmod b
\]&lt;p&gt;显然可以转化为 ：&lt;/p&gt;
\[
ax+by=1
\]&lt;p&gt;有裴蜀定理 :&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;对于不定方程 \(ax+by=c\)，其有解当且仅当 \(\gcd(a,b)|c\)。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;可以发现上述方程有解当且仅当 \(\gcd(a,b)=1\)，故可以转化为 ：&lt;/p&gt;
\[
ax+by=\gcd(a,b)
\]&lt;p&gt;观察到当 \(b=0\) 时方程有特解 \(x=1,y=0\)，于是考虑如何递归求解。&lt;/p&gt;
&lt;p&gt;因为上式中有辗转相除的影子，于是尝试构造 ：&lt;/p&gt;
\[
bx'+(a~mod~b)y'=\gcd(b,a~mod~b)
\]&lt;p&gt;有 \(a\ mod\ b=a-\lfloor\frac{a}{b}\rfloor b\)，化简可得 ：&lt;/p&gt;
\[
ay'+b\left(x'-\lfloor\frac{a}{b}\rfloor y'\right)=\gcd(b,a~mod~b)=
\gcd(a,b)
\]&lt;p&gt;于是我们发现，如果求出了方程 \(bx'+(a\ mod\ b)y'=\gcd(b,a\ mod\ b)\) 的解 \(x'\) 和 \(y'\)，那么方程 \(ax+by=\gcd(a,b)\) 的解为 ：&lt;/p&gt;
\[
x=y',y=x'-\lfloor\frac{a}{b}\rfloor y'
\]&lt;p&gt;于是这样就可以在辗转相除的过程中递归求解了，时间复杂度 \(\Theta(\log n)\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&amp;lt;bits/stdc++.h&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Exgcd&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Exgcd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Exgcd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;endl&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>线性筛</title><link>https://sichen-wang.github.io/blog/%E7%BA%BF%E6%80%A7%E7%AD%9B/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E7%BA%BF%E6%80%A7%E7%AD%9B/</guid><description>&lt;h2 id="筛素数"&gt;筛素数&lt;/h2&gt;
&lt;p&gt;考虑如何筛出 \(n\) 以内的所有素数，显然有一个最简单的想法，即将所有已求出的质数的倍数标记，表示它们不为质数，并且从小到大遍历到数 \(i\) 时，若它没有被标记，则 \(i\in Prime\)。 在此算法中，每个数都被自己所有本质不同的质因子筛了一次，所以总复杂度为 \(\Theta(n\ln \ln n)\)。&lt;/p&gt;
&lt;p&gt;对于上面的算法，算力的浪费主要在于很多数被多个质数筛过，我们考虑让每个数都只被自己的最小质因子筛。当遍历到 \(i\) 时，枚举已经筛出来的所有质数，若当前枚举的质数为 \(p_{j}\)，显然 \(i\times p_{j}\) 不为质数。另一方面，若 \(p_{j}|i\)，则 \(i\) 中有一个质因子 \(p_{j}\)，那么后面枚举到 \(p_{j+1}\) 的时候，\(p_{j+1}\) 就一定不是 \(i\times p_{j+1}\) 的最小质因子，所以此时要停止枚举质数。这样，每个数都只被自己的最小质因子筛过，所以总复杂度为 \(\Theta(n)\)。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;vis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;cnt&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="筛欧拉函数"&gt;筛欧拉函数&lt;/h2&gt;
&lt;p&gt;考虑到 \(\varphi\) 函数有如下性质：&lt;/p&gt;
\[
\begin{cases}
\varphi(p) = p - 1 &amp; p \in Prime \\
\varphi(ap) = \varphi(a) \times p &amp; p \in Prime \\
\varphi(ab) = \varphi(a) \times \varphi(b) &amp; \gcd(a, b) = 1
\end{cases}
\]&lt;ul&gt;
&lt;li&gt;对于 \(\varphi(p),p\in Prime\)，直接在筛出质数的同时求解即可。&lt;/li&gt;
&lt;li&gt;对于 \(\varphi(ap),p\in Prime\)，在 \(p_{j}|i\) 时，\(\varphi(i\times p_{j})=\varphi(i)\times p_{j}\)。&lt;/li&gt;
&lt;li&gt;对于 \(\varphi(ab),\gcd(a,b)=1\)，直接在筛去合数的时候 \(\varphi(i\times p_{j})=\varphi(i)\times \varphi(p_{j})\)。&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;vis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;cnt&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;phi&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;phi&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;phi&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;phi&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;phi&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;phi&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="筛不同质因子的个数"&gt;筛不同质因子的个数&lt;/h2&gt;
&lt;p&gt;令 \(\alpha(x)\) 表示 \(x\) 不同质因子的个数，\(\beta(x)\) 表示 \(x\) 的所有最小质因子的乘积，考虑到 \(\alpha\) 函数有如下性质：&lt;/p&gt;
\[
\begin{cases}
\alpha(p^k) = 1 &amp; p \in Prime \\
\alpha(ab) = \alpha(a) + \alpha(b) &amp; \gcd(a, b) = 1 \\
\alpha(ap) = \alpha\left(\frac{a}{\beta(a)}\right) + 1 &amp; p \text{ 为 } a \text{ 的最小质因子}
\end{cases}
\]&lt;p&gt;于是用与筛欧拉函数相似的方法：&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;vis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;cnt&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>线段树相关杂题</title><link>https://sichen-wang.github.io/blog/%E7%BA%BF%E6%AE%B5%E6%A0%91%E7%9B%B8%E5%85%B3%E6%9D%82%E9%A2%98/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E7%BA%BF%E6%AE%B5%E6%A0%91%E7%9B%B8%E5%85%B3%E6%9D%82%E9%A2%98/</guid><description>&lt;h3 id="lg5490-扫描线"&gt;[LG5490] 扫描线&lt;/h3&gt;
&lt;p&gt;扫描线模板题，从小到大枚举横线的纵坐标，枚举到矩形下界就给这条边的左右端点构成的区间 \(+1\)，否则 \(-1\)，用线段树维护，当前线段树有值的结点个数就是这个纵坐标的贡献。&lt;/p&gt;
&lt;p&gt;怎么维护线段树中不为 \(0\) 的位置数量呢？我们发现在做扫描线的时候权值不会小于 \(0\)，于是我们考虑维护区间最小值和最小值的数量，这个在合并的时候，如果左右儿子的最小值相同，则将其最小值数量加起来，否则继承最小值更小的那个的最小值数量。&lt;/p&gt;
&lt;p&gt;当然，本题还需要动态开点，所以需要维护区间内有效点的数量。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\log n)\)。&lt;/p&gt;
&lt;h3 id="spoj-gss-i"&gt;[SPOJ] GSS-I&lt;/h3&gt;
&lt;p&gt;先求出前缀和，发现答案为区间最大值减最小值，但需要满足最小值在最大值右边。&lt;/p&gt;
&lt;p&gt;对线段树的每个节点维护最小值，最大值和答案，发现答案可以从两棵子树的答案更新，也可以更新为右子树中的最大值减去左子树中的最小值。&lt;/p&gt;
&lt;p&gt;于是直接用线段树即可维护，时间复杂度 \(\Theta(n\log n)\)。&lt;/p&gt;
&lt;h3 id="spoj-gss-iii"&gt;[SPOJ] GSS-III&lt;/h3&gt;
&lt;p&gt;发现这题是带修版的 \(\rm GSS1\)，但是由于前缀和无法动态修改，于是考虑直接维护区间和。&lt;/p&gt;
&lt;p&gt;显然要维护区间和以及最大子段和，发现最大子段和需要通过左儿子的最大后缀和和右儿子的最大前缀和更新，于是再记最大前后缀和，而最大前后缀和是可以通过区间和和子节点的最大前后缀和计算的，于是这题就可以用线段树做了。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\log n)\)。&lt;/p&gt;
&lt;h3 id="spoj-gss-iv"&gt;[SPOJ] GSS-IV&lt;/h3&gt;
&lt;p&gt;我们发现，一个区间内如果全都是 \(1\) 或 \(0\)，那么对它开方是没有意义的，所以记录最大值，如果最大值为 \(0\) 或 \(1\)，那么直接跳过这个区间。&lt;/p&gt;
&lt;p&gt;我们发现这样做每个点最多被修改 \(7\) 次，故时间复杂度 \(\Theta(n\log n)\)。&lt;/p&gt;
&lt;h3 id="spoj-gss-v"&gt;[SPOJ] GSS-V&lt;/h3&gt;
&lt;p&gt;我们发现这个问题和 \(\rm GSS-I\) 很像，唯一的区别是左右两边限定了区间。我们发现如果两个区间不重合，那就是右区间最大值减左区间最小值。&lt;/p&gt;
&lt;p&gt;若两区间重合，令从左到右三个区域分别为 \(\rm I,II,III\)，首先用 \(\rm \max\{II\cup III\}-\min\{I\}\) 更新答案，然后用 \(\rm \max\{III\}-\min\{I\cup II\}\) 更新答案，最后只剩下两个端点都在 \(\rm II\) 内的答案，这个就是 \(\rm GSS-I\)。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\log n)\)。&lt;/p&gt;
&lt;h3 id="lg4198-楼房重建"&gt;[LG4198] 楼房重建&lt;/h3&gt;
&lt;p&gt;首先肯定将每个楼房的信息转化为斜率。显然要维护区间最大值和从这个区间左端点开始能看到多少栋楼。&lt;/p&gt;
&lt;p&gt;现在考虑将左右区间合并，显然要先将左区间的答案加上，然后考虑右区间能看到多少个点。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;如果左区间的最大值小于右区间的左区间的最大值，那么肯定对右区间的右区间没有影响，将右区间的右区间的答案加上，左区间递归。&lt;/li&gt;
&lt;li&gt;如果左区间的最大值大于右区间的左区间的最大值，那么右区间的左区间肯定一个都看不到，直接将右区间的右区间递归下去。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;单次合并时间复杂度 \(\Theta(n\log n)\)，总时间复杂度 \(\Theta(n\log^{2n})\)。&lt;/p&gt;
&lt;p&gt;\(\quad\rm PS:\) 这题有个坑点，计算右区间的右儿子的答案的时候不能写成 &lt;code&gt;ans[RS]&lt;/code&gt;，而是要写成 &lt;code&gt;ans[p] - ans[LS]&lt;/code&gt;，因为右儿子的答案可能会被左儿子挡掉一些，这些还是不能算进去。&lt;/p&gt;
&lt;h3 id="lg1502-窗口的星星"&gt;[LG1502] 窗口的星星&lt;/h3&gt;
&lt;p&gt;考虑将每颗行星变成一个带权矩形，我们发现最大亮度和就是最大矩形交的权值之和。&lt;/p&gt;
&lt;p&gt;考虑用扫描线，维护区间最大值即可。&lt;/p&gt;
&lt;p&gt;坑点 \(1:\) 由于边界上的点不用算，所以矩形右上角为 \((x+w-1,y+h-1).\)&lt;/p&gt;
&lt;p&gt;坑点 \(2:\) 我们在每次修改过后都统计了一遍答案，所以当线段纵坐标相同的时候，删除要排在前面，防止统计了一个不合法的大的答案。&lt;/p&gt;
&lt;h3 id="cf240f-torcoder"&gt;[CF240F] TorCoder&lt;/h3&gt;
&lt;p&gt;考虑一次操作干了什么事情，若存在一个以上字母出现了奇数次，则无法重排，否则将出现奇数次的字母放在最中间，然后将所有字母按照从小到大再从大到小的顺序放在这个字母的两边。&lt;/p&gt;
&lt;p&gt;于是可以对每个字母开一颗线段树，维护区间赋值操作和区间求数量操作即可。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\log n|\Sigma|)\)。&lt;/p&gt;
&lt;h3 id="cf242e-xor-on-segment"&gt;[CF242E] XOR on Segment&lt;/h3&gt;
&lt;p&gt;考虑对每一位开一颗线段树，问题就变成了维护一个 \(0/1\) 序列，支持区间取反和区间求和。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\log^{2n})\)。&lt;/p&gt;
&lt;h3 id="cf414c-mashmokh-and-reverse-operation"&gt;[CF414C] Mashmokh and Reverse Operation&lt;/h3&gt;
&lt;p&gt;我们发现这个题目中区间的结构很像一颗线段树，于是考虑它的性质。&lt;/p&gt;
&lt;p&gt;发现交换一个翻转一个区间等价于将它的两个子区间交换，然后递归操作。而一个区间的逆序对数量为两个子区间之间的逆序对数量加上两个子区间内部的逆序对数量。&lt;/p&gt;
&lt;p&gt;于是考虑维护每一层每一个结点的两个子区间之间的逆序对数量之和。这样，修改操作就变成了将某一层下面的所有区间翻转，由于层数只有 \(20\)，所以直接维护每一层是否被翻转即可。求当前的答案只需要预处理每一层的所有节点的两个子区间之间的答案之和即可，发现一层区间一定是一起翻转，于是每一层只有两种状态，分别预处理即可。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta[(2^{n}+m)n]\)。&lt;/p&gt;
&lt;h3 id="cf446c-dzy-loves-fibonacci-numbers"&gt;[CF446C] DZY Loves Fibonacci Numbers&lt;/h3&gt;
&lt;p&gt;我们知道 \(F_{n}=\frac{\sqrt{5}}{5}\left[\left(\frac{1+\sqrt{5}}{2}\right)^{n}-\left(\frac{1-\sqrt{5}}{2}\right)^{n}\right].\)&lt;/p&gt;
&lt;p&gt;于是可以发现只需要分别维护两个序列，在一个序列中公比相同。&lt;/p&gt;
&lt;p&gt;故我们只需要维护首项，后面的数可以直接算出来。下传的时候给左子区间直接加上这个首项，右子区间加首项乘上 \(q^{\frac{r-l+1}{2}}\) 即可。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\log n)\)。&lt;/p&gt;
&lt;h3 id="cf522d-closest-equals"&gt;[CF522D] Closest Equals&lt;/h3&gt;
&lt;p&gt;我们发现，如果记 \(p_{i}\) 表示距离 \(i\) 最近的在 \(i\) 之前的与 \(i\) 颜色相同的点与 \(i\) 的距离，那么对于一个询问 \([l,r]\)，其答案为所有满足 \(i-p_{i}\geqslant l\) 和 \(i\leqslant r\) 的点中，\(p_{i}\) 最小的那个。&lt;/p&gt;
&lt;p&gt;于是考虑将坐标离散化，然后将询问离线下来，按右端点排序，一个个枚举 \(i\)，若 \(p_{i}\not =0\)，则将 \(C_{i-p_{i}}\) 的值与 \(p_{i}\) 取 \(\min\)，可以发现，\(C\) 中区间 \([l,r]\) 内的最小值就是这个区间的答案。&lt;/p&gt;
&lt;p&gt;单点修改，区间查询，可以使用线段树维护。可以发现 \([l,r]\) 的答案和 \([l,n]\) 的答案是相同的，于是也可以使用树状数组维护后缀和。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n\log n)\)。&lt;/p&gt;</description></item><item><title>缩点 &amp; 割点 &amp; 割边</title><link>https://sichen-wang.github.io/blog/%E7%BC%A9%E7%82%B9-%E5%89%B2%E7%82%B9-%E5%89%B2%E8%BE%B9/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E7%BC%A9%E7%82%B9-%E5%89%B2%E7%82%B9-%E5%89%B2%E8%BE%B9/</guid><description>&lt;h2 id="tarjan-算法"&gt;Tarjan 算法&lt;/h2&gt;
&lt;h3 id="强连通分量"&gt;强连通分量&lt;/h3&gt;
&lt;p&gt;若图 \(G\) 中存在一个子图 \(G'\)，\(G'\) 中任意两点均可互相到达，则称 \(G'\) 为 \(G\) 的一个&lt;strong&gt;强连通分量&lt;/strong&gt;。若 \(G'\) 不存在一个严格子图为强连通分量，则 \(G'\) 为 \(G\) 的&lt;strong&gt;极大&lt;/strong&gt;强连通分量。&lt;/p&gt;
&lt;p&gt;图的强连通分量可以考虑使用 \(\rm Tarjan\) 算法求解。&lt;/p&gt;
&lt;p&gt;\(\rm Tarjan\) 算法的思想是这样的，如果一个点的 \(\rm dfs\) 序等于他能访问到的最小的 \(\rm dfs\) 序，那么在 \(\rm dfs\) 树中，它的下方会出现一个强连通分量，且所有最小能访问到的 \(\rm dfs\) 序等于它的点，属于这个强连通分量。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n+m)\)。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;参考代码：&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Tarjan&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dfn&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;low&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;tix&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;dfn&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]])&lt;/span&gt; &lt;span class="n"&gt;Tarjan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;low&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;low&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;low&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;SCC&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]])&lt;/span&gt; &lt;span class="n"&gt;low&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;low&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;dfn&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dfn&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;low&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;SCC&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;SCC&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Sta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="点边双连通分量"&gt;点/边双连通分量&lt;/h3&gt;
&lt;p&gt;如果在 \(\rm dfs\) 树上，某个结点 \(u\) 存在一个子节点 \(v\) ，满足 \(low_{v}\geqslant dfn_{u}\) ，则说明 \(v\) 想到达 \(u\) 的祖先结点必须经过 \(u\)，所以 \(u\) 是一个割点。&lt;/p&gt;
&lt;p&gt;当然，根节点不能通过这种方式来判断，应该看它的子节点数是否大于等于 \(2\)，如果是，则它为割点。&lt;/p&gt;
&lt;p&gt;遍历的时候要记得判掉父子边。&lt;/p&gt;
&lt;p&gt;和判断割点的方法几乎一模一样，唯一的区别是判断 \(dfn_{u}\lt low_{v}\) 而不是 \(dfn_{u}\leqslant low_{v}\)。（如果从 \(v\) 出发连 \(u\) 都无法到达，那么 \((u, v)\) 就是一条割边。&lt;/p&gt;
&lt;p&gt;判断割边的时候根节点不需要特殊考虑。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n+m)\)。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;参考代码：&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Tarjan&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;rt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dfn&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;low&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;tix&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;son&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;dfn&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;son&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Tarjan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;rt&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;low&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;low&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;low&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;low&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;dfn&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;rt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;cut&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;low&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;low&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;dfn&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;rt&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;son&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;cut&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="经典例题"&gt;经典例题&lt;/h2&gt;
&lt;h3 id="国家集训队-稳定婚姻"&gt;[国家集训队] 稳定婚姻&lt;/h3&gt;
&lt;p&gt;首先在夫妻之间连有向边 \(B_{i}\to G_{i}\)，然后在情人之间连有向边 \(G_{i}\to B_{i}\)。&lt;/p&gt;
&lt;p&gt;可以发现，若 \(G_{i}\) 和 \(B_{i}\) 的婚姻情况发生了改变，那么一定存在一个从 \(G_{i}\) 开始 \(B_{i}\) 结束的环。&lt;/p&gt;
&lt;p&gt;于是我们使用 \(\rm Tarjan\) 算法求强连通分量，若 \(B_{i}\) 与 \(G_{i}\) 属于同一个强连通分量，那他们一定属于一个环，则他们是不安全的，否则就是安全的。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n+m)\)。&lt;/p&gt;
&lt;h3 id="zjoi2007-最大半连通子图"&gt;[ZJOI2007] 最大半连通子图&lt;/h3&gt;
&lt;p&gt;首先缩点，发现强连通分量内的点一定属于同一个极大半连通子图。&lt;/p&gt;
&lt;p&gt;然后将 \(\rm DAG\) 画出来发现最大半连通子图一定是某条从无入度结点到无出度结点的链，长度和方案数直接 \(\rm DAG\) 上 \(\rm DP\) 即可。&lt;/p&gt;
&lt;p&gt;需要注意的是，在这题中，由于求的是导出子图，所以不能有重边。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n+m)\)。&lt;/p&gt;
&lt;h3 id="hnoi2012-矿场搭建"&gt;[HNOI2012] 矿场搭建&lt;/h3&gt;
&lt;p&gt;先把个点和点双连通分量处理出来，对每个点双分开处理：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;若该点双无割点，则需要建两个出口。&lt;/li&gt;
&lt;li&gt;若该点双有一个割点，则需要在这个点双内建一个出口，且不能建在割点上。&lt;/li&gt;
&lt;li&gt;若该点有两个以上割点，则不需要建出口，因为一定可以从某个割点跑出去。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;方案数直接乘法原理计算即可。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n+m)\)。&lt;/p&gt;
&lt;h3 id="haoi2010-软件安装"&gt;[HAOI2010] 软件安装&lt;/h3&gt;
&lt;p&gt;可以发现这是一棵基环外向树，依题意环中结点必须选，剩下的构成一棵树，直接树上背包即可。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(nm)\)。&lt;/p&gt;</description></item><item><title>虚树</title><link>https://sichen-wang.github.io/blog/%E8%99%9A%E6%A0%91/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E8%99%9A%E6%A0%91/</guid><description>&lt;h2 id="虚树"&gt;虚树&lt;/h2&gt;
&lt;p&gt;在一些问题中，我们只关心关键点的信息，同时我们需要维护他们之间的树形结构，于是可以想到将它们和它们之间的 \(\rm LCA\) 拉出来建一颗树，这棵树就被称作虚树。&lt;/p&gt;
&lt;p&gt;有一个朴素的想法，就是对它们两两求 \(\rm LCA\)，并且对求出的 \(\rm LCA\) 再求 \(\rm LCA\)，中途判重，最后按照祖先关系连边。&lt;/p&gt;
&lt;p&gt;经过观察可以发现，我们只需要按照 \(\rm dfs\) 虚从小到大的顺序枚举每个点，将相邻两点求 \(\rm LCA\) 即可。具体来说，我们可以维护一个栈，这个栈中存的是当前点在虚树上的所有祖先。设当前栈顶为 \(v\)，对于新加入的结点 \(u\)，我们对它进行分类讨论 ：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;若 \(\rm LCA(u,v)=v\)，那么直接将 \(u\) 入栈。&lt;/li&gt;
&lt;li&gt;若 \(\rm LCA(u,v)\) 是栈中某个不为 \(v\) 的点，则弹栈直到 \(\rm LCA(u,v)\)，每弹一个就向栈中比它深度多 \(1\) 的结点连边，最后并把 \(u\) 入栈。&lt;/li&gt;
&lt;li&gt;若 \(\rm LCA(u,v)\) 不在栈中，那么弹栈直到栈顶的 \(\rm dfs\) 序小于 \(\rm LCA(u,v)\) 的 \(\rm dfs\) 序，每弹一个就向栈中比它深度多 \(1\) 的结点连边，并把最后一个弹出的结点向 \(\rm LCA(u,v)\) 连边，最后把 \(\rm LCA(u,v)\) 和 \(u\) 入栈。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;不难发现这样一定是对的，并且设关键点数量为 \(k\)，则虚树内点数不超过 \(2k\)。&lt;/p&gt;
&lt;p&gt;在一棵有 \(n\) 个点的树上建立一颗有 \(k\) 个点的虚树的时间复杂度为 \(\Theta(k\log n)\)。&lt;/p&gt;
&lt;h2 id="经典例题"&gt;经典例题&lt;/h2&gt;
&lt;h3 id="sdoi2011-消耗战"&gt;[SDOI2011] 消耗战&lt;/h3&gt;
&lt;p&gt;首先有一个暴力 \(\rm DP\)，设 \(dp_{u}\) 表示将 \(u\) 的子树内所有关键点与 \(u\) 的联系断开所需要的最小代价。转移时枚举 \(u\) 的所有子节点，分类讨论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;若 \(v\) 为关键点，那么必须切断这条边，有 \(dp_{u}=dp_{u}+w_{u,v}\)&lt;/li&gt;
&lt;li&gt;若 \(v\) 不为关键点，那么可以切断这条边也可以从 \(dp_{v}\) 转移，故有 \(dp_{u}=dp_{u}+min\{dp_{v},w_{u,v}\}\)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;最终答案就是 \(dp_{1}\)，这个暴力的时间复杂度是 \(\Theta(qn)\)。&lt;/p&gt;
&lt;p&gt;观察到 \(\sum k\leqslant 5e5\)，所以考虑对每次询问建虚树。&lt;/p&gt;
&lt;p&gt;建虚树之前需要记 \(M_{u}\) 表示从 \(1\) 到 \(u\) 的路径上最短的边权，因为只需要切掉最短的边权就可以让点 \(u\) 与 \(1\) 不连通，而切上面的边是更优的，所以可以用 \(M_{u}\) 直接替换转移方程中的 \(w_{u,v}\)。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(\sum k\log n)\)。&lt;/p&gt;
&lt;h3 id="heoi2014-大工程"&gt;[HEOI2014] 大工程&lt;/h3&gt;
&lt;p&gt;首先建虚树。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;对于两两之间距离之和，可以计算每条边的贡献。&lt;/li&gt;
&lt;li&gt;对于最大\(/\)最小值，可以树形 \(\rm DP\) 或点分治。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;时间复杂度 \(\Theta(\sum k\log n)\)。&lt;/p&gt;
&lt;h3 id="sdoi2015-寻宝游戏"&gt;[SDOI2015] 寻宝游戏&lt;/h3&gt;
&lt;p&gt;我们发现如果将虚树建出来，那么答案就是虚树上所有边权之和的两倍。&lt;/p&gt;
&lt;p&gt;于是我们考虑动态维护虚树的边权之和。先把所有点的 \(\rm dfs\) 序求出来，然后我们发现边权之和等于 \(\rm dfs\) 序相邻两点的距离之和加上最左边和最右边两点的距离，于是我们可以使用 \(\rm set\) 维护，树剖求 \(\rm LCA\)。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\rm \Theta(n\log n)\)。&lt;/p&gt;</description></item><item><title>长链剖分</title><link>https://sichen-wang.github.io/blog/%E9%95%BF%E9%93%BE%E5%89%96%E5%88%86/</link><pubDate>Sat, 24 Jun 2023 11:00:56 +0000</pubDate><guid>https://sichen-wang.github.io/blog/%E9%95%BF%E9%93%BE%E5%89%96%E5%88%86/</guid><description>&lt;h3 id="长链剖分"&gt;长链剖分&lt;/h3&gt;
&lt;p&gt;考虑将重儿子设为链最长的那一个，剖分是简单的，可以做到 \(\Theta(n).\)&lt;/p&gt;
&lt;p&gt;这样剖分有一些性质：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;链长和是 \(n\)，因为每个点都在且仅在一条链中。&lt;/li&gt;
&lt;li&gt;任意点 \(x\) 的 \(k\) 级祖先 \(y\) 到它所在的长链底端距离不小于 \(k\) 。因为如果 \(x\) 和 \(y\) 在同一条长链上，那么 \(y\) 所在的长链长度不小于 \(k\) 。如果它们不在同一条的长链上，那么 \(y\) 到另一条长链底端的距离一定大于 \(k\)，否则的话 \(x\) 所在的链就可以接在 \(y\) 上成为更长的链。&lt;/li&gt;
&lt;li&gt;从任意一个点开始跳重链的次数最多是 \(\sqrt{n}\) 级别的。因为容易知道每次跳到的长链长度一定大于当前链，于是最坏情况是分别经过了长度为 \(1, 2, 3, \cdots, \sqrt{n}\) 的长链，最多跳 \(\sqrt{n}\) 次。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="thetan-log-n---theta1-算-k-级祖先"&gt;Theta(n log n) - Theta(1) 算 k 级祖先&lt;/h3&gt;
&lt;p&gt;考虑预处理每个点的 \(2\) 的幂次级祖先，对于一次询问 \((u, k)\)，首先跳到 \(u\) 的 \(highbit(k)\) 级祖先 \(v\) 上，由长链剖分的性质可知，\(v\) 到其所在长链底端的距离不小于 \(highbit(k).\)&lt;/p&gt;
&lt;p&gt;由于长链长度之和为 \(n\)，所以我们可以预处理每条链顶端节点的 \(l\) 级祖先，\(l\) 取遍不大于链长的所有整数。并且我们还可以存下每条链的所有节点，挂在链顶。&lt;/p&gt;
&lt;p&gt;这样，对于一次询问，假设 \(v\) 的 \(k - higtbit(k)\) 级祖先不超过链顶，那么可以直接查询，否则也可以从链顶跳若干步得到。由于 \(k - highbit(k) \lt hightbit(k)\)，故其一定小于链长，要查询的祖先是预处理过的。&lt;/p&gt;
&lt;p&gt;时间复杂度 \(\Theta(n \log n)\) 预处理，单次查询 \(\Theta(1)\)。&lt;/p&gt;</description></item></channel></rss>