Manuscript Offprint
arXiv:2611.09615Contextual Search and Bilateral Trade with a Trace-Square-Root Potential
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
We present a unified potential method for contextual search and bilateral trade with one-bit feedback and obtain order-tight algorithms for both problems. Our framework starts from a Bayesian perspective in which the unknown target (for contextual search) and the unknown pair of valuations (for bilateral trade) are sampled from a known prior distribution. In that model, the decision maker bases its prediction on the posterior distribution, obtained by conditioning on feedback received in previous rounds. For Bayesian contextual search, we present an algorithm with a total loss bounded by , where is the covariance matrix of the target's prior; and for contextual bilateral trade, our algorithm's regret is bounded by , where and are the covariance matrices of the seller's and buyer's valuations.
We then use ideas from this Bayesian setting and adapt a “dual” of this trace-square-root potential to the classical worst-case setting, where the target and valuations are chosen adversarially from the unit Euclidean ball. For both contextual search and bilateral trade, we obtain tight -regret algorithms. These results match the existing lower bounds up to a constant factor and improve on the previous guarantees of for contextual search and of for bilateral trade.
*Computer Science Department, New York University, NYC, United States. †Department of Computer, Control, and Management Engineering, Sapienza University, Rome, Italy. ‡Google Research, NYC, United States. §EPFL, Lausanne, Switzerland.
1 Introduction
We study parameter search problems in settings where decision makers receive only limited feedback. For example, a pricing algorithm sees the features of the customer, quotes a price for a product described by a feature vector and learns only whether the customer bought it. An idealized dosing procedure receives patient features and learns only whether the dose was too low or too high. A broker quotes prices to both a buyer and a seller, and learns only whether they traded. In each case, there is a vector hidden from the learner, and at each step, the observed features provide a “context”: together, the hidden vector and the context determine a target value that the learner tries to match. In this paper, we study two classical problems at the intersection of theoretical computer science and economics that are inspired by such situations: contextual search and contextual bilateral trade.
Contextual search. The basic problem in this setting is contextual search, where the target is an unknown vector . In round , an adversary reveals the context vector with . The two together define the target value —this is unknown to the learner, since is unknown. The learner does observe , then proposes a price and incurs symmetric loss . The learner observes neither the target value nor the loss incurred, but only the one-bit feedback sign —i.e., whether the price was too high or too low. Using this information, the learner aims to bound its total loss (also called the “regret”) independently of . The problem of contextual search arose from feature-based pricing and auctions [KL03, CLPL20, LPLV18]. It is useful to note that, for , the problem reduces to binary search, but higher-dimensional versions become much more challenging. Indeed, a series of works has studied this problem, and the state of the art is an -competitive algorithm [LPLS21]. However, the lower bound was only : can we close this gap?
Contextual bilateral trade. An extension of contextual search is bilateral trade, where the learner is a broker who intermediates between a seller and a buyer with hidden vectors . In round , an adversary reveals a context vector with corresponding to valuations for the seller and for the buyer—these are unknown to the broker, who does not see . The broker then proposes a price and observes whether both agents are willing to trade at that price, i.e., if . Note that, given the feedback structure, a failed trade does not identify which agent refused. The broker aims to maximize gain from trade, defined as , where the sum is taken over all rounds in which the trade took place, or equivalently, to minimize the total loss , which is the total gain from trade it failed to realize. The model was introduced by Gaucher et al. [GBC+25], building on the online bilateral trade framework of Cesabianchi et al. [CBCC+21, CCC+24]. The gaps left by the literature are much larger in this setting: the only upper bound for this one-bit feedback model is [CFG+26], and the lower bound is again , leaving a huge gap: can we close it?
Worst-case guarantees. For worst-case guarantees, the unknown target and the valuation vectors are assumed to be selected from the Euclidean unit ball by the adversary. The adversary knows the learner's algorithm, but not the random bits it uses. This is the main point of view taken in prior works on both contextual search and bilateral trade. We obtain horizon-independent expected-loss bounds for both problems, matching the existing lower bounds up to constant factors. Table 1 summarizes our worst-case guarantees and compares them with prior work for contextual search and bilateral trade.
| Result | Contextual search | Bilateral trade |
|---|---|---|
| Standard lower bound [LPLS21, CFG⁺26] | ||
| Paes Leme and Schneider [PLS18] | — | |
| Liu, Paes Leme, and Schneider [LPLS21] | — | |
| Cosson et al. [CFG⁺26] | — | |
| This paper (Thms. 2.4 and 3.4) | (Alg. 2) | (Alg. 4) |
Table 1: Worst-case guarantees for unit-norm contexts and hidden vectors.
Bayesian guarantees. For Bayesian guarantees, we assume that the unknown vectors are sampled from a known prior distribution with finite second moments. This point of view deviates from the existing literature but is particularly illuminating: it yields simpler algorithms and a first potential function, based on posterior covariance, that will guide the adversarial analysis. For known priors with finite second moments, our bounds depend only on the prior covariance matrices and hold at every horizon (Table 2).
| Result | Contextual search | Bilateral trade |
|---|---|---|
| This paper (Thms. 2.1 and 3.2) | (Alg. 1) | (Alg. 3) |
Table 2: Bayesian rates for unit-norm contexts and priors with finite second moments. is the prior covariance in contextual search, and are the seller's and buyer's marginal prior covariances in bilateral trade.
Our worst-case guarantees and our Bayesian guarantees are clearly related, since when is the covariance matrix associated with the uniform distribution in the Euclidean ball. Yet neither directly implies the other: in particular, the Bayesian setting allows for distributions with unbounded support or with skewed covariance matrices, such as Gaussian distributions. Thus, the Bayesian setting is not merely an intermediate conceptual step toward worst-case competitive guarantees, but is of independent interest.
1.2 Our Techniques
We now outline the intuition behind our algorithms and the essential ingredients of their analysis.
1.2.1 Our Algorithms
In the Bayesian setting, the learner is given a prior distribution on the hidden parameters: the vector for contextual search, or the pair for contextual bilateral trade. Using this, at any time , the learner has access to the posterior distribution of the unknown parameters or conditioned on all the past observations. Our Bayesian algorithms (Algorithms 1 and 3) compute a proposed price based only on that posterior distribution and on the context vector ; then they update the posterior distribution with the corresponding feedback. Our Bayesian algorithm for contextual search (Algorithm 1) is remarkably simple: it posts prices , where is the posterior mean of , and is the posterior standard deviation of . The bilateral trade algorithm (Algorithm 3) similarly uses the posterior, now of the two projected values and , and posts a common price to both agents. This price is chosen to balance trading and learning, allowing us to bound total regret by the learner's initial uncertainty (Lemma 3.1).
In the worst-case setting, the learner has no posterior distribution on the unknown parameters, so it maintains a suitable “proxy” for the potential used in the Bayesian analysis. For contextual search, it maintains two parameters, a vector and a matrix , which we call the posterior mean proxy and the posterior square-root covariance proxy. Informally, these parameters can be interpreted as an estimate of the unknown parameter (for ) and a measure of uncertainty in that estimate in all directions (for ). Importantly, we do not maintain explicit uncertainty sets as in previous work—in particular, the unknown parameter need not lie within the ellipsoid , where is the unit Euclidean ball (as, e.g., in the ellipsoid method). Instead, our proofs directly show that the per-step regret can be charged to the decrease in a certain potential. From this perspective, the worst-case contextual search algorithm (Algorithm 2) posts prices , where , and —a rule remarkably similar to the Bayesian rule in Algorithm 1. For bilateral trade (Algorithm 4), stores separate -dimensional mean proxies for the seller and buyer, and the matrix is block diagonal, with one block for each agent's square-root covariance proxy. The algorithm samples a common price and two possible successor states from a finite lottery, then keeps the successor selected by the trade bit. Whereas contextual search admits explicit state updates, here we apply the minimax theorem to guarantee the existence of a single lottery that works for every possible hidden pair of buyer and seller.
Although the focus of the paper is not on computational complexity, we note that our worst-case contextual search algorithm (Algorithm 2) uses memory throughout the execution and performs only operations per round, making it significantly more practical than previous approaches for contextual search that rely on costly geometric routines such as computing intrinsic volumes or barycenters of high-dimensional convex bodies [PLS18, LPLS21].
1.2.2 Analyses via the Trace-Sqrt Potential
We bound the regret of all our algorithms via a potential-based analysis, using a pair of potential functions we feel may be useful in other contexts. It will be illuminating to start with the Bayesian problem for contextual search. Here we have a random vector with finite second moment; this represents the hidden vector that a learner does not know; however, we do know the distribution from which is drawn, and hence know its mean and covariance . In order to quantify the uncertainty about , we use the trace-sqrt potential of the covariance:
where is the square root of the -th eigenvalue of , commonly called the -th semiaxis length; see Figure 1 for an illustration. The figure highlights a key point: the potential naturally captures a notion of “distance” and “spread”, as opposed to other potentials (like the logarithm of the volume) which would need various tricks to relate regret to the reduction in the volume, incurring losses along the way.
(a) Principal axes

