Distributed computation through Boolean prediction markets #
This module formalizes the synchronous Shapley–Shubik Boolean prediction market model and its information-aggregation characterization from [PennockSami2007, §26.5, pp. 665–669].
Model and conventions #
There are n agents (i : Fin n, with 0 < n), each holding a private bit x i : Bool of the
true state x : Fin n → Bool, and a Boolean security f : (Fin n → Bool) → Bool paying $1 if
f x = true and $0 otherwise, evaluated under a common prior P : (Fin n → Bool) → ℝ
(IsMixedStrategy P).
- Positive-mass initial support (
priorSupport P): We initialize the common-knowledge possibility set atS⁰ = priorSupport P = {y | 0 < P y}rather thanFinset.univwhenPhas zero-probability states. Under Bayesian updating, zero-prior states carry zero posterior mass; restrictingS⁰to positive-mass states guarantees that every agent's conditioning eventagentKnowledge Sʳ i yhas strictly positive prior mass for everyy ∈ Sʳ, avoiding division by zero in conditional expectations (0 / 0 = 0in Lean). WhenPhas full support,priorSupport P = Finset.univ. - Round indexing (
commonKnowledge f P x r): Following [PennockSami2007, §26.5.4, p. 668],commonKnowledge f P x ris the common-knowledge possibility setSʳafterrrounds of trading (S⁰ = priorSupport P,Sʳ⁺¹ = {y ∈ Sʳ | roundPrice f P Sʳ y = roundPrice f P Sʳ x}). In particular,roundPrice f P (S⁰) xis the first-round clearing pricep¹, androundPrice f P (Sʳ) xis the clearing price formed from common knowledge afterrrounds. - Equilibrium in at most
nrounds: On anySʳ, each agent's bid depends only on her single bit, soroundPrice f P Sʳis an affine function on{0, 1}ⁿ ⊆ ℝⁿ. Every strict refinementSʳ⁺¹ ⊂ Sʳstrictly decreases the affine dimensionfinrank ℝ (vectorSpan ℝ (embed '' Sʳ)), so for every Boolean functionfand positive-mass statex, the common-knowledge set stabilizes by roundn:Sⁿ⁺¹ = Sⁿ. We therefore defineeqSet f P x := commonKnowledge f P x nandeqPrice f P x := roundPrice f P (eqSet f P x) x, and prove they agree with any stabilizing round.
Main definitions #
Cslib.GameTheory.PredictionMarket.priorSupport: positive-probability states{y | 0 < P y}.Cslib.GameTheory.PredictionMarket.agentKnowledge: agenti's possibility set{z ∈ S | z i = y i}.Cslib.GameTheory.PredictionMarket.condExpect: conditional probabilityP(f = true | A).Cslib.GameTheory.PredictionMarket.agentBid: myopic truthful bidcondExpect f P (agentKnowledge S i y).Cslib.GameTheory.PredictionMarket.roundPrice: unit-quantity Shapley–Shubik clearing price(∑ i, agentBid f P S i y) / n[PennockSami2007, §26.5.2, p. 666].Cslib.GameTheory.PredictionMarket.commonKnowledge: common-knowledge setSʳafterrrounds [PennockSami2007, §26.5.4, p. 668].Cslib.GameTheory.PredictionMarket.eqSet,Cslib.GameTheory.PredictionMarket.eqPrice: equilibrium common-knowledge setS^∞and equilibrium pricep^∞.Cslib.GameTheory.PredictionMarket.IsWeightedThreshold: weighted threshold functionsf x = true ↔ 1 ≤ w₀ + ∑ i, w i * x_i[PennockSami2007, Definition 26.11, p. 669].Cslib.GameTheory.PredictionMarket.carryChain,Cslib.GameTheory.PredictionMarket.carryPrior,Cslib.GameTheory.PredictionMarket.carryInputFalse,Cslib.GameTheory.PredictionMarket.carryInputTrue: the2n-input nested carry-chain threshold functionCₙ, inductive priorPₙ, and witness inputs realizing the worst-casen-round lower bound [PennockSami2007, Theorem 26.15, p. 669].
Main results #
Cslib.GameTheory.PredictionMarket.orMarket_bids_and_eqPrice: two-agent OR market under the uniform prior (b₁ = 1/2,b₂ = 1,p¹ = 3/4,p^∞ = 1) [PennockSami2007, Example 26.8, p. 667].Cslib.GameTheory.PredictionMarket.eq_condExpect_and_agentBid_of_roundPrice_const,Cslib.GameTheory.PredictionMarket.equilibrium_commonKnowledge_of_aggregates: common knowledge of aggregates at equilibrium,P(f = 1 | S^∞) = p^∞and∀ i, P(f = 1 | Sᵢ^∞) = p^∞[PennockSami2007, Theorem 26.9, Eqs. (26.1)–(26.2), p. 668].Cslib.GameTheory.PredictionMarket.xorMarket_bids_and_eqPrice,Cslib.GameTheory.PredictionMarket.not_isWeightedThreshold_xor: two-agent XOR non-revelation under the uniform prior (p¹ = p^∞ = 1/2 ≠ f x) [PennockSami2007, Example 26.10, pp. 668–669].Cslib.GameTheory.PredictionMarket.eqPrice_eq_of_isWeightedThreshold: sufficiency of weighted threshold functions for truthful equilibrium aggregation under every prior [PennockSami2007, Theorem 26.12, p. 669].Cslib.GameTheory.PredictionMarket.exists_prior_eqPrice_eq_half_of_not_isWeightedThreshold: necessity via Hahn–Banach separation of convex hulls, constructing a prior stuck atp^∞ = 1/2[PennockSami2007, Theorem 26.13, p. 669].Cslib.GameTheory.PredictionMarket.isWeightedThreshold_iff_forall_eqPrice_eq: necessary and sufficient characterization combining Theorems 26.12 and 26.13.Cslib.GameTheory.PredictionMarket.commonKnowledge_succ_eq_self_at_n,Cslib.GameTheory.PredictionMarket.convergence_in_n_rounds_of_isWeightedThreshold: convergence to equilibrium in at mostnrounds by affine-dimension drop [PennockSami2007, Theorem 26.14, p. 669].Cslib.GameTheory.PredictionMarket.carryChain_convergence_rounds,Cslib.GameTheory.PredictionMarket.exists_n_round_lower_bound:n-round worst-case lower bound on2ninputs using the weighted threshold carry chainCₙand inductive priorPₙ[PennockSami2007, Theorem 26.15, p. 669].
References #
Boolean Market Model (§26.5.1–26.5.4) #
Myopic truthful bid of agent i at state y given common knowledge S:
b_i(y) = P(f(z) = 1 | z ∈ S_i(y)) [PennockSami2007, §26.5.3–26.5.4, pp. 667–668].
Unit-quantity (q_i = 1) Shapley–Shubik market clearing price
p(y) = (∑ i, agentBid f P S i y) / n [PennockSami2007, §26.5.2, p. 666].
Common-knowledge possibility set Sʳ after r rounds of trading when the true state is x,
initialized at S⁰ = priorSupport P [PennockSami2007, §26.5.4, p. 668].
Once Sʳ⁺¹ = Sʳ, common knowledge remains constant for all later rounds k ≥ r.
Private helper lemmas for sums and affine dimension #
Affine-dimension stabilization bound (generalizes [PennockSami2007, Theorem 26.14, p. 669]
to every Boolean function f): for any f, P, and state x with 0 < P x, the common-knowledge
set stabilizes after at most n rounds (Sⁿ⁺¹ = Sⁿ).
The equilibrium common-knowledge set S^∞ for true state x, equal to
commonKnowledge f P x n since the market stabilizes in at most n rounds
(commonKnowledge_succ_eq_self_at_n).
Theorem 26.9: Common Knowledge of Aggregates at Equilibrium (§26.5.4, p. 668) #
Common knowledge of aggregates at any fixed-point set ([PennockSami2007, Theorem 26.9,
Eqs. (26.1)–(26.2), p. 668]): if 0 < n, S ⊆ priorSupport P is nonempty, and the clearing price
roundPrice f P S y takes a constant value p on S, then:
condExpect f P S = p(Eq. 26.1), andagentBid f P S i y = pfor every agentiand every statey ∈ S(Eq. 26.2).
Theorem 26.9 ([PennockSami2007, p. 668, Eqs. (26.1)–(26.2)]): at equilibrium (eqSet f P x,
eqPrice f P x) for any 0 < n and any prior P with 0 < P x, the common-knowledge
expectation and every agent's conditional expectation equal the equilibrium price p^∞.
Definition 26.11 and Theorems 26.12–26.13: Weighted Threshold Characterization #
A Boolean function f : (Fin n → Bool) → Bool is a weighted threshold function iff there
exist real constants w₀, w₁, …, wₙ such that f x = true ↔ 1 ≤ w₀ + ∑ i, w i * x_i
[PennockSami2007, Definition 26.11, p. 669].
This is equivalent to Cslib.Circuits.Boolean.WeightedThreshold.IsLTF via θ = 1 - w₀; it is
defined directly here to match Definition 26.11 without importing the depth-two threshold-circuit
complexity stack.
At equilibrium for a weighted threshold function f, common knowledge eqSet f P x already
determines f x: every state y ∈ eqSet f P x satisfies f y = f x.
Theorem 26.12 ([PennockSami2007, p. 669]): if f : (Fin n → Bool) → Bool (0 < n) is a
weighted threshold function, then for every prior P and every state x with 0 < P x, the
equilibrium price equals f x (1 if f x = true, 0 if f x = false).
Theorem 26.13 ([PennockSami2007, p. 669]): if f : (Fin n → Bool) → Bool is not a weighted
threshold function, then there exists a prior distribution P (IsMixedStrategy P) for which the
market immediately stabilizes at equilibrium price p^∞ = 1 / 2 on every positive-probability state
(and therefore never reveals f x ∈ {0, 1}).
Weighted threshold characterization of market-computable Boolean functions
([PennockSami2007, §26.5.5, Theorems 26.12–26.13, p. 669]): for 0 < n, f : (Fin n → Bool) → Bool
is a weighted threshold function iff the equilibrium price equals f x for every common prior P
and every positive-probability state x.
Examples 26.8 (OR) and 26.10 (XOR) #
Example 26.8 ([PennockSami2007, p. 667]): two-agent OR market f(x₁, x₂) = x₁ ∨ x₂ under
the uniform prior on {0, 1}² at true state x = (false, true). In round 1, agent 1 bids 1/2,
agent 2 bids 1, and the clearing price is 3/4; at equilibrium, p^∞ = 1 = f x.
Example 26.10 ([PennockSami2007, pp. 668–669]): two-agent XOR market
f(x₁, x₂) = x₁ ⊕ x₂ under the uniform prior on {0, 1}². In round 1, every agent bids 1/2 on
every state, the clearing price is 1/2, and the market immediately reaches equilibrium at
p^∞ = 1/2 ≠ f x.
Two-bit XOR is not a weighted threshold function (immediate from xorMarket_bids_and_eqPrice
and Theorem 26.12).
Theorem 26.14: Convergence in at Most n Rounds (§26.5.6, p. 669) #
Theorem 26.14 ([PennockSami2007, p. 669]): for any weighted threshold function f on n
inputs (0 < n), any prior P, and any state x with 0 < P x, after at most n rounds of
trading (r ≥ n), common knowledge Sʳ has reached equilibrium S^∞ and both the clearing price
and the common-knowledge expectation equal f x.
Theorem 26.15: Worst-Case n-Round Lower Bound on 2n Inputs (§26.5.6, p. 669) #
carryChain n is a weighted threshold function with exponentially decaying pair weights
w(2j) = w(2j + 1) = 2^(n - 1 - j) and threshold 2^n.
The explicit prior distribution Pₙ on {0, 1}^{2n} achieving the n-round worst-case lower
bound for carryChain n [PennockSami2007, Theorem 26.15, p. 669].
carryPrior n is a valid probability distribution (IsMixedStrategy) on {0, 1}^{2n} for
every n : ℕ.
Alternating 2n-bit input (true, false, true, false, …, true, false) on which
carryChain n = false.
Worst-case 2n-bit input (true, false, …, true, false, true, true) on which
carryChain n = true (for n > 0).
Explicit round-by-round convergence profile for (carryChain n, carryPrior n) (0 < n):
for every r < n, the common-knowledge sets at carryInputFalse n (Cₙ = false) and
carryInputTrue n (Cₙ = true) coincide with conditional expectation 1 / 2 and exact clearing
prices 1 / 2 (for r + 1 < n) or (3n ∓ 1) / (6n) (at r = n - 1), all strictly in (0, 1);
after n rounds, common knowledge reveals Cₙ and the clearing price equals Cₙ(x).
Theorem 26.15 ([PennockSami2007, p. 669]): for every n > 0, there exist a weighted
threshold function Cₙ : (Fin (2 * n) → Bool) → Bool, a prior distribution Pₙ
(IsMixedStrategy Pₙ), and positive-probability states x₀, x₁ with Cₙ x₀ = false and
Cₙ x₁ = true such that for every round r < n, the common-knowledge sets Sʳ(x₀) = Sʳ(x₁) do
not distinguish Cₙ x₀ from Cₙ x₁ (with conditional expectation 1 / 2 and clearing prices
strictly between 0 and 1), while after n rounds common knowledge reveals Cₙ and the
clearing price reaches Cₙ(x).