Documentation

CslibFrontier.GameTheory.PredictionMarket.LMSR

Hanson's Logarithmic Market Scoring Rule (LMSR) #

Robin Hanson's market scoring rule (MSR) turns any proper scoring rule S into a sequential automated market maker: a trader who updates the market's reported distribution from p₁ to p₂ receives net payoff S.score p₂ ω - S.score p₁ ω when outcome ω occurs [Hanson2003; PennockSami2007, §26.4.1, pp. 663–664]. Sequential payoffs telescope across any chain of updates, so the market maker's net loss depends only on the initial and final distributions.

For the logarithmic scoring rule scaled by liquidity parameter b > 0, Hanson's Logarithmic Market Scoring Rule (LMSR) is equivalent to a cost-function automated market maker with cost function

lmsrCost b q = b * Real.log (∑ ω, Real.exp (q ω / b))

and instantaneous price vector given by the softmax distribution

lmsrPrice b q ω = Real.exp (q ω / b) / ∑ ω', Real.exp (q ω' / b)

[Hanson2007; PennockSami2007, §26.4.1, pp. 663–664].

Main definitions #

Main results #

References #

def Cslib.GameTheory.PredictionMarket.msrStepPayoff {Ω : Type u_1} (S : ScoringRule Ω) (p₁ p₂ : Ω → ℝ) (ω : Ω) :

Net payoff S.score p₂ ω - S.score p₁ ω to a trader who updates the market scoring rule from distribution p₁ to p₂ when outcome ω realizes [Hanson2003; PennockSami2007, §26.4.1, pp. 663–664].

@[simp]
theorem Cslib.GameTheory.PredictionMarket.msrStepPayoff_apply {Ω : Type u_1} (S : ScoringRule Ω) (p₁ p₂ : Ω → ℝ) (ω : Ω) :
msrStepPayoff S p₁ p₂ ω = S.score p₂ ω - S.score p₁ ω
def Cslib.GameTheory.PredictionMarket.msrTotalPayoff {Ω : Type u_1} (S : ScoringRule Ω) (reports : ℕ → Ω → ℝ) (T : ℕ) (ω : Ω) :

Cumulative payoff across T sequential updates reports 0 → reports 1 → … → reports T under market scoring rule S.

theorem Cslib.GameTheory.PredictionMarket.msrTotalPayoff_eq_sub {Ω : Type u_1} (S : ScoringRule Ω) (reports : ℕ → Ω → ℝ) (T : ℕ) (ω : Ω) :
msrTotalPayoff S reports T ω = S.score (reports T) ω - S.score (reports 0) ω

Sequential MSR payoffs telescope: the net transfer from the market maker across any chain of updates depends only on the initial and final distributions [PennockSami2007, §26.4.1, pp. 663–664].

theorem Cslib.GameTheory.PredictionMarket.msrStepPayoff_expected_lt {Ω : Type u_1} [Fintype Ω] {S : ScoringRule Ω} {P : Set (Ω → ℝ)} (hS : S.IsStrictlyProperOn P) {q p₁ p₂ : Ω → ℝ} (hq : q ∈ P) (hp₂ : p₂ ∈ P) (hne : p₂ ≠ q) :
∑ ω : Ω, q ω * msrStepPayoff S p₁ p₂ ω < ∑ ω : Ω, q ω * msrStepPayoff S p₁ q ω

Myopic truthfulness of a strictly proper market scoring rule: a trader with true belief q ∈ P strictly maximizes expected net MSR payoff by updating the current report p₁ to q [Hanson2003; PennockSami2007, §26.4.1, pp. 663–664].

noncomputable def Cslib.GameTheory.PredictionMarket.lmsrCost {Ω : Type u_1} [Fintype Ω] (b : ℝ) (q : Ω → ℝ) :

Hanson's LMSR cost function with liquidity parameter b: C(q) = b * Real.log (∑ ω, Real.exp (q ω / b)) [PennockSami2007, §26.4.1, pp. 663–664; Hanson2007].

noncomputable def Cslib.GameTheory.PredictionMarket.lmsrPrice {Ω : Type u_1} [Fintype Ω] (b : ℝ) (q : Ω → ℝ) (ω : Ω) :

Instantaneous LMSR price vector (softmax probability distribution): p_ω(q) = Real.exp (q ω / b) / ∑ ω', Real.exp (q ω' / b) [PennockSami2007, §26.4.1, pp. 663–664].

