Manuscript Offprint
arXiv:2610.16715The Online Steinitz Problem
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Inspired by Steinitz’s celebrated result (1913) and recent online vector-balancing results of Kulkarni et al. (2024) and Aden-Ali (2026), we introduce the online Steinitz problem: vectors in , each of -norm at most 1 and with total sum zero, arrive one at a time and must be assigned immediately and irrevocably to unused positions of an array. The goal is to keep every prefix sum of the resulting order small. We first obtain deterministic prefix-discrepancy bounds of for and for . Our main contribution is a general reduction that converts deterministic and randomized online vector-balancing algorithms, which assign signs to arriving vectors, into online ordering algorithms. Combined with recent vector-balancing results, this yields a randomized algorithm with prefix discrepancy and running time . The guarantee holds with high probability against an oblivious adversary. The reduction also gives bounds for sparse vectors and extends to inputs in arbitrary compact convex bodies. Finally, we prove matching lower bounds in both the deterministic and randomized cases.
1 Introduction
The classical Steinitz lemma asks how to order a zero-sum family of bounded vectors so that every prefix sum remains small [Ste13]. For vectors with and , the goal is to prove there exists an ordering distributes cancellation throughout the sequence instead of postponing it until the end. Indeed, Steinitz [Ste13] proved that there is a permutation such that
Establishing an upper bound for the Euclidean Steinitz constant has been a long-standing open problem. On 6 October 2026, OpenAI announced a proof of this bound [Ope26], which, if confirmed, would determine the constant depending on up to absolute factors. Beyond the importance of the mathematical question itself, the principle of the Steinitz lemma serves as a standard tool in discrepancy theory and integer programming, e.g., [Cho94, GS80, EW20].
We introduce the online Steinitz problem (OSP). In this problem, there are initially empty output positions, and vectors that arrive sequentially with and , identically to the offline case. Upon seeing , the algorithm must assign it immediately and irrevocably to an unused position , thereby building a permutation on the fly such that . The completed output is therefore and its prefix discrepancy by the end of the assignment is . Although the prefix discrepancy is an identical measure in both offline and the online case, the requirement of an immediate and irrevocable placement and the limited future knowledge leads to a substantially harder algorithmic task that we seek to investigate:
EPFL, Switzerland, {matteo.russo, jiaye.wei}@epfl.ch
The authors have not independently verified the announced proof, which none of this paper’s results requires.
Question. What is the worst-case online prefix discrepancy for immediate and irrevocable vector decisions, and how does this compare with the offline optimum?
We study this question under the oblivious adversarial model, which fixes the entire input independently of the algorithm’s randomness, and also under the adaptive adversarial model, which may choose each vector after observing the previous assignments. This means that, against the former kind of adversary, randomness may help, while against the latter it does not. We therefore write for the smallest discrepancy bound that a randomized algorithm can guarantee with probability at least on every fixed input. The corresponding optimal deterministic worst-case bound against adaptive inputs is denoted by .
The problem is reminiscent of online vector balancing (OVB) [BJSS20, ALS21, KRR24, Ade26]: in that case, an OVB algorithm chooses a sign for each arriving vector and controls signed prefix sums in arrival order. On the other hand, an OSP algorithm chooses among all vacant positions, and one placement may affect many output prefixes, which are evaluated only after the stream ends, and not after each arrival. We defer the reader to the survey of Bansal and Nikolov [BN26] for an extensive treatment of algorithmic discrepancy in its various forms, including offline and online.
A general reduction. In Section 2, we present a black-box reduction from online vector balancing to online Steinitz ordering. The reduction builds an OSP router from OVB subroutines, which we call signers. Its ordering guarantee is stated in terms of the signers' final vector and count bounds, or alternatively their subgaussian estimates. As a result, the same routing framework can use a range of deterministic or randomized signers, and any improvement in their balancing performance immediately yields stronger ordering bounds. The reduction also applies when the total sum of the input vectors is arbitrary and unknown in advance, and it ensures that every prefix remains close to its proportional share of this total. In addition, if the inputs lie in a known compact convex body of affine dimension , then any Euclidean proportional-prefix bound implies that the residuals lie in , where, as usual, . This extension does not require to be symmetric, and it preserves deterministic and probabilistic guarantees under the same adversarial model.
Deterministic bounds. Using the OSP router given by the reduction instantiated with deterministic OVB signers, in Section 3, we show that the optimal deterministic discrepancy is
As mentioned previously, both upper bounds hold against adaptive adversaries, and the higher-dimensional lower bound already holds in a fixed plane.
Tight bounds against an oblivious adversary. In Section 4, we instantiate the general reduction with Aden-Ali's randomized OVB signer [Ade26] and obtain a prefix discrepancy of
(1.1) with probability at least . This guarantee is achieved efficiently, with the overall procedure having a running time of , and furthermore yields a guarantee of in the -norm. Furthermore, we can instantiate our reduction with a different OVB signer for zero-sum inputs in with at most nonzero coordinates, and -norm as large as . Specifically, the signer of Altschuler-Tikhomirov [AT26] gives coordinatewise discrepancy whenever the failure bound in Corollary 4.4 is at most .
Matching lower bounds. In Section 5, all hard inputs consist of an initial stream followed by identical vectors that cancel its total. An all-ones initial stream and Tijdeman–Wagner [TW80] give an lower bound; coordinate cycles and Roth’s method [Rot54] give , where . Both hold for every . Their sum matches the upper bound of (4.3) whenever for fixed . An adaptive initial stream in a fixed plane gives the matching deterministic lower bound for .
1.2 Related work
The Steinitz lemma and its extensions. In the offline setting, the classical Steinitz lemma [Ste13] guarantees that a zero-sum family of bounded vectors admits an ordering whose prefix sums are bounded independently of the number of vectors. Grinberg and Sevastyanov [GS80] established the bound in every -dimensional normed space. For the -norm, improving the dimension dependence to remains a longstanding conjecture, with a matching lower bound. Recent work of Ambrus and Heck [AH26] relates this problem to ordering nearly unit vectors with arbitrary total sum, measuring each prefix against its proportional share of that total. Another direction concerns simultaneous rearrangements: Oertel et al. [OPW24] proved a colorful Steinitz lemma that permutes several sequences while controlling their combined prefixes independently of the number of sequences. Bárány [Bár24] improved their bound to . Steinitz lemma also has algorithmic applications beyond discrepancy, as for instance, the work of Eisenbrand and Weismantel [EW20] which used it to establish proximity bounds and faster algorithms for integer programming.
Online vector balancing and scheduling. Online vector balancing replaces rearrangement by sequential sign choices. Bansal et al. [BJSS20] studied stochastic inputs drawn independently from an arbitrary distribution and obtained applications to geometric discrepancy. For oblivious adversarial inputs, Alweiss et al. [ALS21] introduced the self-balancing walk, giving efficient algorithms with logarithmic prefix discrepancy for Euclidean unit-ball vectors. Kulkarni et al. [KRR24] subsequently obtained a universal subgaussian guarantee for each signed prefix. This implies maximum prefix discrepancy with high probability, matching their lower bound against oblivious adversaries. Aden-Ali [Ade26] obtained the same asymptotic guarantee with an -time algorithm. For coordinate-bounded vectors with at most nonzero coordinates, Altschuler and Tikhomirov [AT26] obtained online prefix discrepancy above a near-logarithmic sparsity threshold. Online vector scheduling [IKKP19] likewise requires irrevocable allocation of arriving vectors, but distributes nonnegative demand vectors among machines to optimize their loads, whereas OSP assigns vectors to ordered positions and exploits cancellation to control all prefix sums.
Signing, rearrangement, and geometric discrepancy. The connection between signing and rearrangement predates their online versions. Bárány and Grinberg [BG81] proved that every prescribed sequence of unit vectors in a d-dimensional normed space admits offline signs for which all signed prefixes have norm at most . Chobanyan's transference theorem [Cho94] shows that a uniform bound for this offline prefix-signing problem also bounds the Steinitz constant, without increasing the bound. However, this does not transfer to the online setting as argued in Section 2.5. Controlling only the final signed sum is a different problem. For example, Ambrus and Bozzai [AB24] proved sharp Euclidean bounds for colorful vector balancing, where one selects a vector from each prescribed family and controls the sum of the selected vectors. Our lower bounds use another connection to discrepancy: points record arrival times and assigned positions. Schmidt's planar rectangle-discrepancy theorem [Sch72] gives the deterministic scalar bound; Tijdeman–Wagner's strengthening [TW80] and a restricted form of Roth's orthogonal-function argument [Rot54] yield the oblivious bounds. For a broader account of these topics and their algorithmic connections, see the monograph manuscript of Bansal and Nikolov [BN26].
Online sorting and online TSP. Our placement model is also closely related to online sorting [AABK23] and its extension to online TSP [ABB 24, Ber25]: arriving numbers or points must be assigned immediately and irrevocably to unused array positions. It is worth noting that the work of Azar et al. [APV26] further studies the tradeoff between array size and competitiveness for online metric TSP, obtaining a deterministic -competitive algorithm with 2T cells. Their placement constraint coincides with ours when the array has exactly T cells, but their objective controls distances between consecutive entries rather than cumulative vector sums. Their tree-based placement scheme organizes points by metric proximity, whereas our reduction uses online signing to balance the sums routed to subintervals. More generally, these problems minimize the total distance between consecutive entries, whereas OSP controls the norm of every prefix sum. Geometrically, their inputs are points to connect by a short path, while ours are steps to arrange into a walk that stays close to the origin through cancellation.
2 The signing-to-ordering reduction
The reduction repeatedly divides the output positions into two nearly equal intervals. At each division, an online signer proposes a child for the arriving vector, and the router can only override this choice when it has to avoid an interval that is already full. We first describe this algorithm, then state the signing guarantees that suffice and prove how its local splits control every output prefix.
2.1 The ordering algorithm
We first introduce some notation, beginning with the definition of residuals.
Residuals. For the completed ordering , write tot := and define the prefix residual for each and the maximum residual by
These residuals measure deviations from proportional shares of the total and become ordinary prefix sums when tot = 0. Hence, for some upper bound achieved deterministically or in high probability, we have that, if then , since tot = 0. We next describe the position tree and the meta-algorithm needed for our reduction.
The position tree. Our algorithm assigns each arriving vector to an output position by routing it through a balanced binary tree. This tree has the output positions as its leaves, and so has height . Each node represents a consecutive interval which consists of the output positions labeling the
Algorithm 1 Tree routing with local proposal rules
Require: Horizon T, local routines , and vectors arriving one at a time.
Ensure: An online permutation , with .
1: Build the balanced position tree with capacities .
2: for each internal node do
3: Initialize once.
4:
5: , .
6:
7: Receive and set .
8: while is not a leaf do
9: .
10: .
11: if then
12: .
13: else if then
14: .
15: if then
16: .
17: else
18: .
19: , .
20: .
21: , .
leaves in the subtree rooted at . The node has capacity with children of capacities and , respectively.
As illustrated in Algorithm 1 and Fig. 1, each internal node uses a persistent local signer to propose +1 (left) or -1 (right). The router follows this proposal unless the requested child is full, in which case it uses the other child. Repeating the decision until a leaf is reached assigns the vector's output position immediately. During the descent, the algorithm records in how many positions are already filled in child , and in the sum of the corresponding vectors. The arguments of are the arriving vector , the child sums , and the remaining capacities . Here the semicolon separates from the routing statistics. In particular, the scalar rule in Section 3 uses these statistics directly, while, for a Euclidean signing subroutine, the node submits the augmented vector , so the extra coordinate balances left and right counts along with the original vector coordinates.
Each local signer receives every vector reaching its node, even after one child fills, and updates its private state with its proposed sign. We stress that only the router overrides the destination. Moreover, we also note that randomized copies have independent tapes, independent of the input, and different rules may be used at different node sizes.
2.2 The reduction guarantee
To state the guarantee of Algorithm 1, we first identify which local splits contribute to the discrepancy of a given output prefix. Since the node intervals are consecutive, a prefix cuts through at most one interval at each depth. For each prefix , where , the corresponding boundary path consists of the internal nodes whose intervals meet both and , with and .

