MathFin
Map / Choice · Market microstructure / MathFin.Markets.Microstructure.GlostenMilgrom

Glosten-Milgrom adverse-selection bid-ask spread

MathFin.Markets.Microstructure.GlostenMilgromMSC 91B26JEL D82JEL G14 source

Glosten and Milgrom (1985) derive the bid-ask spread from adverse selection alone. A fraction p of arriving traders know a binary asset value V ∈ {V_L, V_H}; the rest trade at random. A competitive market maker quotes

ask = E[V | buy], bid = E[V | sell],

updating by Bayes on the direction of the order. The spread is what is left.

Two modelling conventions, both visible in the statements. The sell event is Bᶜ: every arriving trader either buys or sells, so there is no no-trade outcome, and bid = E[V | Bᶜ]. And the quotes are posited to be those conditional expectations — Glosten-Milgrom's derivation of them from a competitive market maker's zero expected profit is not formalized here.

The four stages below are marked by section headers. The fourth is what makes the other three a single theorem rather than three separate ones: cond_toReal_eq is Bayes pushed through .toReal, and that is what identifies the model's posterior μ[H | B] with the real function postBuy stage 3 reasons about. toReal sends ∞ ↦ 0 and x/0 ↦ 0, so every conversion below carries its ≠ ∞ side condition.

The ℝ≥0∞ stages state the trade probabilities additively — 2·P = 1 + p, 2·P + p = 1 — so that no step ever forms a difference in a type where subtraction truncates. The textbook form does follow from the additive one (ENNReal.eq_sub_of_add_eq, given p ≠ ∞); it is the proofs, not the statements, that the additive form buys.

The hypothesis 0 < θ < 1

The usual statement of the result omits it. It is not a technical convenience, and the two endpoints fail for different reasons.

With p < 1 a degenerate prior leaves nothing to be adversely selected: both posteriors coincide, the spread is exactly 0, and ask - bid > 0 is false.

A degenerate prior with p = 1 is worse, in two ways both machine-checked here. One of the two trade events becomes null, and quote_eq_zero_of_null shows what cond then returns: not a bad price but the zero measure, whose integral is 0. And spread_junk_at_corner evaluates the closed form at θ = 1, p = 1 — it returns the entire V_H - V_L, the largest spread there could be, at the one point where the true spread is 0, because 0/0 = 0. Nothing errors in either case. Excluding the endpoints excludes both at once.

The derivation demands the hypothesis independently: two_mul_cond_buy_high needs μ H ≠ 0 and two_mul_cond_buy_low_add needs μ Hᶜ ≠ 0, so their hypotheses cannot be jointly satisfied without 0 < θ < 1.

A model satisfying all of them — so the theorem is not vacuous — is in MathFin.Markets.Microstructure.GlostenMilgromModel.

Main definitions

  • payoff: the two-valued asset, VL + indicator H (VH - VL), equal to VH on the high event H and VL off it.
  • postBuy, postSell: the posterior probability that the value is high after a buy, (1 + p) θ / (1 + p (2θ - 1)), and after a sell, (1 - p) θ / (1 - p (2θ - 1)).

Main results

  • two_mul_cond_buy_high, two_mul_cond_buy_low_add: the trade probabilities, derived from the trader mix.
  • payoff, spread_eq: the quotes as integrals, and the payoff cancelling.
  • postBuy, postSell, post_sub_post: the posteriors and the closed form 4pθ(1-θ) / (1 - p²(2θ-1)²).
  • cond_toReal_eq: Bayes in ℝ — the seam.
  • postBuy_eq, postSell_eq: the model's posteriors are postBuy/postSell.
  • spread_pos_of_model: ∫ V ∂μ[|buy] > ∫ V ∂μ[|sell], from the model's own primitives.
  • quote_eq_zero_of_null, spread_junk_at_corner: what the excluded endpoints actually do — a quote that is not a quote, and a closed form returning the whole value range.

References

  • L. R. Glosten and P. R. Milgrom, Bid, ask and transaction prices in a specialist market with heterogeneously informed traders [GlostenMilgrom1985].