noncomputable def Cslib.GameTheory.PredictionMarket.lmsrTraderPayoff {Ω : Type u_1} [Fintype Ω] (b : ℝ) (q₁ q₂ : Ω → ℝ) (ω : Ω) :

Net payoff (q₂ ω - q₁ ω) - (C(q₂) - C(q₁)) to the trader moving the LMSR state from q₁ to q₂ when outcome ω occurs. By zero-sum accounting, this equally equals the market maker's net loss on that transition.

@[simp]
theorem Cslib.GameTheory.PredictionMarket.lmsrCost_apply {Ω : Type u_1} [Fintype Ω] (b : ℝ) (q : Ω → ℝ) :
lmsrCost b q = b * Real.log (∑ ω : Ω, Real.exp (q ω / b))
@[simp]
theorem Cslib.GameTheory.PredictionMarket.lmsrPrice_apply {Ω : Type u_1} [Fintype Ω] (b : ℝ) (q : Ω → ℝ) (ω : Ω) :
lmsrPrice b q ω = Real.exp (q ω / b) / ∑ ω' : Ω, Real.exp (q ω' / b)
@[simp]
theorem Cslib.GameTheory.PredictionMarket.lmsrTraderPayoff_apply {Ω : Type u_1} [Fintype Ω] (b : ℝ) (q₁ q₂ : Ω → ℝ) (ω : Ω) :
lmsrTraderPayoff b q₁ q₂ ω = q₂ ω - q₁ ω - (lmsrCost b q₂ - lmsrCost b q₁)
theorem Cslib.GameTheory.PredictionMarket.lmsrPrice_pos {Ω : Type u_1} [Fintype Ω] [Nonempty Ω] (b : ℝ) (q : Ω → ℝ) (ω : Ω) :
0 < lmsrPrice b q ω

Every instantaneous LMSR price is strictly positive.

theorem Cslib.GameTheory.PredictionMarket.sum_lmsrPrice {Ω : Type u_1} [Fintype Ω] [Nonempty Ω] (b : ℝ) (q : Ω → ℝ) :
∑ ω : Ω, lmsrPrice b q ω = 1

Instantaneous LMSR prices sum to 1.

Instantaneous LMSR prices form a strictly positive probability distribution in openProbSimplex Ω [PennockSami2007, §26.4.1, pp. 663–664].

theorem Cslib.GameTheory.PredictionMarket.lmsrPrice_zero {Ω : Type u_1} [Fintype Ω] (b : ℝ) (ω : Ω) :
lmsrPrice b 0 ω = (↑(Fintype.card Ω))⁻¹

At zero shares, the LMSR price is uniform over Ω.

At zero shares, the LMSR cost equals b * Real.log |Ω|.

theorem Cslib.GameTheory.PredictionMarket.lmsrCost_add_const {Ω : Type u_1} [Fintype Ω] [Nonempty Ω] {b : ℝ} (hb : 0 < b) (q : Ω → ℝ) (c : ℝ) :
(lmsrCost b fun (ω : Ω) => q ω + c) = lmsrCost b q + c

Translation equivariance of lmsrCost: adding c shares of every outcome increases the cost by exactly c (no-arbitrage for risk-free constant bundles).

theorem Cslib.GameTheory.PredictionMarket.lmsrPrice_add_const {Ω : Type u_1} [Fintype Ω] {b : ℝ} (q : Ω → ℝ) (c : ℝ) :
(lmsrPrice b fun (ω : Ω) => q ω + c) = lmsrPrice b q

Translation invariance of lmsrPrice: adding a constant share bundle leaves prices unchanged.

theorem Cslib.GameTheory.PredictionMarket.lmsrPrice_log_eq {Ω : Type u_1} [Fintype Ω] {b : ℝ} (hb : 0 < b) {p : Ω → ℝ} (hp : p ∈ openProbSimplex Ω) :
(lmsrPrice b fun (ω : Ω) => b * Real.log (p ω)) = p

Log-inversion of softmax: for any strictly positive distribution p ∈ openProbSimplex Ω, the share vector ω ↦ b * log (p ω) induces price vector p.

theorem Cslib.GameTheory.PredictionMarket.lmsrCost_log_eq_zero {Ω : Type u_1} [Fintype Ω] {b : ℝ} (hb : 0 < b) {p : Ω → ℝ} (hp : p ∈ openProbSimplex Ω) :
(lmsrCost b fun (ω : Ω) => b * Real.log (p ω)) = 0

The log-inverted share vector ω ↦ b * log (p ω) has zero LMSR cost.