Figure 1: Routing an arriving vector when . At each visited internal node, the local rule selects one of the two child intervals. The highlighted path assigns to output position 6.
Every ancestor of a node in also belongs to , hence these nodes form a path which is ordered by increasing depth. We will show that the prefix residual is a weighted sum of the split errors along this path. The reduction therefore depends on how well the local signers control these errors, which we quantify next.
Signers. An online signer returns upon receiving . We say it has subgaussian scale if, for every fixed stream in the Euclidean unit ball and every ,
The expectation is over its randomness, independent of the input, which gives Gaussian-type tails in every direction. Our randomized reduction uses a common scale in dimension for all node capacities, and needs only this final signed-sum guarantee, rather than a guarantee for every signed prefix.
The following theorem separates the property needed from the signer from the resulting ordering guarantee. Terminal vector and count bounds give a sum of local errors, while a subgaussian bound permits a sharper estimate for their combined effect.
Theorem 2.1 (Signing-to-ordering reduction). Algorithm 1 assigns every vector immediately to an unused position and does not need to know the input total. Randomized local signers use independent tapes, independent of the input.
(i) Terminal vector and count bounds. Suppose the input vectors have norm at most one in a fixed norm . At a node receiving , suppose the signer's proposed signs satisfy
Whenever these inequalities hold at all internal nodes, every output prefix satisfies
If they hold for every local stream, this is a deterministic guarantee against adaptive inputs. If, for each fixed length-m stream, they hold jointly with probability at least , then for every oblivious input (2.3) holds simultaneously for all prefixes with probability at least .
(ii) Subgaussian terminal sums. Suppose the inputs are in the Euclidean unit ball and the signer has scale in the sense of (2.2), in dimension and for every node capacity. Then, for every oblivious input and , with probability at least ,
where C is an absolute constant.
Both parts require only the terminal guarantee for each local stream. For zero-sum inputs, the residuals are the ordinary prefix sums.
Part (i) will give the deterministic Euclidean and sparse-vector bounds. Part (ii) will give the randomized Euclidean bound without paying a separate norm bound at every node. The sharper dimension-dependent bound follows by using deterministic routing near the leaves.
2.3 From local splits to output prefixes
We prove Theorem 2.1 by first relating the output prefixes to the errors of the local splits. The identity in Lemma 2.2 shows that each prefix depends only on its boundary path; Lemma 2.3 then bounds each split error in terms of the signer's proposed signs and the corrections needed to enforce capacities. Combining these two facts with the triangle inequality will prove part (i). For part (ii), we will use the conditional subgaussian estimates to bound the sum along the path.
Before continuing, we define quantities only needed in the analysis. Namely, we let be the set of strict ancestors of in the tree and, throughout, conditioning on means conditioning on the complete random tapes of all nodes in . Furthermore, for the completed ordering,
Thus is the left child's error relative to its proportional share of the parent total, and the right child's error is . To track the same discrepancy within an interval, for we set
This is the deviation of the first positions in from their proportional share of , so and . For , we also set
When the prefix ends in the left child, this coefficient is the fraction of that child included in the prefix; when it ends in the right child, it is the fraction of that child excluded from the prefix. At the boundary between the children, it equals one. The following identity shows that these fractions are exactly the weights with which the local split errors contribute to the prefix residual.
Lemma 2.2 (one-boundary-path identity). For every output prefix k, the boundary path and coefficients above satisfy
Proof. The cases are immediate. At a node , write . If , the local prefix lies entirely in the left child, and adding and subtracting gives
Here , since . If instead with , the prefix contains the whole left child and the first positions of the right child, so
In this case , since . Starting with , each substitution therefore adds the term and leaves only the residual in the child crossed by the prefix boundary. More explicitly, when the recursion reaches a node , it has established
The formulas above preserve this identity as we descend to the unique child that meets both the prefix and its complement. If the prefix ends between the two children, then and the remaining residual is ; a residual at a leaf is also zero. Thus the recursion visits exactly the nodes of and leaves no residual term, proving (2.6).
The path identity reduces the ordering problem to controlling at each node. The signer supplies a proposed split, whereas comes from the split after capacities have been enforced. The next lemma connects the two: it expresses as a centered signed sum plus a correction controlled by the signer's count imbalance. It also records the conditional estimates needed later to combine these errors along a path.
Lemma 2.3 (one-node quota repair). Let be an internal node of capacity , receiving Euclidean unit-ball vectors , and write . Let be the proposed signs and the quota-corrected routing signs, where means left, and put , for succinctness. Then the local proportional error of (2.5) has a decomposition
Under the subgaussian hypothesis of Theorem 2.1, for a fixed input, conditionally on the routing tapes at the strict ancestors of , for every unit vector and every ,
Proof. We first count the changes made by quota repair. Since the children receive exactly their prescribed numbers of vectors, the corrected signs satisfy . Once a proposal is overridden, one child is full, so every later override changes a proposal in the same direction. Each change alters the signed count by two, and comparing the proposed count with the corrected count therefore gives
| arrival | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| proposed sign | + | + | - | + | - | + | - | + |
| routing sign | + | + | - | + | - | + | - | - |
Each child has capacity four.
The left child fills after arrival 6; proposal 8 is overridden.
Figure 2: Enforcing capacities without changing the signer's internal decisions. The proposed signed count is 2, the required count is 0, and exactly one sign is overridden.
Fig. 2 illustrates this identity for even and . To translate this into a bound on the split error, we simply use and to write
Each overridden sign contributes one vector , whose norm is at most two because both and lie in the unit ball. Together with (2.9), this yields .
We now turn to the conditional estimates, and fix the complete tapes of the strict ancestors of . The original input is fixed, and ancestor routing never consults descendant signers, so these tapes determine the entire stream reaching , while its private tape remains independent with its original distribution. We can therefore apply (2.2) to the augmented stream , whose terminal signed sum is . Taking gives
which substituted in (2.2) proves (2.7). Similarly, we may choose , which has squared norm and inner product with the augmented signed sum, giving (2.8).
We thus turn to the proof of the terminal vector and count bounds in Theorem 2.1.
Proof of Theorem 2.1 (i). First, note that the same quota calculation applies in any norm. Moreover, with the notation of Lemma 2.3, each override changes the signed vector sum by a vector of norm at most two. Hence (2.9) and the two terminal bounds assumed in part (i) of the statement give
We now have
where the equality holds by definition of the exact proportional error and the inequality by the fact that . Applying the triangle inequality to Lemma 2.2 now gives