(b) Enclosing box

Figure 1: The covariance ellipsoid associated with . Geometrically, the trace-square-root potential equals the 1-dimensional intrinsic volume (i.e., half the perimeter) of the smallest enclosing box of the ellipsoid, divided by 2. This perspective relates our potential to early geometric approaches to contextual search [PLS18], which relied on intrinsic volumes.
Whatever the learner observes next — the feedback from a round, a new context, or any other information revealed about — is a signal: a random variable defined jointly with . After observing , the remaining uncertainty is described by ; let the new covariance matrix be . This means the potential moves from to .
The effect of signals on the potential. The first important observation is this: For any signal , the law of total covariance (which states that the total covariance equals the expected posterior covariance plus the covariance of the posterior mean) gives
Now, the monotonicity and concavity of the operator on the positive-semidefinite cone (see, e.g., Example 3.48 in [BV04]) allow us to infer that the potential is monotone in the Löwner order. This, combined with (2), means that
and hence the potential is non-increasing in expectation. Of course, this expected decrease is not good enough—we need the potential decrease to pay for our regret.
Potential drops versus directional uncertainty. The key ingredient in relating the potential drop to our regret is the following claim, which is a strengthening of the matrix square-root function's monotonicity and concavity:
Lemma 1.1 (Gap Function). For any vector with , the “gap” function
is monotone and concave on the positive-semidefinite cone.
We defer the proof to Lemma B.1 in Appendix B, but let us just mention that it follows by writing as the infimum of a family of affine functions:
(4) where when . (Somewhat surprisingly, we will return to this expression in a moment!) Now the potential drop can be bounded below by the decrease in the directional standard deviation, using (2), Lemma 1.1, and Jensen's inequality:
Lemma 1.2 (Potential decrease lemma). Let be a random vector with finite second moment and covariance matrix , and let be any jointly defined random variable. Fix with . Then
To get intuition for the quantity on the right-hand side, define the “uncertainty” along a specific direction (which should be thought of as the context vector) by the “directional” standard deviation . So the right-hand side of (5) is indeed the drop in the standard deviation in the direction of the context vector. In a very concrete sense, this reduces the high-dimensional object (related to ) to a one-dimensional object (the reduction in standard deviation of a scalar random variable).
The Bayesian analysis. All that remains is to relate the loss incurred by our algorithm to this drop. Indeed, we show precisely this for our Bayesian contextual search algorithm: if the context vector is , then our algorithm's expected regret is at most a constant times the drop in standard deviation (see the proof of Theorem 2.1). Using the above inequalities and summing over all time steps, we get that the expected total regret is at most a constant times the expected total drop in potential . Since the potential is non-negative, this is at most the same constant times the initial potential, which is . This completes the Bayesian proof.
For contextual bilateral trade, our potential is the sum of two trace-sqrt potentials—one for each of the unknown buyer and seller vectors, —and we bound the lost gain from trade analogously.
Moving to the adversarial problem. Since the Bayesian problem has regret , it is tempting to use the minimax theorem to infer the existence of an algorithm for the adversarial case. We take a slightly different route for contextual search. We go back to the proof of Lemma 1.1, where we wrote as the infimum of affine functions in (4). A similar proof shows that
The function on the left was our Bayesian potential, whereas on the right is what we use as our potential for the adversarial problem—the potentials for the “dual” Bayesian/adversarial problems are duals to each other!
We then show that our algorithm, which captures its uncertainty about (which is now an adversarially chosen quantity) using the posterior “proxy mean” and “proxy covariance” matrix , satisfies
For bilateral trade, we again sum the seller's and buyer's quadratic potentials. While in contextual search we can achieve the displayed bound through an explicit state update, in bilateral trade, a one-round minimax argument (Lemma 3.3) instead guarantees a finite lottery of prices and successor states satisfying the bound for every hidden pair, up to arbitrarily small slack.
1.3 Related Work
Contextual search was introduced as a multidimensional generalization of binary search [PLS18], providing a common framework for earlier contextual pricing problems at the interface of computer science and economics [KL03, ARS14, CLPL20, Jav17]. Most existing approaches to contextual search are inspired by cutting-plane methods in optimization, where the algorithm maintains a polytope of feasible targets that shrinks as the learner acquires information (in each round, a half-space of targets is incompatible with the feedback received). Since computing a candidate price based on the barycenter or Steiner point of the feasible polytope is insufficient [LPLS21], [PLS18] relied on tools from integral geometry. The loss bound was improved to in [LPLS21], by posting a price corresponding to the barycenter of an augmented version of the feasible polytope.
Our proxy covariance matrix approach is reminiscent of ellipsoid methods in optimization, which maintain a quadratic approximation of the feasible region [YN76, Sho77]. Ellipsoid methods have previously been applied to contextual search, e.g., in [CLPL20, LPLV18, GGK+21, GBC+25]. A key novelty of our approach is that our proxy ellipsoid (or constant-factor dilatation of it) does not contain the feasible region. In fact, it expands in rounds where it receives “exterior” feedback! Of course, on average over several rounds, our proxy ellipsoid concentrates on the target parameters.
Related work on contextual search has also explored other loss functions, such as the pricing loss, which measures the revenue shortfall relative to knowing the buyer's valuation, for which [LPLS21] obtain regret. Another criterion counts predictions whose error exceeds a prescribed tolerance ; for this criterion, [LPLV18] give an algorithm making at most errors.
The geometric viewpoint also connects contextual search to inverse optimization and low-regret cutting-plane methods [BPS17, GGK+21, BFL25, STBO25]. In online inverse linear optimization, the learner recommends an action from a feasible set and then observes the action that maximizes the unknown linear objective over that set. Under Euclidean unit-ball normalization, [Sak26, GGL+26] obtain a horizon-independent expected-regret bound for this problem. The distinction in feedback is important: the optimal action feedback is more informative than the one-bit contextual search feedback.
The problem of bilateral trade goes back to [MS83], which, interestingly, originally focused on a one-dimensional Bayesian setting somewhat related to ours, albeit with a single round (). Cesa-Bianchi et al. [CBCC+21, CCC+24] studied a sequential version of the problem where the algorithm competes with the best fixed price in hindsight, with valuations sampled from a fixed unknown distribution; here, the regret unavoidably depends on the number of rounds , but the dependence can be made sublinear. The contextual (multi-dimensional) problem was introduced by [GBC+25]; their noiseless algorithm, which requires two-bit feedback, has regret. In the weaker one-bit feedback setting, the best time-independent result achieves regret [CFG+26].
In variants of bilateral trade, the broker can post two distinct prices: for the buyer and for the seller. This extra degree of freedom can facilitate maximizing gain from trade. To restrict that advantage, it is usually assumed that the algorithm respects “global budget balance” [BCCF24], i.e., that it does not run persistent deficits, or “per-round budget balance” [CCC+24], which imposes
in every round. Allowing the broker to post distinct prices also enables other measures of performance for bilateral trade, such as broker profit maximization [GBC 25, GDFS25]. Our algorithms do not use this flexibility.
1.4 Notation
We use for the Euclidean norm, for the Euclidean ball, and for the positive-semidefinite Löwner order on symmetric matrices. The positive-semidefinite square root of a positive-semidefinite matrix is unique and denoted by . We write for trace, for covariance, and for standard deviation. We set , and write for the positive part.
We usually use bold symbols to denote vectors in . Specifically, we use for a distributional mean and for the algorithmic mean proxy, with scalar projections and along a context . A covariance matrix is denoted by , with directional standard deviation .
The observed history at time , denoted by , contains the contexts, posted prices, feedback, and the learner's randomization from previous rounds. We write for expectation conditional on this history and the current context, before the learner's fresh randomization. For both contextual search and bilateral trade, contexts may adapt to this history but are chosen before the learner's fresh randomization. In the Bayesian setting, each context is conditionally independent of the hidden vector or pair given , so observing it does not change the posterior.
Additional notation is summarized in the table in Appendix A.
2 Contextual Search
In contextual search, the learner is looking for an unknown target . At round , the learner receives a context with , posts , suffers loss
without observing either the target value or the loss. We seek bounds on the total loss that are independent of . In this section, we first present a Bayesian algorithm whose expected total loss is at most for any known prior on with finite second moment and covariance matrix (Theorem 2.1). We then give an algorithm that needs no prior and has expected total loss at most when the hidden vector lies in the Euclidean unit ball (Theorem 2.4). Both guarantees hold for every horizon . For completeness, we recall the classical lower bound for contextual search in Appendix E.
2.1 Bayesian Contextual Search
In the Bayesian setting, the target has a known prior with finite second moment. That distribution is updated with the information acquired by the learner in previous rounds. Just before round , we denote by
the posterior mean and covariance of the target. For the current context , we denote the scalar target by , its conditional mean by and its standard deviation by . Algorithm 1 queries one of two prices centered at , as illustrated in Figure 2.