Tags

Glosten–Milgrom model, bid–ask spread, adverse selection, market maker, informed trader, market microstructure, Bayesian updating, MSC 91B26, JEL D82, JEL G14

Import neighbourhood

Above: what it imports. Below: what imports it.

Corpus entries

mf-glosten-milgrom-spread-positive · market_microstructure.json · full statement
Glosten-Milgrom Adverse-Selection Spread Is Positive

The market maker's ask strictly exceeds its bid, from the trader mix alone: a buy moves the posterior on the high value strictly more than a sell does, so the two quotes cannot coincide. The two trade probabilities are derived from the model's four primitives rather than assumed. Requires 0 < theta < 1, which issue #107's acceptance criterion omits. Delivered scope: the quotes ask = E[V | buy] and bid = E[V | sell] are posited by the shape of the conclusion, not derived from a competitive market maker's zero expected profit, which is the content of Glosten-Milgrom (1985); the sell event is the complement of the buy event, so there is no no-trade outcome; one period and two-valued, with no dynamics.

Declarations 28

theoremMathFin.Execution.inter_informedsource
∀ {Ω : Type u_1} (H B I : Set Ω), B ∩ I = H ∩ I → H ∩ B ∩ I = H ∩ I

The informed half. On the high-value event, every informed trader buys, so the buy-and-informed mass is exactly the informed mass.

theoremMathFin.Execution.inter_informed_lowsource
∀ {Ω : Type u_1} (H B I : Set Ω), B ∩ I = H ∩ I → Hᶜ ∩ B ∩ I = ∅

The informed half, low value. An informed trader facing a low value sells, so the buy-and-informed mass on Hᶜ is empty. Derived from the same primitive — no extra hypothesis.

theoremMathFin.Execution.two_mul_inter_high_buysource
∀ {Ω : Type u_1} [MeasurableSpace Ω] (μ : Measure Ω) (H B I : Set Ω), MeasurableSet I → ∀ {θ p : ENNReal}, B ∩ I = H ∩ I → μ (H ∩ I) = p * θ → μ H = θ → 2 * μ ((H ∩ B) \ I) = μ (H \ I) → 2 * μ (H ∩ B) = (1 + p) * θ

The trade probability, derived. Doubling clears the uninformed 1/2 without ever subtracting: 2·μ(H ∩ B) = (1 + p)·θ.

theoremMathFin.Execution.two_mul_cond_buy_highsource
∀ {Ω : Type u_1} [MeasurableSpace Ω] (μ : Measure Ω) (H B I : Set Ω), MeasurableSet H → MeasurableSet I → ∀ {θ p : ENNReal}, θ ≠ 0 → θ ≠ ⊤ → B ∩ I = H ∩ I → μ (H ∩ I) = p * θ → μ H = θ → 2 * μ ((H ∩ B) \ I) = μ (H \ I) → 2 * μ[B | H] = 1 + p

P(buy | V_H), subtraction- and division-free. The additive form 2·P = 1 + p is the one ℝ≥0∞ actually likes.