Figure 3: Conditioning from the deepest node upward, illustrated for T = 8 and k = 5. The highlighted path contains the root, v, and u. When conditioning on the strict-ancestor tapes of u, the summands at the root and v are fixed, so only the exponential factor at u needs to be averaged. After removing that factor, the same argument applies at v, and then at the root.
which is (2.3). This argument holds for every realized input and collection of proposed signs, so a deterministic signer satisfying the terminal bounds on every stream also gives the claimed guarantee against adaptive inputs.
For the probabilistic statement, fix an oblivious input and say that a node fails if either of its two terminal bounds is violated. Conditioning on its strict-ancestor tapes fixes its entire input stream while leaving its own tape independent, just as in Lemma 2.3. The assumed fixed-stream guarantee thus bounds its conditional failure probability by . Taking expectations and then a union bound gives
Outside this failure event, all local bounds hold and the pathwise argument above applies simultaneously to every prefix, which gives the first part of the theorem.
2.4 Combining randomized errors
For part (ii) of Theorem 2.1, we use the decomposition in Lemma 2.3 to combine the centered signed sums before taking their norm, and then bound the quota corrections through the count imbalances. The errors along a path need not be independent, because ancestor decisions determine the streams reaching their descendants. The conditional estimates in (2.7) and (2.8) let us handle this dependence by conditioning successively from the deepest node to the root.
Lemma 2.4 (conditional composition). Assume the subgaussian condition of Theorem 2.1, and write for the quantities in Lemma 2.3 at node . There is an absolute constant such that, for every prefix and every ,
Proof. The statement is immediate when is empty, so assume otherwise. We first reduce the vector bound to a scalar tail estimate by choosing a 1/2-net of the Euclidean unit sphere with at most points. For every nonzero vector , a net point within distance 1/2 of has inner product at least with . Consequently, a union bound over the net proves (2.11), with , as soon as we show that every fixed unit vector satisfies
Indeed, a norm exceeding forces at least one net direction to exceed the displayed threshold, and . It thus remains to prove this directional estimate.
To this end, let us fix and , and note that the path and its coefficients depend only on the position tree and , so they are deterministic. Let be the deepest node of so that every other node is a strict ancestor of (see Fig. 3). Since depends only on the tapes at and its ancestors, conditioning on all strict-ancestor tapes of fixes every term except the one at . Its own tape remains independent, and (2.7), applied with , bounds its conditional exponential moment. Pulling out the fixed terms and then taking expectations gives
Thus averaging over the tape at removes its term from the sum, at the cost of the deterministic factor . If any terms remain, the parent of is now the deepest node, and the same calculation applies with that parent in place of . Continuing upward to the root removes one term at a time and multiplies these factors, giving
The last inequality uses and . Chernoff's bound with now yields
which is precisely the directional estimate needed above.
For the count imbalances, we use the same conditioning argument, now with (2.8). For , the inequality gives
Removing the nodes from deepest to root as before, and using and , we obtain . Markov's inequality with therefore gives
which proves (2.12).
Proof of Theorem 2.1 (ii). For all residuals vanish, so assume . Fix and use Lemmas 2.2 and 2.3 to write
The first term is controlled by (2.11), while and give
Thus (2.12) controls the second term. Apply both estimates with and take a union bound over the prefixes. The total failure probability is at most , so with probability at least ,
Finally, and , so (2.13) is at most after increasing the absolute constant, yielding (2.4).
2.5 Some remarks on the reduction
Compact convex bodies. Both parts of Theorem 2.1 extend to inputs in a known compact convex body of affine dimension . Let us consider any . Then, any Euclidean online router in dimension with proportional-prefix radius gives, after a fixed affine normalization,
with the same deterministic or probabilistic guarantee and under the same adversarial model. Neither symmetry of K nor advance knowledge of the total is required.
Indeed, John’s theorem in the relative affine space of gives a centered ellipsoid and with and , where the second inclusion follows by subtracting from . Fix a linear isomorphism from onto with , and feed to the Euclidean router. These vectors lie in the unit ball, and translation cancels from proportional residuals:
Thus, whenever all normalized residuals have norm at most ,
This implication holds for every realized run. Since the normalization is fixed before the stream, it preserves online decisions and the original deterministic or probabilistic guarantee, including its adversarial scope. If s = 0, every proportional residual is zero.
Comparison with offline transference. Chobanyan's transference theorem [Cho94] converts a uniform offline prefix-signing bound into the same ordering bound. Indeed, choose an ordering of a zero-sum unit-ball sequence minimizing its maximum prefix norm , and sign it with prefix bound . Place the positively signed vectors first in their old order, followed by the negatively signed vectors in reverse order. Each new prefix is a positive-sign partial sum of the old order or, by the zero total, the negative of a negative-sign partial sum. Each is half a sum or difference of an old unsigned prefix and its signed prefix, so minimality gives and hence . This argument chooses its initial ordering using the complete input. Our reduction uses terminal vector and count guarantees and commits immediately to positions, incurring losses from quota repair and accumulation along tree paths. As shown in Section 5, a loss is unavoidable already on the line: greedy signing has bound one, whereas deterministic online ordering requires discrepancy.
3 Deterministic applications
We apply Algorithm 1 with deterministic signing rules, first a scalar rule and then greedy vector signing. The scalar rule gives a stronger local invariant on the line; for greedy vector signing, we use the norm-and-count interface of Theorem 2.1 directly.
Theorem 3.1 (Deterministic OSP upper bound). For every , it holds that
These upper bounds hold against adaptive adversaries.
3.1 Scalar routing
We begin by giving a proof of the scalar upper bound in Theorem 3.1.
Proof of Theorem 3.1 for . We use the following local rule at every node of Algorithm 1, interpreting a left proposal as +1 and a right proposal as -1. Fix a node . For the local argument, write , for the sums already sent to its children and , for their remaining capacities; once the node is full, and . We maintain
Here and are the child totals if all remaining positions receive the same value y. The inequality fails exactly when one total exceeds 1 and the other is below -1. Initially , so the two totals have the same sign and the invariant holds.
If one child is full, the local rule proposes the other, so the meta-algorithm follows that proposal. Otherwise, propose a destination according to
Thus the hypothetical total determines which comparison the local rule uses; the meta-algorithm updates the chosen sum and capacity and continues from that child. For preservation, suppose both children have space, the hypothetical total using is nonnegative, and the rule chooses left. A subsequent completion with would give child totals and .
There are only two possible violations of the invariant: first, suppose the new left total exceeds 1 and the right total is below -1. The left total changed by , so its previous value must exceed -1. Together with , this gives
contradicting the choice of the smaller ratio. Second, suppose the new left total is below -1 and the right total exceeds 1. The old invariant at y requires , so the assignment must have decreased this total, meaning . Therefore
Applying the old invariant at now forces , and hence , contradicting the assumed nonnegative total. Choosing right is symmetric, and the negative-total case follows by reversing all signs.
Forced routing also preserves the invariant. Indeed, if the left child is full, assigning right and then filling its remaining positions with gives the same totals as the previous hypothetical completion with common value . The old invariant applies directly; the other case is symmetric.
At completion, , so the invariant becomes
Since nothing in the argument requires equal child capacities, the rule applies directly to the balanced tree for every T.
To conclude, fix an output prefix . Starting from the root, split only the intervals in , as illustrated in Fig. 4. Each split increases the sum of absolute interval totals by at most 2. After these splits, the prefix is a union of complete intervals, so the triangle inequality gives
The last inequality uses the zero root total and the tree height. The invariant holds for every arriving value, so the guarantee also holds against adaptive adversaries.
3.2 Greedy signing in arbitrary dimension
The same routing algorithm, using a greedy signer at each node, controls proportional-prefix residuals even when the total is nonzero. Hence, the upper bound in Theorem 3.1 for immediately follows since, for zero-sum inputs, the residuals are ordinary prefix sums.
Proposition 3.2 (Deterministic proportional routing). For every stream of Euclidean unit-ball vectors, Algorithm 1 with greedy signing of satisfies
This bound holds against adaptive adversaries and requires no advance knowledge of the total.