Figure 2: (a) Bayesian prior; (b) posterior for with ; (c) posterior for with .
Algorithm 1 Bayesian Contextual Search
Given a known prior on with finite second moment, repeat the following at each round :
- Compute the posterior moments of and their projections on the context vector ,
- Draw a fresh independent uniform sign and post the price
- Observe and compute the posterior distribution on .
Theorem 2.1 (Bayesian Contextual Search). For any known prior on with finite second moment and covariance , Algorithm 1 satisfies, for every horizon ,
The expectation is over the prior and the randomization of the learner and the contexts.
Proof of Theorem 2.1. We use the following one-dimensional contraction bound for the standard deviation, stated in Lemma 2.2. The lemma, whose proof is elementary, implies that a single bit of information suffices to shrink the posterior standard deviation of a scalar distribution by a constant factor. The proof of this lemma is given in Appendix C.2.
Lemma 2.2 (One-bit deviation contraction). Let be a square-integrable real random variable, with and . Let be uniform on and independent of . Define
Writing the posterior standard deviation as , we have .
The intuition is the following: because the threshold is placed at away from the mean, the middle region can hold at most of the variance ; at least one of the two outer tails must hold a large fraction of the variance. Conditioning on whether falls in that tail creates a win-win situation:
-
If the tail has large probability, then every point in the tail is at least away from the mean, so learning whether is in the tail causes a large shift in the posterior mean, which reduces the variance (by the law of total variance).
-
If the tail has small probability, then isolating the tail removes a large chunk of variance from the “main body” of the distribution (shrinking the main body’s standard deviation), while the tail itself occurs so rarely that its own conditional standard deviation—which grows only like while its probability shrinks like —contributes almost nothing () to the expectation.
We now move on to the core argument. First, we bound the loss in a round of Algorithm 1 by , the uncertainty along the context vector. If , then almost surely, so the loss is zero. For , we have
where we used .
Next, we pay for each round’s loss with a decrease in the posterior potential , where . Let and be the directional standard deviations of the target projection before and after the observation; we apply Lemma 2.2 to the random variable and Lemma 1.2 to the potential to obtain the potential inequality
Telescoping this inequality yields the theorem:
□
2.2 Adversarial Contextual Search
We now consider a fixed unknown target in the unit Euclidean ball. Our worst-case algorithm, Algorithm 2, maintains two parameters: a vector , the mean proxy, and a symmetric positive-definite scale matrix , the square-root covariance proxy. This algorithm mirrors the Bayesian algorithm, Algorithm 1, in that plays the role of and plays the role of (their one-dimensional projections along the context axis are denoted by and ). The key nuance is that, without Bayesian posterior updates, Algorithm 2 specifies explicit updates for both proxies that depend only on the posted price and the feedback received, as specified in (10). Figure 3 illustrates one round of the algorithm.