Instantaneous price as gradient of lmsrCost #

theorem Cslib.GameTheory.PredictionMarket.hasFDerivAt_lmsrCost {Ω : Type u_1} [Fintype Ω] [Nonempty Ω] {b : ℝ} (hb : 0 < b) (q : Ω → ℝ) :

Gradient identity for LMSR [PennockSami2007, §26.4.1, pp. 663–664]: the Fréchet derivative of lmsrCost b at q is v ↦ v ⬝ᵥ lmsrPrice b q.

theorem Cslib.GameTheory.PredictionMarket.hasDerivAt_lmsrCost_update {Ω : Type u_1} [Fintype Ω] [Nonempty Ω] [DecidableEq Ω] {b : ℝ} (hb : 0 < b) (q : Ω → ℝ) (ω : Ω) :
HasDerivAt (fun (t : ℝ) => lmsrCost b (Function.update q ω t)) (lmsrPrice b q ω) (q ω)

Coordinate partial derivative of lmsrCost b: ∂C / ∂q_ω = lmsrPrice b q ω [PennockSami2007, §26.4.1, pp. 663–664].

Convexity, KL-divergence Bregman identity, and monotonicity #

theorem Cslib.GameTheory.PredictionMarket.sub_lmsrCost_eq_mul_log_lmsrPrice {Ω : Type u_1} [Fintype Ω] [Nonempty Ω] {b : ℝ} (hb : 0 < b) (q : Ω → ℝ) (ω : Ω) :
q ω - lmsrCost b q = b * Real.log (lmsrPrice b q ω)

Fundamental LMSR log-price identity: q ω - C(q) = b * log (lmsrPrice b q ω).

theorem Cslib.GameTheory.PredictionMarket.lmsrCost_bregmanDivergence_eq {Ω : Type u_1} [Fintype Ω] [Nonempty Ω] {b : ℝ} (hb : 0 < b) (q₁ q₂ : Ω → ℝ) :
bregmanDivergence (lmsrCost b) (lmsrPrice b) q₂ q₁ = b * ((logScore Ω).expectedScore (lmsrPrice b q₁) (lmsrPrice b q₁) - (logScore Ω).expectedScore (lmsrPrice b q₁) (lmsrPrice b q₂))

Mathematical identity (original to this formalization): the Bregman divergence bregmanDivergence (lmsrCost b) (lmsrPrice b) q₂ q₁ equals b times the KL divergence (expected log-score gap) between the induced softmax distributions lmsrPrice b q₁ and lmsrPrice b q₂.

theorem Cslib.GameTheory.PredictionMarket.lmsrCost_subgradient_le {Ω : Type u_1} [Fintype Ω] [Nonempty Ω] {b : ℝ} (hb : 0 < b) (q₁ q₂ : Ω → ℝ) :
lmsrCost b q₁ + (q₂ - q₁) ⬝ᵥ lmsrPrice b q₁ ≤ lmsrCost b q₂

First-order subgradient inequality for lmsrCost b: every trade costs at least its instantaneous price valuation (q₂ - q₁) ⬝ᵥ lmsrPrice b q₁.

Global convexity of lmsrCost b on ℝ^Ω (original mathematical companion deduced from lmsrCost_subgradient_le and convexOn_of_forall_add_le).

theorem Cslib.GameTheory.PredictionMarket.lmsrCost_mono {Ω : Type u_1} [Fintype Ω] [Nonempty Ω] {b : ℝ} (hb : 0 < b) {q₁ q₂ : Ω → ℝ} (h : ∀ (ω : Ω), q₁ ω ≤ q₂ ω) :
lmsrCost b q₁ ≤ lmsrCost b q₂

Monotonicity of lmsrCost b: more shares in every outcome cost at least as much.

Equivalence with sequential logarithmic market scoring rule #

theorem Cslib.GameTheory.PredictionMarket.lmsrTraderPayoff_eq_msrStepPayoff {Ω : Type u_1} [Fintype Ω] [Nonempty Ω] {b : ℝ} (hb : 0 < b) (q₁ q₂ : Ω → ℝ) (ω : Ω) :
lmsrTraderPayoff b q₁ q₂ ω = msrStepPayoff ((logScore Ω).affine b 0) (lmsrPrice b q₁) (lmsrPrice b q₂) ω

Single-step LMSR / MSR equivalence [PennockSami2007, §26.4.1, pp. 663–664]: the net payoff of moving the cost-function market maker from q₁ to q₂ equals the payoff of updating Hanson's scaled logarithmic market scoring rule from lmsrPrice b q₁ to lmsrPrice b q₂.