Figure 4: Analyzing [1, 5] when . Only a partially included interval is split; shaded blocks are wholly inside the prefix. Each refinement costs at most 2 in the sum of absolute block totals, so three refinements bound this prefix by 6.
Proof. At an internal node , let be its th arriving vector and let be the signer's augmented signed sum after that arrival, initially . Choose so that
breaking ties in favor of , and update . The update records the proposed sign even if the algorithm overrides its routing request. Expanding the squared norm gives
Thus the vector and count imbalances obey the joint bound
The local estimate in the norm-and-count part of Theorem 2.1, followed by Cauchy–Schwarz, therefore gives
The boundary-path conclusion of Theorem 2.1 now yields
Indeed, every internal node has children of capacity at most , so a node at depth has capacity at most , and contains at most one node at each depth. Every estimate holds for every local stream, which also proves the adaptive guarantee.
4 Randomized applications
The reduction in Theorem 2.1 accepts any online signer satisfying its terminal guarantees, and, as in the deterministic case, this flexibility yields several randomized applications. As our main application, we use Aden-Ali's signer [Ade26] since it satisfies the subgaussian hypothesis in part (ii) and can be implemented efficiently. Moreover, we will derive a coordinatewise bound from it, and a sparse-vector application from the norm-and-count guarantees in part (i) and the Altschuler–Tikhomirov's signer [AT26]. Throughout this section, inputs are fixed independently of the algorithm's randomness, and all bounds allow arbitrary, initially unknown totals and become prefix-discrepancy bounds when the total is zero.
4.1 Efficient randomized ordering
Corollary 4.1 (Efficient signer). For every , , and , Algorithm 1 with the Aden-Ali signer uses arithmetic operations and, for every fixed Euclidean unit-ball stream, satisfies, with probability at least ,
Proof. We apply part (ii) of Theorem 2.1, whose assumption is the terminal moment-generating-function bound (2.2) in dimension . Specifically, at a node receiving , we run an independent copy of Aden-Ali's signer on so that . We keep this copy running throughout the local stream, recording its proposed signs even when the router overrides a destination to enforce the child capacities.
To verify the required assumption in (2.2), we observe that, for every fixed augmented stream, Aden-Ali's signer's guarantee [Ade26, Theorem 1 and Equation (5)] represents the terminal signed sum as , where are Gaussian vectors that may be dependent. Then, for every , Hölder's inequality and the Gaussian moment-generating function give
Hence, (2.2) is verified with , uniformly over all node capacities. Furthermore, conditioning on a node's strict-ancestor tapes fixes its input stream while leaving its own tape independent, and thus, (4.1) also supplies the conditional hypothesis used in Lemmas 2.3 and 2.4.
For completeness, we spell out the resulting substitutions in the reduction: set and , and, with , the two estimates of Lemma 2.4 read, for each ,
A union bound over these two events and the prefixes has total failure probability at most . Outside this failure event, Lemmas 2.2 and 2.3 give, for every ,
where the last step uses , and .
Finally, a length-m signer in dimension uses arithmetic operations, and, since at each depth, the node capacities sum to at most T, and there are at most h internal levels, the overall running time .
We next discuss an alternative signer and establish a sharper dimension dependence.
Using an inefficient signer. If computational efficiency is not required, the reduction also allows the Kulkarni–Reis–Rothvoss’s signer in place of Aden-Ali’s. For each fixed augmented unit-ball stream, its terminal guarantee is [KRR24, Theorem 1]
At each node, sample an independent uniform sign before processing its stream, and send as the proposals without changing the Kulkarni–Reis–Rothvoss signer’s internal updates. The terminal sum is then symmetric and centered, while (4.2) is unchanged. Accordingly, we call this the symmetrized Kulkarni–Reis–Rothvoss’s signer. By [KRR24, Lemma 11],
Thus (2.2) holds with , and Theorem 2.1(ii) gives the same probability and discrepancy bound as Corollary 4.1, up to the absolute constant. Only the efficiency guarantee is lost, since the finite-horizon Kulkarni–Reis–Rothvoss’s construction takes exponential time [KRR24, Sections 6–7].
Lemma 4.2 (Sharper dimension dependence). For every , , and , there is a randomized router such that, for every fixed Euclidean unit-ball stream, with probability at least ,
where . With the Aden-Ali signer, the running time is . The same bound holds with the symmetrized Kulkarni–Reis–Rothvoss’s signer, with a different absolute constant and without the running-time guarantee.
Proof. Use the randomized signer only at nodes strictly above a depth , and the deterministic router of Proposition 3.2 within each remaining interval. For , apply Lemma 2.4 with path length at most and tail parameter . A union bound over the two estimates at each of the at most nontrivial interval endpoints bounds all their residuals by with probability at least . Inside an interval, a global residual equals the local proportional residual plus a convex combination of the two endpoint residuals. Since each interval has length at most , Proposition 3.2 therefore gives
on the same event, where the ceiling is absorbed into the constant because .
For , this is the deterministic bound. When , choose . Then and . Comparing this choice with before the stream begins gives (4.3). For , use . The running time remains with the Aden-Ali signer, since the total node capacity at each depth is at most . The same probability argument applies to the symmetrized Kulkarni–Reis–Rothvoss’s signer. Finally, if for fixed , then .
4.2 Coordinatewise discrepancy
The next consequence uses the directional estimates in the proof of part (ii) of Theorem 2.1. A union bound over the relevant coordinate directions replaces the sphere net used for the -norm.
Corollary 4.3 (Coordinatewise ordering). For every fixed Euclidean unit-ball stream and , Algorithm 1, using either the symmetrized Kulkarni–Reis–Rothvoss’s signer or the Aden-Ali signer throughout the full tree, satisfies, with probability at least ,
Proof. The proof of Corollary 4.1 verifies (2.2) with an absolute scale for either signer. We use the same path decomposition and quota-repair estimate as in Theorem 2.1, but first identify which coordinates need a probabilistic estimate. By Cauchy–Schwarz and the unit-ball assumption,
which implies that at most coordinates satisfy . Every other coordinate has residual of magnitude at most one for every permutation: in a proportional residual, each input coordinate has coefficient either or , both of absolute value at most one. It is worth noting that the exceptional coordinates depend only on the fixed input and are used only in the analysis, and the algorithm does not need to identify them.
For any fixed unit direction z, the conditional moment calculation in the proof of Lemma 2.4, followed by Chernoff's bound, gives, for all ,
Apply this estimate to both signs of each exceptional coordinate direction. Also apply the count estimate (2.12) at each prefix. There are at most events in total, so choosing and taking a union bound makes them all hold with probability at least .
On this event, the centered path sum in every exceptional coordinate has magnitude at most . The correction is controlled without a union bound over coordinates, because
Combining the two estimates gives, at every prefix and in every exceptional coordinate, a residual of magnitude at most
Now and . Absorbing the bound one for the remaining coordinates proves the claim. The running-time calculation is the same as in Corollary 4.1.
4.3 Sparse vectors
Here we apply part (i) of Theorem 2.1 in the norm, with the input vectors that need only be coordinate-bounded, and their -norms may be as large as . In particular, we use copies of the Altschuler–Tikhomirov signer [AT26].
Corollary 4.4 (OSP for sparse vectors). For every , there is a constant with the following property. Let , let be a sparsity bound known in advance, and let . Write
and suppose that . Then, for every fixed stream with , Algorithm 1, using the Altschuler–Tikhomirov signer, satisfies, with probability at least ,
Proof. Fix and . At a node receiving , append the quota coordinate and give to an independent copy of the signer of Altschuler–Tikhomirov [AT26, Theorem 1.1], with announced sparsity . Thus, each augmented vector belongs to and has at most nonzero coordinates. Moreover, note that no Euclidean normalization is needed here, because we are using the norm-and-count part of the reduction with the norm. Next, for each fixed local stream, the signer’s simultaneous-prefix guarantee implies, at the terminal prefix,
except with probability at most
We have enlarged , if necessary, so that the same constant works in both estimates. The first terminal bound comes from the original coordinates, and the second comes from the appended quota coordinate. Thus the two hypotheses of part (i) of Theorem 2.1 hold jointly with .
Although the stream reaching a node is random, it is determined by its strict-ancestor tapes. Conditional on those tapes, the node's own signer is an independent copy on a fixed stream: this is the conditioning argument in Theorem 2.1, so its failure bound applies at every node. At each depth, the node capacities sum to at most T, and there are at most h internal levels, so
With probability at least , all local terminal bounds hold. On this single event, (2.3) gives, for every output prefix,
This gives the stated asymptotic bound as .
5 Lower bounds
In this section, we prove lower bounds that match our deterministic upper bounds and, for constant and polynomially small failure probabilities, our randomized upper bounds. All our hard inputs use the same zero-sum completion: stop an initial stream and fill the remaining arrivals with identical vectors that cancel its total. For the randomized bounds, the initial stream consists of coordinate cycles, stopped at a time chosen independently of the algorithm's random tape. For the deterministic bound in a plane, the initial stream instead depends on the algorithm's previous assignments.
Theorem 5.1 (Deterministic and randomized OSP lower bounds). For and , it holds that
and, for and ,
The deterministic bound for already holds in a fixed plane. The oblivious hard inputs are independent of the algorithm’s random tape.
5.1 The input construction
We first explain the construction of the hard inputs which will be used throughout this section. Fix . Consider the following input: after presenting vectors with , present copies of . These repeated vectors remain in the unit ball since . Let be the position assigned to by the algorithm. Then the first output positions contain exactly repeated vectors, hence the prefix residual is
For the randomized lower bounds, suppose that and set . For each , the initial stream consists of cycles through the coordinate vectors, giving the fixed input
where . The point is that the algorithm cannot know when the coordinate cycles will stop. Indeed, fix a random tape and let be the position assigned to in cycle when the algorithm runs on . Clearly, these same positions describe its first cycles on every , since the inputs agree up to time .
5.2 Deterministic lower bounds
We prove a logarithmic lower bound in dimension one and a square-root lower bound in every dimension at least two.
Lemma 5.2 (Deterministic lower bounds). There exists an absolute constant such that, for every and , every deterministic online ordering algorithm has a fixed zero-sum unit-ball input satisfying
For , the input can be chosen from the family (5.2); for , the input lies in a fixed plane.
Proof. On the line, let us take and write for the common positions in the construction above. Let be the absolute constant in Schmidt's theorem [Sch72, Theorem 2]. Applied to the points , it gives such that
Here the cardinality counts the points in , while is times the area of this rectangle. We now set and , and note that rounding the upper sides to and preserves the point count because if and only if and if and only if . In addition, this changes the area term by at most
The reverse triangle inequality therefore gives
On the input , the completion identity (5.1) becomes
Since , this proves the logarithmic lower bound for all sufficiently large .
For the planar bound, we proceed in a similar way to Spencer [Spe77, Spe94], and present the proof for completeness. Indeed, let us assume , take , and focus on the output prefix . During the first arrivals, let if the algorithm assigns to one of the first positions, and otherwise, and write , with . We choose the vectors so that the difference between the two groups grows, while their total stays small enough that the completion cannot cancel this difference. At time , choose a unit vector in the plane spanned by , perpendicular to , reversing its orientation if necessary so that . This choice uses only previous assignments, and whichever value of the algorithm then produces,
Hence and . We now complete the stream with copies of . Among the initial vectors, those assigned to the first positions have sum and number , so (5.1) gives
Since and , the triangle inequality yields
where and for . Choosing sufficiently small gives both bounds for large ; the remaining bounded values follow from the one-cycle bound below after further decreasing . All vectors lie in the same fixed plane, and although the initial stream was described adaptively, for any deterministic algorithm its assignments can be simulated in advance, producing a fixed input with the claimed cost.
Remark 5.3. It is worth noting that the one-cycle input , using coordinates, has discrepancy at least under every ordering, for an absolute constant . Indeed, consider the one-cycle input in dimension . For any ordering, linearly interpolate between consecutive prefix sums and stop during a repeated vector, or at its endpoint, when exactly half of the repeated copies have been traversed. Their contribution is then in each coordinate, while each basis vector has either appeared in full or has not appeared yet, so every coordinate of the interpolated sum is or . Its norm is therefore , and convexity of the norm implies that at least one adjacent genuine prefix has norm at least as large.
5.3 Randomized lower bounds
We now show that randomized algorithms can also have a large prefix sum on some fixed input. We start by proving the first term of the randomized lower bound, which holds already in dimension one.
Lemma 5.4 (Randomized lower bound for ). There exists an absolute constant such that, for every and every randomized online ordering algorithm, some fixed input from the scalar family (5.2) satisfies
Proof. Let and . The family (5.2) becomes
Let us write for the maximum residual of the algorithm's output on , and let us fix a random tape so that the algorithm's decisions are deterministic, with being the output position assigned to the th arriving copy of 1 on . Using the same tape, its first assignments on are also , since both inputs begin with copies of 1. For , denote the discrepancy over output prefixes as
By (5.3), we have . To apply Tijdeman–Wagner’s theorem on an infinite sequence in , we first append infinitely many zeros after . By Tijdeman–Wagner’s theorem [TW80, Theorem 1], there exists an absolute constant such that for every fixed tape,
Here the term comes from restricting interval endpoints to multiples of . Now, for any , we round upwards to , and, since all points lie on this grid, the intervals and contain the same points. The term changes by at most , so the discrepancy over arbitrary intervals is at most .
Let be the constant in Tijdeman–Wagner’s theorem and set . If , the input gives the desired bound with probability one. Otherwise, , so and , giving . This gives that, for any with ,
Therefore for each random tape, there are at most indices with . Averaging over the algorithm's random tape gives
so there exists a fixed which has maximum residual greater than with probability greater than . Hence, some fixed input satisfies
for , which concludes the proof.
The following lemma derives the second term of the randomized lower bound for any dimension.
Lemma 5.5 (Randomized lower bound in arbitrary dimension). There exists an absolute constant such that the following holds. Let , , and . If a randomized online ordering algorithm satisfies
on every fixed zero-sum unit-ball input, then , where .
Proof. When , the one-cycle input in Lemma 5.2 has cost under every ordering and, since , this proves the claim for sufficiently small .
Therefore we assume that and let . The expected fraction of inputs on which the algorithm succeeds is at least , and so we fix a tape that succeeds on a set with probability . For its positions , define for each and ,
and for fixed and , write . The identity in (5.1) can thus be rewritten as
Note that these two terms have nonnegative inner product since
and therefore, for every and , success on implies
We now define the set , so that each successful stopping time contributes an interval of length and . We extend the discrepancy bound at successful grid points to these intervals to show that
For any , , and , we have
Thus and the upper corner count exactly the same points, so only the area term changes:
When , success bounds the discrepancy norm at the grid corner by , and the triangle inequality gives
This holds almost everywhere on ; squaring and integrating over this set of area p proves (5.4).
In the following claim, we prove a lower bound of the contribution of each to the integral (5.4), i.e., a lower bound of for any each coordinate .
Claim 5.6. Let and let for . For , define
Then for every which is a union of intervals, with ,
where C > 0 is an absolute constant.
Proof of Claim 5.6. We apply Roth’s empty-rectangle argument [Rot54] on , letting for succinctness. First we construct two recursive partitions of , one for each coordinate.
• For the x-coordinate, start with . Split each interval I at a point z into a left child and a right child such that
Thus the split divides the length of the part of inside equally between the children; the children themselves need not have equal lengths. Such a point exists because the length of to its left varies continuously with . Let denote the collection of intervals after rounds of splitting. It contains intervals, each satisfying .
• For the y-coordinate, repeatedly split each interval at its midpoint. Let denote the collection after rounds. It contains intervals, each of length . We construct both partitions through level , so that every interval used below also has two children.
For each integer , consider all rectangles with and , which satisfy . There are such rectangles, with disjoint interiors, and, since the point set defining has points, at most rectangles contain a point in their interior. We select exactly rectangles whose interiors contain no points, which over all , selects rectangles. Next, for each selected rectangle , let us write for the left and right children of , and for the lower and upper halves of . We then define
with values on the boundaries that may be set to zero. Applying the Cauchy–Schwarz inequality to and gives
where the sum is over all selected rectangles . We will deal with the two terms denominator and numerator separately. First we compute the denominator: since the lengths of and are equal and so are and , for every fixed y and every fixed x, we have
The functions associated with the selected rectangles are pairwise orthogonal, since either the rectangles have disjoint interiors, or the finer x-sign has integral zero over E while the coarser sign is constant on that interval. Hence
We next bound the numerator: for an empty rectangle, every point has at least one coordinate outside the corresponding interval's interior. Its counting indicator is constant almost everywhere in that coordinate, so its integral against vanishes. Consequently, only the term in contributes:
To bound this expression, let be the splitting point of and put , the common length of and . Then
The inequality holds because, among sets of length q on either side of z, the interval adjacent to z minimizes the integral of the distance from z. For the two equal halves of J,
The definition of therefore gives
Summing the preceding bounds and using , we obtain
The integral is negative, so squaring gives
Substituting (5.6) and (5.7) into (5.5) gives, for an absolute constant C > 0,
as required.
We are now ready to conclude the proof of Lemma 5.5. First apply Claim 5.6 to the points defining and , we have
We then sum up (5.8) over j and apply (5.4) to get
The one-cycle input forces , since its cost is at least under every ordering and the success probability is positive. Hence . Using and , we obtain
for an absolute constant . Eventually, we may choose sufficiently small to include the case discussed at the very beginning, which will complete the proof.
Proof of Theorem 5.1. The deterministic assertions follow from Lemma 5.2. For , a uniform randomized guarantee must satisfy both the scalar lower bound of Lemma 5.4, embedded in the first coordinate, and the dimension lower bound of Lemma 5.5. Since and the maximum of two nonnegative quantities is at least half their sum, these bounds give
for an absolute constant c > 0, as claimed.
Acknowledgments
The authors thank Rom Pinchasi for the fruitful discussions and initial ideas for the deterministic algorithm. The authors used ChatGPT to assist with mathematical arguments. Specifically, the initial quota correction argument in the reduction was suggested by ChatGPT-5.5 and subsequently refined by the authors. The lower-bound argument was suggested by ChatGPT-6 Astra. The authors take full responsibility for all the content of this work.
References
[AABK23] Anders Aamand, Mikkel Abrahamsen, Lorenzo Beretta, and Linda Kleist. Online sorting and translational packing of convex polygons. In Proceedings of SODA, pages 1806–1833, 2023.
[AB24] Gergely Ambrus and Rainie Bozzai. Colorful vector balancing. Mathematika, 70(4):e12274, 2024.
[ABB 24] Mikkel Abrahamsen, Ioana O. Bercea, Lorenzo Beretta, Jonas Klausen, and László Kozma. Online sorting and online TSP: Randomized, stochastic, and high-dimensional. In Proceedings of ESA, volume 308 of LIPIcs, pages 5:1–5:15, 2024.
[Ade26] Ishaq Aden-Ali. Optimal online discrepancy minimization in linear time, 2026.
[AH26] Gergely Ambrus and Rainie Heck. A note on the Steinitz lemma. Mathematika, 72(2):e70085, 2026.
[ALS21] Ryan Alweiss, Yang P. Liu, and Mehtaab Sawhney. Discrepancy minimization via a self-balancing walk. In STOC, pages 14–20. ACM, 2021.
[APV26] Yossi Azar, Debmalya Panigrahi, and Or Vardi. Online metric TSP: beyond the barrier. In ICALP, volume 374 of LIPIcs, pages 18:1–18:18. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2026.
[AT26] Dylan J. Altschuler and Konstantin Tikhomirov. Online Beck–Fiala down to logarithmic sparsity, 2026.
[Bár24] Imre Bárány. A matrix version of the Steinitz lemma. Journal für die reine und angewandte Mathematik, 809:261–267, 2024.
[Ber25] Christian Bertram. Online metric TSP. In ESA, volume 351 of LIPIcs, pages 80:1–80:9. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2025.
[BG81] Imre Bárány and V. S. Grinberg. On some combinatorial questions in finite-dimensional spaces. Linear Algebra and its Applications, 41:1–9, 1981.
[BJSS20] Nikhil Bansal, Haotian Jiang, Sahil Singla, and Makrand Sinha. Online vector balancing and geometric discrepancy. In STOC, pages 1139–1152. ACM, 2020.
[BN26] Nikhil Bansal and Aleksandar Nikolov. Discrepancy theory: An algorithmic and geometric perspective, 2026. Manuscript for an unpublished monograph.
[Cho94] Sergej Chobanyan. Convergence a.s. of rearranged random series in Banach space and associated inequalities. In Jørgen Hoffmann-Jørgensen, James Kuelbs, and Michael B. Marcus, editors, Probability in Banach Spaces, 9, volume 35 of Progress in Probability, pages 3–29. Birkhäuser, Boston, MA, 1994.
[EW20] Friedrich Eisenbrand and Robert Weismantel. Proximity results and faster algorithms for integer programming using the Steinitz lemma. ACM Transactions on Algorithms, 16(1):1–14, 2020.
[GS80] V. S. Grinberg and S. V. Sevastyanov. Value of the Steinitz constant. Functional Analysis and Its Applications, 14(2):125–126, 1980.
[IKKP19] Sungjin Im, Nathaniel Kell, Janardhan Kulkarni, and Debmalya Panigrahi. Tight bounds for online vector scheduling. SIAM Journal on Computing, 48(1):93–121, 2019.
[KRR24] Janardhan Kulkarni, Victor Reis, and Thomas Rothvoss. Optimal online discrepancy minimization. In Proceedings of the 56th Annual ACM Symposium on Theory of Computing, pages 1832–1840. ACM, 2024.
[Ope26] OpenAI. Sharing AI progress in mathematics. Online announcement, 2026. 6 October 2026; see result 097 in the accompanying catalogue.
[OPW24] Timm Oertel, Joseph Paat, and Robert Weismantel. A colorful Steinitz lemma with application to block-structured integer programs. Mathematical Programming, 204:677–702, 2024.
[Rot54] Klaus F. Roth. On irregularities of distribution. Mathematika, 1(2):73–79, 1954.
[Sch72] Wolfgang M. Schmidt. Irregularities of distribution, VII. Acta Arithmetica, 21(1):45–50, 1972.
[Spe77] Joel Spencer. Balancing games. Journal of Combinatorial Theory, Series B, 23(1):68–74, 1977.
[Spe94] Joel Spencer. Ten Lectures on the Probabilistic Method. Society for Industrial and Applied Mathematics, 2nd edition edition, 1994.
[Ste13] Ernst Steinitz. Bedingt konvergente reihen und konvexe systeme. Journal für die reine und angewandte Mathematik, 143:128–176, 1913.
[TW80] Robert Tijdeman and Gerold Wagner. A sequence has almost nowhere small discrepancy. Monatshefte für Mathematik, 90(4):315–329, 1980.