Figure 3: Proxy ellipsoids: (a) before feedback; (b) after with ; (c) after with .
Algorithm 2 Adversarial Contextual Search
Initialize
At each round :
-
Receive , compute , , , and .
-
Draw a fresh independent uniform sign and post
- Observe and update
Before providing our regret guarantee, we first verify that the algorithm is well-defined, meaning that the updates in (10) preserve the positive definiteness of the scale matrix . This observation is obvious in the case where , because adding a positive semidefinite matrix preserves positive definiteness; so it suffices to verify that positive definiteness is preserved whenever .
Remark 2.3 ( throughout execution). Assume and , and write and . Cauchy-Schwarz in the inner product induced by gives
Hence , and the update rule in (10) satisfies
This proves the claim by induction over the rounds.
Theorem 2.4 (Adversarial Contextual Search). For every fixed with , every horizon , and every admissible adaptive context strategy with , Algorithm 2 satisfies
The algorithm uses arithmetic operations and real-valued storage per round.
Proof of Theorem 2.4. For a fixed hidden target, we consider the non-negative potential defined by
At initialization, the potential satisfies . We use the following potential-decrease bound, which is shown in Appendix C.3.
Lemma 2.5 (One-round potential decrease). On every round of Algorithm 2,
As in the Bayesian case, the proof reduces to one dimension: we define , which is just a scalar version of the potential . Going from to is a rank 1 perturbation, so the Sherman–Morrison formula expresses the expected potential drop as a multiple of , where and are the projected mean and deviation proxies; the proof now follows from elementary calculations.
Summing the potential inequality (13) over rounds yields , which proves the theorem.
In the algorithm, computing and performing the rank-one update each take arithmetic operations, whereas storing and requires real numbers. Importantly, the algorithm never evaluates or computes , which only serve in the analysis.
3 Contextual Bilateral Trade
In bilateral trade, a broker intermediates between a seller and a buyer who are represented by two vectors . At round , the broker receives a context vector with , proposes a price , and observes whether trade occurs:
In particular, a failed trade does not identify the agent who rejected the price. The lost “gain from trade” in round is defined as .
In Section 3.1 we present a Bayesian algorithm whose expected total loss is at most , for any known prior on the targets with marginal covariance matrices and (Theorem 3.2). In Section 3.2, we then give an algorithm that needs no prior and has expected total loss at most when both targets lie in the unit Euclidean ball, so that (Theorem 3.4). All our guarantees hold for every horizon . For completeness, we recall the classical lower bound for bilateral trade in Appendix E.
3.1 Bayesian Contextual Bilateral Trade
In the Bayesian setting, write for the random pair of valuations. Its components may be dependent, and we require only finite second moments. For a distribution of , define
This is the sum of the two search potentials, not the trace square root of the joint covariance. If is supported on , then , because each marginal covariance has trace at most one. For support in , the corresponding bound is .
Given a context , the one-dimensional problem along now involves a pair rather than a single target. For a common price , let denote the trade bit, so that the loss incurred by posting price is
To quantify the information obtained from the trade bit, for each , we define the standard deviation drop , so that the overall drop is
Each is nonnegative by the law of total variance and the concavity of the square root. We now introduce the key lemma that shows the existence of a specific price relating these two terms. We provide a proof sketch below, while the full proof is deferred to Appendix D.1.
Lemma 3.1 (Trade or information). For every pair of square-integrable real random variables, there is a common price such that
The price can be chosen as a function of the joint distribution.
Proof sketch. Let be the trade profile. For fixed valuations, is the length of the interval of prices permitting trade. Averaging this length and interchanging expectation and integration gives
Write , for , , and . A deterministic valuation (i.e., ) is handled by posting that value. Otherwise, the analysis has two cases.
Overlapping case (). In this case, the seller's and buyer's means are close to each other. To deal with this case, we put and, since , we bound the entire area under by constructing the envelope in Figure 4. The crucial ingredient that we use to construct is the following information identity, which is proved in the appendix and holds for any :
(Information Identity)
The left-hand side averages the squared change in the mean and standard deviation after observing rejection or trade. Thus a feedback outcome that substantially changes either quantity must provide information, weighted by its probability. In the tails of , a successful trade forces a large shift of the conditional mean, yielding inverse-square bounds. For instance, if , trading implies , thus providing a uniform upper bound on in terms of (a similar derivation holds for the buyer's tail):
(Tail Bound)
For , consider the values of sellers who trade at : they either lie within of their mean or fall below (and would also permit trade at price ). Trade at forces a conditional mean shift of at least , so the information identity controls these outliers' contribution to the second moment. Thus either conditioning on trade at substantially changes the mean or spread, or the outliers needed to preserve the spread provide information at . Combining the bounds from these two prices gives
(Close-to-mean Bound)
The buyer’s bound is symmetric. For values of close to the average of and , we employ the trivial upper bound . Integrating over provides the desired upper bound on (and thus on ) in terms of . Integrating the tail bounds yields , while the close-to-mean regions have width and height , for a total area of . Finally, the central plateau has height one and length , hence
Since , this implies . Also, Cauchy-Schwarz gives , so
If , then and any price works. Otherwise, since , a price sufficiently close to maximizing satisfies .
Well-separated case (). In this case, the seller’s and buyer’s means are sufficiently far apart that we can post their midpoint as the price. A failed trade forces either or ; thus, conditional on rejection, the combined root-mean-square deviation is at least , compared with at most before conditioning. This increase requires changes in the conditional means or standard deviations. Their probability-weighted squared changes are bounded by , while the missed gain is controlled by the same valuation deviations. Comparing these bounds gives .
Our Bayesian algorithm posts the price supplied by the lemma.
Algorithm 3 Bayesian Contextual Bilateral Trade
Input: a known joint prior on with finite second moments. Initialize the posterior . For :
- Receive and let be the current posterior of .
- Apply Lemma 3.1 under to and and post the resulting price .
- Observe and condition the joint posterior on this bit and the posted offer.
Theorem 3.2 (Bayesian Bilateral Trade). For every known joint prior with finite second moments, Algorithm 3 satisfies the following bound at every horizon:

Figure 4: A schematic trade profile (solid blue) and its piecewise upper bound (dashed orange) in the overlapping case. The area under is . The tails and central intervals contribute at most under ; the remaining plateau has area . Claim D.4 establishes the bound.
Proof. Condition on the history and current context, and let be the posterior after the offer and trade bit. With evaluated under , the price choice and Lemma 1.2 give
The second inequality applies the directional comparison of Lemma 1.2 to each marginal. It holds for any observed signal, including a trade bit that depends on both agents. By the context assumption in Section 1.4, the next context supplies no additional information about the hidden pair. Taking expectations and telescoping therefore yields
The common price ensures per-round budget balance. The normalized bounds follow from (14).
3.2 Adversarial Contextual Bilateral Trade
In the adversarial setting, no prior is given, and the hidden pair is fixed: . Our algorithm maintains a center and a block-diagonal positive-definite matrix , where both and belong to . These three quantities induce the same potential as in search, but in dimension 2d:
Note that the learner never evaluates the potential at the unknown pair . In each time step, our algorithm designs a suitable plan, which specifies an offer and two successor states and , one for each possible feedback bit. Let denote the random successor state induced by the observed feedback. Ideally, we would like to find a plan that balances decreasing the expected potential at and incurring little regret . The following lemma shows that there exists a lottery over prices (i.e., a randomized plan) that ensures this property, up to some slack.
Lemma 3.3 (A valid lottery exists). For every , every block-diagonal , every context with , and every , there is a finite lottery of plans satisfying
Each plan in the lottery posts the same price, drawn from a finite grid, to both agents. The lottery can be chosen as a function of the state and context.
Note that the expectation in the lemma is only over the lottery, and the successor is selected using the bit generated by the sampled plan. For a given slack , the lottery must satisfy the one-round bound in (21), which balances incurred regret against the decrease in the (unknown) potential and must hold for all possible hidden pairs. We provide here a proof sketch of the lottery lemma, and defer the detailed proof to Appendix D.2.
Proof sketch. The goal is to show that, for every fixed current state and context, we can first construct a good plan for each hypothetical prior, and then use minimax to obtain one lottery that works for every hidden pair. A plan a consists of a common price and two successor states, one for rejection and one for trade, all fixed before observing the bit. A lottery Q is a probability distribution over plans: the learner samples a plan, posts its price, and keeps the successor selected by the observed bit. We seek to find such a lottery and to ensure that it has finite support.
Let us write for the current quadratic potential from (6), and for the successor quadratic potential selected when the hidden pair is . Moreover, let us define the excess cost
(Excess cost)
where is the lost gain under plan . The required inequality is therefore for every . Indeed, is the loss plus the scaled successor potential minus the scaled current potential, so this is exactly (21).
A plan for each prior. Temporarily suppose that the hidden pair is sampled from a known prior on . Lemma 3.1, together with the directional comparison of Lemma 1.2, supplies a common price satisfying
(Bayesian bound)
where is the posterior after observing bit y. Thus the scaled prior potential covers both the expected loss and the scaled posterior potential remaining after the bit. We want to replace these potentials by the quadratic potentials of the current and successor states.
For each bit, choose the posterior mean as the successor center and the square roots of the posterior marginal covariances as the matrix blocks, adding before taking the roots to ensure positive definiteness. These choices define a plan . We stress that both successors are fixed before posting the price, and the observed bit only selects which successor is kept. The variational identity (6) gives
(Potential bounds)
Combining these comparisons with the Bayesian bound cancels the posterior terms:
(Average bound)
We have therefore constructed plans with arbitrarily small average excess cost for every prior, although the plans may depend on that prior.
One lottery for every hidden pair. It remains to turn a suitable plan for each prior into a single lottery that works for every hidden pair. The obstacle to applying minimax directly is that the trade bit jumps when a valuation crosses the posted price. In the analysis, we slightly contract the hidden pair toward the origin and add a small common random shift to both valuations. The contraction keeps the perturbed pair in , while averaging over the shift makes the expected cost continuous. Corresponding changes to the price and successor states preserve the averaged bound up to a uniformly vanishing error. We then apply Claim D.5 together with Sion's minimax theorem (Theorem D.6 [Sio58]) to these continuous costs and then let the perturbation vanish, giving
(Minimax)
Above, we write for the set of all probability measures on , representing the possible prior distributions of the hidden pair. At this point, ranges over arbitrary lotteries, not necessarily with finite support. Since the minimax value is at most zero, we can find a lottery with excess cost below any positive tolerance. We choose , leaving the remaining for the price and successor-state approximations below. Consequently, there is a lottery satisfying
(Uniform bound)
This bound holds for every fixed hidden pair, with expectation only over the sampled plan.
A finite lottery. The same claim lets us choose with a bounded price density and compact ranges of prices and successor states. Using this regularity and compactness, we round prices to a finite grid and approximate successor states by a finite net, making each error smaller than . Thus, the resulting lottery has finite support and satisfies the required bound with slack .
The detailed proof is deferred to Appendix D.2.
□
Algorithm 4 Adversarial Contextual Bilateral Trade
Initialize and .
For :
-
Receive and set .
-
Choose a lottery of plans as in Lemma 3.3 with current state , context , and slack .
-
Draw a plan from the finite lottery and post its price .
-
Observe and retain the plan's successor state for that bit as .
The algorithm uses only its state, the current context, its own randomization, and the observed bit. It needs neither a prior nor a horizon. We do not claim an efficient implementation of the optimization in step 2.
Theorem 3.4 (Adversarial Bilateral Trade). For every fixed , every admissible adaptive context strategy with , and every horizon , Algorithm 4 satisfies
Proof. Fix and write . Lemma 3.3 guarantees the existence of the lottery required by Algorithm 4 at every round. Conditional on the observed history and current context, before the lottery is drawn, (21) gives
Since is finite and all losses and potentials are nonnegative, this inequality also establishes their integrability inductively. Taking full expectations and summing over telescopes the potential terms:
The chosen slacks have total sum at most one, because
Finally, the initialization and give
Substituting these two bounds proves (22).
Acknowledgment
Federico Fusco, Stefano Leonardi, and Matteo Russo acknowledge OpenAI for providing complimentary access through the ChatGPT for Academic Researchers program. The work of Federico Fusco and Stefano Leonardi is partly supported by AI-PHOQUS PN RIC 2021-2027, co-financed by EU Italian Ministry MIMIT and MUR. Anupam Gupta was supported in part by NSF awards CCF-2422926 and CCF-2608359.
Disclosure of AI Usage
The first proof of regret for the adversarial version of contextual bilateral trade was suggested by GPT-6 Astra in conversations with the authors. Subsequently, we dedicated considerable effort to simplifying the proofs, to understanding and interpreting the potential used in the proof, to exploring the (somewhat simpler) setting of contextual search, to identifying concrete connections between the Bayesian and adversarial versions of both problems, and to investigating a Gaussian setting of contextual search, which led to interpreting the parameters of the algorithm as posterior mean and covariance proxies. The authors have substantially rewritten the proofs (albeit with some help from Gemini, Claude, and ChatGPT) and take full responsibility for the content of this work.
All the proofs have been formalized in Lean4 and can be found at this url.
References
[ARS14] Kareem Amin, Afshin Rostamizadeh, and Umar Syed. Repeated contextual auctions with strategic buyers. In NIPS, pages 622–630, 2014.
[BCCF24] M. Bernasconi, M. Castiglioni, A. Celli, and F. Fusco. No-regret learning in bilateral trade via global budget balance. In Proceedings of the ACM Symposium on Theory of Computing (STOC), 2024.
[BFL25] O. Besbes, Y. Fonseca, and I. Lobel. Contextual inverse optimization: Offline and online learning. Operations Research, 73(1):424–443, 2025.
[BPS17] A. Bärmann, S. Pokutta, and O. Schneider. Emulating the expert: Inverse optimization through online learning. In Proceedings of the International Conference on Machine Learning (ICML), volume 70 of Proceedings of Machine Learning Research, pages 400–410, 2017.
[BV04] Stephen Boyd and Lieven Vandenberghe. Convex optimization, volume 1. Cambridge university press, Cambridge, 2004.
[CBCC+21] N. Cesa-Bianchi, T. R. Cesari, R. Colomboni, F. Fusco, and S. Leonardi. A regret analysis of bilateral trade. In Proceedings of the ACM Conference on Economics and Computation (EC), 2021.
[CCC+24] Nicolò Cesa-Bianchi, Tommaso Cesari, Roberto Colomboni, Federico Fusco, and Stefano Leonardi. Bilateral trade: A regret minimization perspective. Math. Oper. Res., 49(1):171–203, 2024.
[CFG+26] R. Cosson, F. Fusco, A. Gupta, S. Leonardi, R. Paes Leme, and M. Russo. Contextual online bilateral trade. In Proceedings of the ACM Conference on Economics and Computation (EC), 2026. arXiv:2602.12903.
[CLPL20] M. C. Cohen, I. Lobel, and R. Paes Leme. Feature-based dynamic pricing. Management Science, 66(11):4921–4943, 2020.
[GBC+25] S. Gaucher, M. Bernasconi, M. Castiglioni, A. Celli, and V. Perchet. Feature-based online bilateral trade. In International Conference on Learning Representations (ICLR), 2025. arXiv:2405.18183.
[GDFS25] Simone Di Gregorio, Paul Dütting, Federico Fusco, and Chris Schwiegelshohn. Nearly tight regret bounds for profit maximization in bilateral trade. In FOCS, pages 1570–1594. IEEE, 2025.
[GGK+21] S. Gollapudi, G. Guruganesh, K. Kollias, P. Manurangsi, R. Paes Leme, and J. Schneider. Contextual recommendations and low-regret cutting-plane algorithms. In Advances in Neural Information Processing Systems, 2021.
[GGL+26] Anupam Gupta, Guru Guruganesh, Honghao Lin, Vahab Mirrokni, Renato Paes Leme, and David P Woodruff. Optimal and efficient online inverse optimization. arXiv preprint arXiv:2610.08735, 2026.
[Jav17] Adel Javanmard. Perishability of data: Dynamic pricing under varying-coefficient models. J. Mach. Learn. Res., 18:53:1–53:31, 2017.
[KL03] Robert D. Kleinberg and Frank Thomson Leighton. The value of knowing a demand curve: Bounds on regret for online posted-price auctions. In FOCS, pages 594–605. IEEE Computer Society, 2003.
[LPLS21] A. Liu, R. Paes Leme, and J. Schneider. Optimal contextual pricing and extensions. In Proceedings of the ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 1059–1078, 2021. arXiv:2003.01703.
[LPLV18] I. Lobel, R. Paes Leme, and A. Vladu. Multidimensional binary search for contextual decision-making. Operations Research, 66(5):1346–1361, 2018.
[MS83] R. B. Myerson and M. A. Satterthwaite. Efficient mechanisms for bilateral trading. Journal of Economic Theory, 29(2):265–281, 1983.
[PLS18] R. Paes Leme and J. Schneider. Contextual search via intrinsic volumes. In Proceedings of the IEEE Symposium on Foundations of Computer Science (FOCS), pages 268–282, 2018.
[Sak26] S. Sakaue. Tight regret bound for online inverse linear optimization via multiscale matrix weights. arXiv preprint arXiv:2609.26978, 2026.
[Sho77] Naum Z Shor. Cut-off method with space extension in convex programming problems. Cybernetics, 13(1):94–96, 1977.
[Sio58] M. Sion. On general minimax theorems. Pacific Journal of Mathematics, 8(1):171–176, 1958.
[STBO25] S. Sakaue, T. Tsuchiya, H. Bao, and T. Oki. Online inverse linear optimization: Efficient logarithmic-regret algorithm, robustness to suboptimality, and lower bound. In Advances in Neural Information Processing Systems, 2025.
[YN76] David B Yudin and Arkadi S Nemirovskii. Informational complexity and efficient methods for the solution of convex extremal problems. Matekon, 13(2):22–45, 1976.
Appendix
A Notation
We summarize the main notations used in the paper in the table below. We generally use bold symbols for -dimensional vectors, capital Roman letters for matrices and scalar random variables, and Greek letters for distributional quantities (such as moments) and potentials. Time dependence is usually indicated by a subscript; for example, denotes the potential at the -th round.
| Quantity | Dimension | Projection | Random variable |
|---|---|---|---|
| Contextual search | |||
| Unknown target | |||
| Distributional mean | |||
| Mean proxy | |||
| Distributional covariance | |||
| Square root of covariance | |||
| Square root covariance proxy | |||
| Context | |||
| Price | |||
| Feedback | |||
| Random sign (Rademacher) | |||
| Contextual bilateral trade | |||
| Unknown seller/buyer valuations | |||
| Joint law | |||
| Potentials and functions | |||
| Bayesian potential | |||
| Bayesian trade potential | |||
| Worst-case potential | |||
| Scalar potential | |||
| Gap function | |||
B Concavity of the Gap Function
This appendix proves the concavity and monotonicity of the gap function used in Lemma 1.2. We do so by expressing as an infimum of affine functions with positive-semidefinite slopes.
Lemma B.1 (Gap representation and directional comparison). Fix with and define, for ,
The function admits the affine representation
Here is defined to be zero when . If , the infimum is attained at .
Each function inside the infimum in (24) is affine in and has positive-semidefinite slope. Consequently, is concave as a pointwise infimum of affine functions, and it is nondecreasing in the positive semidefinite order. Applied to in the Bayesian search model, the lemma thus implies
Proof of Lemma B.1. Fix and put , , , and . Expanding the square and using cyclicity of the trace gives
For , Cauchy-Schwarz in the -inner product, followed by , yields
Thus , and the reverse triangle inequality gives
Combining this inequality with (26) and rearranging proves
For , take ; the same bound follows directly from (26). If , equality holds at . For singular , the same value is approached by as .
C Supporting Proofs for Contextual Search
We have deferred two proofs in Section 2: Lemma 2.2 in the Bayesian analysis and Lemma 2.5 in the worst-case analysis. Both rely on the same one-dimensional potential decrease, stated in Lemma C.1 below. We first establish this common inequality, then use it to complete the two proofs.
C.1 A One-Dimensional Potential Lemma
Lemma C.1 (One-dimensional potential decrease). For and , define
Let be uniform on , set
and define
Then
In particular,

Figure 5: Prices and possible updated centers in Lemma C.1.
Proof. The identity for the expected loss follows by averaging over the two prices. We prove the potential bound by separating targets between the two prices from targets outside that interval, as illustrated in Figure 5.
Interior: . Both answers point inward, so and . The new center is or , each with probability 1/2. Thus
and
Here , proving (28) in this case.
Exterior: . By reflection, it suffices to consider . Both prices yield the answer Y = 1, and the two equally likely successor states are
Consequently,
and
Adding the two terms and using gives
Since , this proves the claim for exterior targets.
Boundary: . Our convention sign(0) = 1 gives one inward and one outward update when , as in the exterior calculation. When , both updates are inward, as in the interior calculation. Substituting into the corresponding expressions gives a decrease of exactly r/12 in either case, while the expected loss is r/2. This proves (28) at both endpoints. Finally, the expected loss is always at least r/2, which implies (29).
C.2 Proof of Lemma 2.2
Lemma 2.2 (One-bit deviation contraction). Let be a square-integrable real random variable, with and . Let be uniform on and independent of . Define
Writing the posterior standard deviation as , we have .
Proof of Lemma 2.2. If , then almost surely and , so the result is immediate. Assume . For any mean proxy and deviation proxy ,
Equality holds at and . We apply this bound conditionally after observing the price and answer, with the proxies
Because , the sign is determined by P, so these proxies are -measurable. Applying (30) to the conditional law yields
For each fixed , Lemma C.1 with and gives
Averaging over and using gives
Division by two proves the lemma.
C.3 Proof of Lemma 2.5
Lemma 2.5 (One-round potential decrease). On every round of Algorithm 2,
Proof of Lemma 2.5. For , the loss and potential change are both zero. Otherwise, condition on the history and current context, suppress time subscripts, and put
Since and , we have
For a realization of the random sign and the answer, let be the updated state. The update formulas imply
Thus are exactly the successor quantities in Lemma C.1.
We first prove the identity
The trace change is
For the quadratic term, write . The updates give
The inverse identity follows directly by multiplication with . Using and , we obtain
The second equality uses ; the third uses . Adding (33) proves (32).
Finally, take the conditional expectation and apply Lemma C.1:
where the last inequality is (31). This is the desired drift bound.
D Supporting Proofs for Bilateral Trade
We first prove the trade-or-information inequality of Lemma 3.1, which directly yields the Bayesian guarantee. We then use it, together with quadratic bounds derived from Lemma B.1 and a minimax argument, to prove the lottery-existence statement of Lemma 3.3.
D.1 Proof of Lemma 3.1
Recall that indicates whether trade occurs at price . The expected lost gain and the expected reduction in the sum of the two standard deviations are, respectively,
Before proving the lemma, we show that is nonnegative, provide a useful integral representation of the gain from trade, and introduce a useful result on the information produced by binary feedback.
Claim D.1. For every pair of square-integrable real random variables, for all .
Proof. For each , the law of total variance gives
Consequently, by Jensen's inequality and the concavity of the square root,
Thus, assuming finite variances, each summand in the definition of is nonnegative, and hence . Here, outcomes with are omitted from the sum.
Trade profile and gain from trade. Here we give an integral representation of the optimal expected gain from trade under , in terms of the trade-profile function . Denote the optimal expected gain from trade by , where denotes the positive part. The claim does not require independence and also holds when both sides are infinite.
Claim D.2 (Gain-from-trade decomposition). The following integral decomposition holds:
Proof. For every realization of , we can write the corresponding gain from trade as follows:
since the integral is the length of the interval of prices at which trade is possible. Because the integrand is nonnegative, Tonelli's theorem gives
Information as displacement. For any event of positive probability, we introduce two notions of “distance” to measure the information provided by the occurrence of about and .
The first quantity measures the distance from the posterior point to , while the second one is the conditional second moment around the unconditional mean .
Claim D.3 (Information is displacement). For a square-integrable and a binary signal ,
For either positive-probability branch , we also have
If , then .
Proof. By the law of total variance,
Expanding the square in the definition of and using this identity gives
which proves (34).
Fix an event of positive probability. The first inequality in (35) follows directly from
To prove the second inequality, first note that
Here the cross term vanishes because and, in particular, . Therefore,
Taking square roots proves , and hence (35).
Finally, if , the first inequality in (35) gives . Combining this with the second inequality yields
We now proceed with the proof of Lemma 3.1.
Lemma 3.1 (Trade or information). For every pair of square-integrable real random variables, there is a common price such that
The price can be chosen as a function of the joint distribution.
Proof. We write and for to denote the mean and standard deviation of valuation , respectively. As a first-order measure of the gain from trade achievable for a given pair , we use , while we use as a proxy for the spread of the two variables. We start by addressing some simple corner cases, and then move to the most challenging regime.
Deterministic values. If either or is zero, then one of the two variables is deterministic and posting that value yields the optimal gain from trade. If , then posting is optimal and yields (by Claim D.1); similarly, posting when yields the desired inequality.
Well-separated case. This case is characterized by a large distance between the expected values of and , relative to their standard deviations, i.e., , and a price satisfying the statement of the lemma is . Let be the event that trade fails at price . If always results in a trade, then Claim D.1 yields the statement. We may therefore assume that . Conditioning on , at least one of and exceeds . Hence
Put . Then
Claim D.3 applied to each agent under F yields
The vector has norm , while has norm at most . The quantity in brackets is therefore at least . It follows that
Overlapping case. We are left with the last case, i.e., , which is arguably the most intricate: the seller's and buyer's expected values are relatively close, and we want to find a “good” price. We tackle this case by providing a uniform upper bound on the trade profile , which yields, by Claim D.2, the desired result. We refer to Figure 4 for a visualization of this bound. Define the supremum of on by . Note that . We first bound the trade profile uniformly over all prices in terms of the auxiliary piecewise function :
If the central intervals overlap, the seller's bound is used through and the buyer's bound thereafter.
Claim D.4 (Uniform bound on the trade profile). For every , we have .
Proof. For any positive-probability branch of , Claim D.3 gives
We prove the seller's tail and central bounds first. If , both are immediate, so assume that has positive probability. For , we have , and hence
This proves the upper bound in the first piece of .
For , set , , and . Sellers trading at with are within of their mean. Those with also trade at the lower price , since . Thus, with ,
If , then . By Claim D.3,
The same bound on the last expectation in (37) is immediate if . On itself, Claim D.3 also gives . Consequently,
Rearranging and squaring yields , proving the second piece.
Applying these two bounds to gives the buyer's central bound for and tail bound for . These prove the fourth and fifth pieces. The third piece is simply . The five cases cover , regardless of the ordering of the two means.
By Claim D.2, we can now integrate the uniform bound in Claim D.4 over all of . The seller's tail and central pieces have integrals
The buyer's tail and central interval have the same respective integrals; restricting them to can only decrease their contribution. The plateau has length . Therefore,
Since , subtracting gives
Finally, , Cauchy-Schwarz, and the triangle inequality imply
Thus . If , every price has zero lost gain. Otherwise, because , choose any price with . Then .
D.2 Proof of Lemma 3.3
Recall the quadratic variational expression for , given in (6):
For a random vector with mean and covariance , expanding around the mean and applying Lemma B.1 with gives, for every and ,
with equality when and .
Lemma 3.3 (A valid lottery exists). For every , every block-diagonal , every context with , and every , there is a finite lottery of plans satisfying
Each plan in the lottery posts the same price, drawn from a finite grid, to both agents. The lottery can be chosen as a function of the state and context.
Proof. Fix the current state , context , and slack , and write . If , there is nothing to prove as the gain from trade is zero at any price, so assume . Let be the set of plans consisting of a common price and two successor states for , with each positive definite and block diagonal.
We recall some useful notation. For , the valuations and are given by and . For the price associated with the generic plan , we denote by the indicator of whether and permit trade at , and by the corresponding loss in terms of the gain from trade:
We denote by the value of the potential under the realized feedback for the generic plan with price and successor states for :
Finally, we introduce the function , which is central to our proof:
The function is defined in such a way that inequality (21) in the statement is equivalent to the existence of a finite lottery satisfying for every . We first show that, for every hypothetical prior, the infimum of the expected payoff over plans is nonpositive, and then use minimax and discretization to obtain a single such lottery for all hidden pairs.
A plan for each prior. Fix any valuation distribution over , where is the set of all possible prior distributions of the hidden pair on . We assume that and are induced by sampling according to and using the fixed context . For any such distribution, Lemma 3.1 supplies a common price with . For simplicity, let denote the bit . Write whenever . Here, the latter is the conditional law of given . Lemma 1.2, applied to both marginals, bounds by the decrease in , so
Here and below, sums over omit zero-probability branches. For , let and be the mean and covariance of under . For , define a plan with common price and successor states
Choose arbitrary admissible successor states on zero-probability branches. We add the perturbation to ensure that both and are positive definite, so the inverses of their square roots are well defined. Applying the quadratic variational identity (6) separately to the two marginals gives
To compute the limit, diagonalize each marginal covariance: an eigenvalue contributes to the corresponding conditional expected successor potential, which tends to as , including when . Combining the preceding bounds yields
Since was arbitrary, the “Bayesian value” satisfies
The following claim exchanges the order of choice and provides the regularity needed to discretize the resulting lottery. Its proof involves a nontrivial application of Sion’s theorem and is deferred to the end of the section. We introduce the inf sup value:
Claim D.5. Allowing arbitrary probability lotteries on , we have
Moreover, for every , there is a lottery with whose price distribution has bounded density and compact support, and whose successor states range over a compact set of positive-definite block-diagonal states.
A finite lottery on a finite grid. Apply Claim D.5 with . Since , it gives a lottery whose payoff is uniformly less than , with the regularity stated in the claim. Round its common price to the nearest multiple of , retaining both successor states. Compact price support ensures that only finitely many grid points occur. The feedback can change only if the original price lies within of or . The bounded density makes this event have probability uniformly over . The branch payoffs are uniformly bounded, so the rounding changes the expected payoff uniformly by .
Next replace the two successor states by representatives of a sufficiently fine finite net in their compact range. Uniform continuity of on the product of that range and allows the additional payoff error to be made uniformly as small as desired; choosing representatives from the range preserves positive definiteness and block diagonality. Take each of these two errors smaller than . The resulting lottery has finite support, satisfies (21), and uses common prices on a finite rational grid.
Sion’s theorem. Before proving Claim D.5, we recall Sion’s minimax theorem in its general semicontinuous form and record the affine version used in its proof. Recall that is defined as and is endowed with the Euclidean metric, so that it is a nonempty compact metric space. Quasiconcavity means that every superlevel set is convex, and quasiconvexity means that every sublevel set is convex.
Theorem D.6 (Sion’s minimax theorem [Sio58]). Let and be nonempty convex subsets of real topological vector spaces, and suppose that at least one of and is compact. Let satisfy the following conditions:
-
For every , the function is upper semicontinuous and quasiconcave on .
-
For every , the function is lower semicontinuous and quasiconvex on .
Then
Corollary D.7 (Separately continuous affine payoffs). Let be the space of continuous real-valued functions on . Let be nonempty and convex, equipped with the uniform norm. Equip the space of Borel probability measures on with the weak topology. Suppose that is separately continuous in these topologies and affine in each variable. Then
We now turn to the proof of Claim D.5.
Proof of Claim D.5. We start by proving the “easy” direction of the equality, via weak duality. For any prior and lottery , draw and independently. Then
The first and last inequalities use that an average is at least the infimum and at most the supremum. The exchange of expectations follows from Tonelli’s theorem after adding the constant , which makes the integrand nonnegative. Taking the supremum over and then the infimum over gives . Both values are finite: , and retaining the current state gives a bounded payoff.
We now move to the other direction. Unfortunately, we cannot directly invoke Sion’s theorem, as the function has the discontinuities induced by . To smooth it out, we introduce a random perturbation of the posted price. More precisely, we first average the discontinuous payoffs over a small random perturbation, apply minimax to the resulting continuous functions, and then let the perturbation vanish.
Fix any and let be sampled uniformly at random in (recall that is the nonzero context we are given). For any realization of , we define the perturbed vector as follows:
By construction, the “perturbed” values are just the original and , scaled by and shifted by :
Moreover, maps into itself, i.e., . To see this, we consider the first components of ; the other case is analogous:
For any base plan , draw and implement the common price and successor states
Denote this actual plan by . By construction, the original valuations and permit trade at the perturbed price if and only if the perturbed valuations permit trade at the original price, for any plan and realization of :
The transformation is used only in the analysis; the learner implements the displayed price and successor states using its sampled . For either branch , substitution into the quadratic potential gives
Also, , so the lost gain has the same scaling. Combining these identities and subtracting the unchanged current potential gives
The crucial fact is that now, for each fixed , the averaged payoff is continuous in . To see this, consider any sequence . Except at the two noise values and , the feedback at eventually agrees with that at , and the corresponding branch payoff converges. These exceptional values have probability zero under . Both branch payoffs are bounded on the compact set of hidden pairs and noise values , so dominated convergence applies, including when .
Moreover, the absolute value of the difference between and its scaled version converges uniformly to 0:
Indeed, , and the current potential is uniformly continuous on . In particular, the correction is controlled independently of the base plan .
For a prior , let be the law of when and is independent. Since , this is another prior in . Averaging the payoff identity and using the definition of yields
We are now ready to apply the version of Sion’s theorem presented in Corollary D.7. To this end, we consider the space of continuous functions from to , equipped with the uniform norm; in particular, we focus on , which is defined as the convex hull of the functions . By definition, every has the form
for finitely many base plans . To implement , first sample an index with probabilities , then independently sample as above and execute the plan . The resulting lottery on satisfies, for every hidden pair,
Here the mixture uses finitely many base plans, but itself need not have finite support because has a continuous distribution. Such lotteries are allowed in the definition of ; finite support will be obtained in the subsequent discretization step. Thus minimizing over restricts the admissible lotteries and can only increase the infimum defining .
Define the payoff pairing
Recall that is equipped with the uniform norm , while is equipped with the topology of weak convergence of probability measures. Since is compact, is compact in this topology; it is also convex. The set is convex by construction, and is affine in each argument separately.
Explicitly, for , , and , linearity of integration gives
These are exactly the affine identities required in Corollary D.7. We next check separate continuity, meaning continuity in either variable with the other held fixed.
For a fixed prior and any ,
For a fixed , weak convergence gives
because is continuous and bounded on . This is precisely where continuity of the smoothed payoffs is used.
We can therefore apply Corollary D.7 with and the pairing . The hidden-pair set is a nonempty compact metric space, is nonempty and convex with the uniform norm, and carries the weak topology. The two preceding calculations verify separate affinity and continuity. We obtain
For each fixed , an average under any prior is at most . Conversely, attains this maximum at some , and the point mass attains the same value in the prior formulation. Hence
For each fixed prior , linearity gives, for every finite mixture,
Since each individual also belongs to the convex hull, the reverse inequality holds after taking the infimum over . Thus
Combining the implementation of , the point-mass identity, Sion's exchange, and the convex-hull identity, in that order, gives
The last inequality is the bound proved above for every prior , whose right-hand side does not depend on . This estimate holds for every . Since is finite, letting gives . Together with weak duality, this proves equality: . The limit is taken only in this numerical bound, so no convergence of the implementing lotteries is needed.
For the additional assertion, choose small enough and then an element of whose maximum is less than ; no attainment of the infimum is required. This element is implemented by a finite mixture of the smoothed plans . Each common price is uniform on a bounded interval of positive length, and each successor state is a continuous function of on a compact interval. The finite mixture therefore has bounded price density, compact price support, and a compact range of positive-definite block-diagonal successor states.
More explicitly, every price interval has length , so the mixture's density is bounded by . The choice of and the finite mixture is fixed before the subsequent grid approximation.
Proof of Corollary D.7. Since is compact, is a compact convex subset of the space of finite signed Borel measures equipped with the weak topology. Apply Theorem D.6 with , , and the transposed payoff . For fixed , continuity in implies upper semicontinuity, and affinity implies concavity and hence quasiconcavity. For fixed , continuity in implies lower semicontinuity, and affinity implies convexity and hence quasiconvexity. Thus all the hypotheses hold, with compactness supplied by the prior space , and the theorem gives the stated equality.
E Lower Bounds
In this section, we present standard lower bounds for both contextual search and contextual bilateral trade. First, we recall the standard coordinate-wise lower-bound argument for contextual search [LPLS21].
Proposition E.1 (Lower bound for contextual search). For every , every , and every possibly randomized algorithm, there exists a fixed target with and a deterministic sequence of context vectors of norm at most one such that
Proof. We consider an adversary that chooses the coordinates of independently and uniformly from , so that . For the first rounds, the adversary lets be the -th basis vector, and sets afterward. At round , is independent of any previous observation made by the algorithm, and thus of the posted price . Therefore,
Summing the loss over provides the desired lower bound.
We now turn to the matching lower bound for contextual bilateral trade. The coordinate construction in [CFG+26, Proposition 4.3], rescaled to the Euclidean unit ball, gives the following bound. Here, we allow the learner to post two distinct prices, as long as budget balance is enforced, i.e., the price offered to the seller is at most the price offered to the buyer.
Proposition E.2 (Lower bound for contextual bilateral trade). For every , every , and every possibly randomized learner satisfying , there are a fixed pair and deterministic contexts of norm at most one for which
The same lower bound holds in the Bayesian setting for the prior whose coordinates are independent and for which each pair is uniform on .
Proof. This prior is supported on , since and . Use the -th coordinate context on rounds , and zero contexts afterwards. Each round has gain , but its trading interval is equally likely to be or . Conditional on the learner's random seed and previous coordinates, the current interval remains independent and uniform. The nonempty interval can lie inside at most one of these two disjoint intervals, so trade occurs with probability at most . Each of the first rounds therefore loses at least in expectation. Summing gives at least , and later losses are nonnegative. Averaging over this finite prior selects a fixed pair with at least the same expected loss, even when the learner is given the prior.
Both marginal covariances of this prior are , so . Thus the Bayesian lower bound is , and the dependence on the trace-square-root potential cannot be improved by more than a constant factor uniformly over priors. The dimension dependence in Theorems 3.2 and 3.4 is consequently optimal.