theorem Cslib.GameTheory.PredictionMarket.sum_lmsrTraderPayoff_eq_msrTotalPayoff {Ω : Type u_1} [Fintype Ω] [Nonempty Ω] {b : ℝ} (hb : 0 < b) (qs : ℕ → Ω → ℝ) (T : ℕ) (ω : Ω) :
∑ t ∈ Finset.range T, lmsrTraderPayoff b (qs t) (qs (t + 1)) ω = msrTotalPayoff ((logScore Ω).affine b 0) (fun (t : ℕ) => lmsrPrice b (qs t)) T ω

Sequential LMSR / MSR equivalence [PennockSami2007, §26.4.1, pp. 663–664]: across any finite sequence of share updates qs 0, …, qs T, cumulative cost-function trading payoffs equal cumulative logarithmic MSR payoffs (and telescope to lmsrTraderPayoff b (qs 0) (qs T) ω).

theorem Cslib.GameTheory.PredictionMarket.sum_lmsrTraderPayoff_eq_endpoints {Ω : Type u_1} [Fintype Ω] (b : ℝ) (qs : ℕ → Ω → ℝ) (T : ℕ) (ω : Ω) :
∑ t ∈ Finset.range T, lmsrTraderPayoff b (qs t) (qs (t + 1)) ω = lmsrTraderPayoff b (qs 0) (qs T) ω

Path independence of LMSR trading: cumulative net payoff across any sequence qs 0, …, qs T depends only on the endpoints qs 0 and qs T.

theorem Cslib.GameTheory.PredictionMarket.exists_shares_lmsrTraderPayoff_eq_msrStepPayoff {Ω : Type u_1} [Fintype Ω] [Nonempty Ω] {b : ℝ} (hb : 0 < b) {ps : ℕ → Ω → ℝ} (hps : ∀ (t : ℕ), ps t ∈ openProbSimplex Ω) :
∃ (qs : ℕ → Ω → ℝ), (∀ (t : ℕ), lmsrPrice b (qs t) = ps t) ∧ ∀ (t : ℕ) (ω : Ω), lmsrTraderPayoff b (qs t) (qs (t + 1)) ω = msrStepPayoff ((logScore Ω).affine b 0) (ps t) (ps (t + 1)) ω

Realizability of any sequential MSR trajectory by LMSR cost-function trading [PennockSami2007, §26.4.1, pp. 663–664]: every sequence of strictly positive probability reports ps : ℕ → Ω → ℝ is realized by an explicit sequence of LMSR share vectors with identical prices and identical step-by-step payoffs.

Bounded worst-case market-maker loss and tightness #

theorem Cslib.GameTheory.PredictionMarket.lmsrTraderPayoff_le_neg_mul_log_price {Ω : Type u_1} [Fintype Ω] [Nonempty Ω] {b : ℝ} (hb : 0 < b) (q₀ q : Ω → ℝ) (ω : Ω) :
lmsrTraderPayoff b q₀ q ω ≤ -(b * Real.log (lmsrPrice b q₀ ω))

General worst-case LMSR market-maker loss bound from an arbitrary initial state q₀: for every final share vector q and every outcome ω, the market maker's net loss is at most -b * log (lmsrPrice b q₀ ω).

theorem Cslib.GameTheory.PredictionMarket.lmsrTraderPayoff_zero_le {Ω : Type u_1} [Fintype Ω] [Nonempty Ω] {b : ℝ} (hb : 0 < b) (q : Ω → ℝ) (ω : Ω) :

Worst-case LMSR market-maker loss bound [PennockSami2007, §26.4.1, pp. 663–664; Hanson2007]: starting from zero initial shares (q₀ = 0, uniform initial prices), for every final share vector q and every outcome ω, the market maker loses at most b * Real.log |Ω|.

theorem Cslib.GameTheory.PredictionMarket.lmsrTraderPayoff_zero_seq_le {Ω : Type u_1} [Fintype Ω] [Nonempty Ω] {b : ℝ} (hb : 0 < b) {qs : ℕ → Ω → ℝ} (h0 : qs 0 = 0) (T : ℕ) (ω : Ω) :
∑ t ∈ Finset.range T, lmsrTraderPayoff b (qs t) (qs (t + 1)) ω ≤ b * Real.log ↑(Fintype.card Ω)