theoremMathFin.Execution.two_mul_cond_buy_low_addsource
∀ {Ω : Type u_1} [MeasurableSpace Ω] (μ : Measure Ω) (H B I : Set Ω), MeasurableSet Hᶜ → MeasurableSet I → ∀ {θ' p : ENNReal}, θ' ≠ 0 → θ' ≠ ⊤ → B ∩ I = H ∩ I → μ (Hᶜ ∩ I) = p * θ' → μ Hᶜ = θ' → 2 * μ ((Hᶜ ∩ B) \ I) = μ (Hᶜ \ I) → 2 * μ[B | Hᶜ] + p = 1

P(buy | V_L) = (1 − p)/2, stated additively as 2·P + p = 1 — because 1 - p truncates in ℝ≥0∞ and this form does not.

And note which hypothesis the proof demands: μ Hᶜ ≠ 0, i.e. θ ≠ 1. Together with θ ≠ 0 from the high-value case, the model itself forces 0 < θ < 1 — exactly the hypothesis the issue is missing. It is not an extra condition imposed on the theorem; it is what the derivation needs in order to exist.

defMathFin.Execution.payoffsource
{Ω : Type u_1} → Set Ω → ℝ → ℝ → Ω → ℝ

The two-valued asset: V_H on the high event H, V_L off it. Written as a constant plus an indicator, which is what makes it integrable for free.

theoremMathFin.Execution.integral_payoffsource
∀ {Ω : Type u_1} [MeasurableSpace Ω] (ν : Measure Ω) [IsProbabilityMeasure ν] (H : Set Ω), MeasurableSet H → ∀ (VL VH : ℝ), ∫ (ω : Ω), payoff H VL VH ω ∂ν = VL + (ν H).toReal * (VH - VL)

The expectation of a two-valued payoff. Against any probability measure, E[V] = V_L + P(H)·(V_H − V_L).

theoremMathFin.Execution.integral_payoff_condsource
∀ {Ω : Type u_1} [MeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] (E H : Set Ω), MeasurableSet H → μ E ≠ 0 → ∀ (VL VH : ℝ), ∫ (ω : Ω), payoff H VL VH ω ∂μ[|E] = VL + μ[H | E].toReal * (VH - VL)

The quote. E[V | E] for a conditioning event of positive probability — this is ask when E is a buy and bid when E is a sell.

used by 1: spread_eq
theoremMathFin.Execution.spread_eqsource
∀ {Ω : Type u_1} [MeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] (B S H : Set Ω), MeasurableSet H → μ B ≠ 0 → μ S ≠ 0 → ∀ (VL VH : ℝ), ∫ (ω : Ω), payoff H VL VH ω ∂μ[|B] - ∫ (ω : Ω), payoff H VL VH ω ∂μ[|S] = (VH - VL) * (μ[H | B].toReal - μ[H | S].toReal)

The spread, reduced to the posteriors. Every trace of the payoff cancels except the scale V_H − V_L; what is left is exactly how much a buy moves the belief relative to a sell. Adverse selection, and nothing else, sets the spread.

theoremMathFin.Execution.quote_eq_zero_of_nullsource
∀ {Ω : Type u_1} [MeasurableSpace Ω] (μ : Measure Ω) (H B : Set Ω) (VL VH : ℝ), μ B = 0 → ∫ (ω : Ω), payoff H VL VH ω ∂μ[|B] = 0

A null trade event does not give a bad quote — it gives no quote. cond on a null set is the zero measure, so the "price" integrates to 0 whatever the asset is worth. This is what a degenerate prior can do to a quote: at θ = 1, p = 1 every arriving trader buys, so Bᶜ is null and the "bid" is not a bad price but no price at all. p = 1 alone is harmless and is not excluded — spread_pos_of_model derives p ≤ 1 rather than assuming it, and at p = 1 with 0 < θ < 1 both trade events still carry positive mass. It is the prior's endpoints that have to go.

defMathFin.Execution.postBuysource
ℝ → ℝ → ℝ

Posterior that the value is high, after a buy: θ(1+p) / (1 + p(2θ−1)).

defMathFin.Execution.postSellsource
ℝ → ℝ → ℝ

Posterior that the value is high, after a sell: θ(1−p) / (1 − p(2θ−1)).

theoremMathFin.Execution.buy_denom_possource
∀ {θ p : ℝ}, 0 < θ → 0 ≤ p → p ≤ 1 → 0 < 1 + p * (2 * θ - 1)

The buy denominator is positive. Note 1 + p(2θ−1) is twice P(buy) (see hBreal in spread_pos_of_model), not P(buy) itself. Positivity holds because it equals (1−p) + 2pθ, two non-negative terms with the second strictly positive — which is the hint nlinarith is given, so no case split on the sign of 2θ−1 is needed.

theoremMathFin.Execution.sell_denom_possource
∀ {θ p : ℝ}, θ < 1 → 0 ≤ p → p ≤ 1 → 0 < 1 - p * (2 * θ - 1)

The sell denominator is positive — likewise twice P(sell) — by the mirror identity 1 − p(2θ−1) = (1−p) + 2p(1−θ).

theoremMathFin.Execution.post_sub_postsource
∀ {θ p : ℝ}, 0 < θ → θ < 1 → 0 < p → p ≤ 1 → postBuy θ p - postSell θ p = 4 * p * θ * (1 - θ) / (1 - p ^ 2 * (2 * θ - 1) ^ 2)

The closed form of the spread's belief term — the formula the issue's ## Task states, now derived: postBuy − postSell = 4pθ(1−θ) / (1 − p²(2θ−1)²).

The θ(1−θ) in the numerator is the whole point: it is what the acceptance criterion forgets, and it vanishes exactly at θ ∈ {0,1}.

theoremMathFin.Execution.postSell_lt_postBuysource
∀ {θ p : ℝ}, 0 < θ → θ < 1 → 0 < p → p ≤ 1 → postSell θ p < postBuy θ p

A buy moves the belief strictly more than a sell does. This is the whole economic content: the order's direction is informative, so the two quotes cannot coincide.

used by 1: spread_pos
theoremMathFin.Execution.spread_possource
∀ {θ p VL VH : ℝ}, 0 < θ → θ < 1 → 0 < p → p ≤ 1 → VL < VH → 0 < (VH - VL) * (postBuy θ p - postSell θ p)

The theorem the issue asks for, with the hypotheses it is missing: ask − bid > 0 whenever V_L < V_H, 0 < p ≤ 1 and 0 < θ < 1 — where ask − bid = (V_H − V_L)·(postBuy − postSell) is exactly Stage 2's spread_eq.

theoremMathFin.Execution.postSell_one_onesource
postSell 1 1 = 0

postSell 1 1 = 0/0, which Lean evaluates to 0 rather than rejecting.

theoremMathFin.Execution.postBuy_one_onesource
postBuy 1 1 = 1

postBuy 1 1 = 1: after a buy the value is certainly high — which is true, and is exactly why the difference below is the whole value range.

theoremMathFin.Execution.spread_junk_at_cornersource
∀ (VL VH : ℝ), (VH - VL) * (postBuy 1 1 - postSell 1 1) = VH - VL

The punchline. At θ = 1, p = 1 the closed form hands back the entire value range as the spread — the largest it could conceivably be — at exactly the point where the value is common knowledge and the true spread is 0. Nothing errors, nothing is flagged; 0/0 = 0 does it all. A full entry quantified over p ≤ 1 and unconstrained θ would carry this inside it.

theoremMathFin.Execution.measure_toReal_of_likelihoodssource
∀ {Ω : Type u_1} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (E H : Set Ω), MeasurableSet H → ∀ {a c t : ℝ}, μ[E | H].toReal = a → μ[E | Hᶜ].toReal = c → (μ H).toReal = t → (μ E).toReal = a * t + c * (1 - t)

The unconditional probability of E, in ℝ. The law of total probability, converted once.

theoremMathFin.Execution.cond_toReal_eqsource
∀ {Ω : Type u_1} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (E H : Set Ω), MeasurableSet E → MeasurableSet H → ∀ {a c t : ℝ}, μ[E | H].toReal = a → μ[E | Hᶜ].toReal = c → (μ H).toReal = t → μ[H | E].toReal = a * t / (a * t + c * (1 - t))

THE SEAM. Bayes' theorem, pushed through .toReal: the posterior on H after observing E is the Bayes ratio of the two likelihoods against the prior.

This is what makes the stages one argument rather than three. Stage 2 hands back (μ[H | E]).toReal; Stage 3 reasons about a ratio of real numbers; this says they are the same number. No hypothesis that the denominator is nonzero is needed — in the degenerate case both sides are 0, which is precisely the behaviour the issue's statement must not be allowed to hide.

theoremMathFin.Execution.cond_compl_toRealsource
∀ {Ω : Type u_1} [MeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] (E F : Set Ω), MeasurableSet E → μ F ≠ 0 → μ[Eᶜ | F].toReal = 1 - μ[E | F].toReal

The complementary likelihood. P(Eᶜ | F) = 1 − P(E | F), in ℝ, given that F is not null — the hypothesis the model already forces.

theoremMathFin.Execution.cond_buy_high_toRealsource
∀ {Ω : Type u_1} [MeasurableSpace Ω] (μ : Measure Ω) (H B : Set Ω) {p : ℝ}, 0 ≤ p → 2 * μ[B | H] = 1 + ENNReal.ofReal p → μ[B | H].toReal = (1 + p) / 2

P(buy | V_H) = (1+p)/2, converted from Stage 1's additive form.

theoremMathFin.Execution.cond_buy_low_toRealsource
∀ {Ω : Type u_1} [MeasurableSpace Ω] (μ : Measure Ω) (H B : Set Ω) {p : ℝ}, 0 ≤ p → 2 * μ[B | Hᶜ] + ENNReal.ofReal p = 1 → μ[B | Hᶜ].toReal = (1 - p) / 2

P(buy | V_L) = (1−p)/2, converted from Stage 1's additive form.

theoremMathFin.Execution.postBuy_eqsource
∀ {Ω : Type u_1} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (H B : Set Ω), MeasurableSet B → MeasurableSet H → ∀ {θ p : ℝ}, 0 ≤ p → (μ H).toReal = θ → 2 * μ[B | H] = 1 + ENNReal.ofReal p → 2 * μ[B | Hᶜ] + ENNReal.ofReal p = 1 → μ[H | B].toReal = postBuy θ p

The posterior after a buy is exactly postBuy. Stage 3's postBuy was a real function of two real numbers with no measure in sight; this is the theorem that makes it the model's posterior.

theoremMathFin.Execution.postSell_eqsource
∀ {Ω : Type u_1} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (H B : Set Ω), MeasurableSet B → MeasurableSet H → ∀ {θ p : ℝ}, 0 ≤ p → (μ H).toReal = θ → μ Hᶜ ≠ 0 → 2 * μ[B | H] = 1 + ENNReal.ofReal p → 2 * μ[B | Hᶜ] + ENNReal.ofReal p = 1 → μ[H | Bᶜ].toReal = postSell θ p

The posterior after a sell is exactly postSell. The sell event is Bᶜ — every arriving trader either buys or sells — so the likelihoods are the buy ones swapped, and the same seam lemma does the work.

Only μ Hᶜ ≠ 0 (that is, θ ≠ 1) is taken as a hypothesis. Its mirror μ H ≠ 0 is derived: at a degenerate prior cond collapses to the zero measure, so hhigh would read 0 = 1 + p.

theoremMathFin.Execution.spread_pos_of_modelsource
∀ {Ω : Type u_1} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (H B I : Set Ω), MeasurableSet H → MeasurableSet B → MeasurableSet I → ∀ {θ p VL VH : ℝ}, 0 < θ → θ < 1 → 0 < p → VL < VH → μ H = ENNReal.ofReal θ → B ∩ I = H ∩ I → μ (H ∩ I) = ENNReal.ofReal p * ENNReal.ofReal θ → μ (Hᶜ ∩ I) = ENNReal.ofReal p * ENNReal.ofReal (1 - θ) → 2 * μ ((H ∩ B) \ I) = μ (H \ I) → 2 * μ ((Hᶜ ∩ B) \ I) = μ (Hᶜ \ I) → 0 < ∫ (ω : Ω), payoff H VL VH ω ∂μ[|B] - ∫ (ω : Ω), payoff H VL VH ω ∂μ[|Bᶜ]

Glosten–Milgrom: the spread is strictly positive. The market maker's ask and bid are ∫ V ∂μ[|buy] and ∫ V ∂μ[|sell], and the first strictly exceeds the second whenever V_L < V_H, 0 < p ≤ 1 and 0 < θ < 1.

This is the issue's ## Acceptance criteria, with the hypothesis it omits. The chain is: Stage 1 derives the trade probabilities from the trader mix; Stage 4 converts them and applies Bayes to get the posteriors; Stage 2 turns the quotes into those posteriors; Stage 3 supplies the strict inequality.