Sequential form of the worst-case LMSR loss bound: starting from qs 0 = 0, the cumulative market-maker loss over any number T of trades and any outcome ω is at most b * Real.log |Ω| [PennockSami2007, §26.4.1, pp. 663–664].

theorem Cslib.GameTheory.PredictionMarket.exists_lmsrTraderPayoff_zero_gt {Ω : Type u_1} [Fintype Ω] [Nonempty Ω] {b : ℝ} (hb : 0 < b) (ω : Ω) {ε : ℝ} (hε : 0 < ε) :
∃ (q : Ω → ℝ), b * Real.log ↑(Fintype.card Ω) - ε < lmsrTraderPayoff b 0 q ω

Tightness of the b * log |Ω| worst-case loss bound: for every outcome ω and every ε > 0, there exists a share vector q causing market-maker loss strictly exceeding b * Real.log |Ω| - ε.

Conditional LMSR securities (Exercise 26.3, pp. 674–675) #

noncomputable def Cslib.GameTheory.PredictionMarket.lmsrCondCost {Ω : Type u_1} (b : ℝ) (ψ : Finset Ω) (q : Ω → ℝ) :

Conditional LMSR cost function C_ψ(q) = b * log (∑ ω ∈ ψ, exp (q ω / b)) summed only over states in event ψ [PennockSami2007, Exercise 26.3, p. 674].

noncomputable def Cslib.GameTheory.PredictionMarket.lmsrCondPrice {Ω : Type u_1} [Fintype Ω] [DecidableEq Ω] (b : ℝ) (q : Ω → ℝ) (φ ψ : Finset Ω) :

Instantaneous Bayes-rule price of conditional security S_{φ|ψ}: the price of S_{φ∧ψ} divided by the price of S_ψ [PennockSami2007, Exercise 26.3, p. 674].

noncomputable def Cslib.GameTheory.PredictionMarket.lmsrCondUpdate {Ω : Type u_1} [DecidableEq Ω] (b : ℝ) (φ ψ : Finset Ω) (q : Ω → ℝ) (δ : ℝ) (ω : Ω) :

New LMSR share vector after a trader purchases δ shares of conditional security S_{φ|ψ}: states in φ ∩ ψ gain δ shares, states in ψ \ φ stay unchanged, and states outside ψ gain C_ψ(q + δ · 1_φ) - C_ψ(q) shares so the cost is refunded when ψ does not occur [PennockSami2007, Exercise 26.3(b), p. 675].

@[simp]
theorem Cslib.GameTheory.PredictionMarket.lmsrCondCost_apply {Ω : Type u_1} (b : ℝ) (ψ : Finset Ω) (q : Ω → ℝ) :
lmsrCondCost b ψ q = b * Real.log (∑ ω ∈ ψ, Real.exp (q ω / b))
@[simp]
theorem Cslib.GameTheory.PredictionMarket.lmsrCondPrice_apply {Ω : Type u_1} [Fintype Ω] [DecidableEq Ω] (b : ℝ) (q : Ω → ℝ) (φ ψ : Finset Ω) :
lmsrCondPrice b q φ ψ = (∑ ω ∈ φ ∩ ψ, lmsrPrice b q ω) / ∑ ω ∈ ψ, lmsrPrice b q ω
@[simp]
theorem Cslib.GameTheory.PredictionMarket.lmsrCondUpdate_apply {Ω : Type u_1} [DecidableEq Ω] (b : ℝ) (φ ψ : Finset Ω) (q : Ω → ℝ) (δ : ℝ) (ω : Ω) :
lmsrCondUpdate b φ ψ q δ ω = if ω ∈ ψ then if ω ∈ φ then q ω + δ else q ω else q ω + ((lmsrCondCost b ψ fun (ω' : Ω) => q ω' + if ω' ∈ φ then δ else 0) - lmsrCondCost b ψ q)
theorem Cslib.GameTheory.PredictionMarket.lmsrCondPrice_eq_div_sum_exp {Ω : Type u_1} [Fintype Ω] [DecidableEq Ω] (b : ℝ) (q : Ω → ℝ) (φ : Finset Ω) {ψ : Finset Ω} (hψ : ψ.Nonempty) :
lmsrCondPrice b q φ ψ = (∑ ω ∈ φ ∩ ψ, Real.exp (q ω / b)) / ∑ ω ∈ ψ, Real.exp (q ω / b)

Bayes-rule conditional price simplifies directly to the restricted softmax ratio over ψ.

theorem Cslib.GameTheory.PredictionMarket.hasDerivAt_lmsrCondCost_shift {Ω : Type u_1} [Fintype Ω] [DecidableEq Ω] {b : ℝ} (hb : 0 < b) (φ : Finset Ω) {ψ : Finset Ω} (hψ : ψ.Nonempty) (q : Ω → ℝ) (t : ℝ) :
HasDerivAt (fun (s : ℝ) => lmsrCondCost b ψ fun (ω : Ω) => q ω + if ω ∈ φ then s else 0) (lmsrCondPrice b (fun (ω : Ω) => q ω + if ω ∈ φ then t else 0) φ ψ) t

Derivative of t ↦ C_ψ(q + t · 1_φ) equals the instantaneous conditional price of S_{φ|ψ} at q + t · 1_φ [PennockSami2007, Exercise 26.3(a), p. 674].

theorem Cslib.GameTheory.PredictionMarket.integral_lmsrCondPrice_eq_sub_lmsrCondCost {Ω : Type u_1} [Fintype Ω] [DecidableEq Ω] {b : ℝ} (hb : 0 < b) (φ : Finset Ω) {ψ : Finset Ω} (hψ : ψ.Nonempty) (q : Ω → ℝ) (δ : ℝ) :
∫ (t : ℝ) in 0..δ, lmsrCondPrice b (fun (ω : Ω) => q ω + if ω ∈ φ then t else 0) φ ψ = (lmsrCondCost b ψ fun (ω : Ω) => q ω + if ω ∈ φ then δ else 0) - lmsrCondCost b ψ q

Exercise 26.3(a) ([PennockSami2007, p. 674]): integrating the Bayes-rule instantaneous price of S_{φ|ψ} from 0 to δ equals the conditional cost difference C_ψ(q + δ · 1_φ) - C_ψ(q).

theorem Cslib.GameTheory.PredictionMarket.lmsrCost_lmsrCondUpdate_sub {Ω : Type u_1} [Fintype Ω] [DecidableEq Ω] {b : ℝ} (hb : 0 < b) (φ : Finset Ω) {ψ : Finset Ω} (hψ : ψ.Nonempty) (q : Ω → ℝ) (δ : ℝ) :
lmsrCost b (lmsrCondUpdate b φ ψ q δ) - lmsrCost b q = (lmsrCondCost b ψ fun (ω' : Ω) => q ω' + if ω' ∈ φ then δ else 0) - lmsrCondCost b ψ q

Exercise 26.3(b), total cost identity ([PennockSami2007, p. 675]): updating the LMSR share vector from q to lmsrCondUpdate b φ ψ q δ increases the full LMSR cost C(q) by exactly the conditional cost C_ψ(q + δ · 1_φ) - C_ψ(q).

theorem Cslib.GameTheory.PredictionMarket.lmsrTraderPayoff_lmsrCondUpdate {Ω : Type u_1} [Fintype Ω] [DecidableEq Ω] {b : ℝ} (hb : 0 < b) (φ : Finset Ω) {ψ : Finset Ω} (hψ : ψ.Nonempty) (q : Ω → ℝ) (δ : ℝ) (ω : Ω) :
lmsrTraderPayoff b q (lmsrCondUpdate b φ ψ q δ) ω = if ω ∈ ψ then (if ω ∈ φ then δ else 0) - ((lmsrCondCost b ψ fun (ω' : Ω) => q ω' + if ω' ∈ φ then δ else 0) - lmsrCondCost b ψ q) else 0

Exercise 26.3(b), conditional security payoff ([PennockSami2007, p. 675]): moving the LMSR state from q to lmsrCondUpdate b φ ψ q δ delivers exact conditional-security net payoff: δ - cost when ω ∈ φ ∩ ψ, -cost when ω ∈ ψ \ φ, and 0 (cancelled and refunded) when ω ∉ ψ.

theorem Cslib.GameTheory.PredictionMarket.lmsrPrice_lmsrCondUpdate_of_notMem {Ω : Type u_1} [Fintype Ω] [DecidableEq Ω] {b : ℝ} (hb : 0 < b) (φ : Finset Ω) {ψ : Finset Ω} (hψ : ψ.Nonempty) (q : Ω → ℝ) (δ : ℝ) {ω : Ω} (hω : ω ∉ ψ) :
lmsrPrice b (lmsrCondUpdate b φ ψ q δ) ω = lmsrPrice b q ω

Exercise 26.3(b), price invariance outside ψ: purchasing δ shares of conditional security S_{φ|ψ} leaves the instantaneous price of every outcome outside ψ unchanged.