Documentation

CslibFrontier.GameTheory.Market.Basic

Exchange and Fisher markets: Walras's law and the First Welfare Theorem #

In an Arrow–Debreu exchange market (ExchangeMarket) a finite set I of traders exchanges a finite set G of infinitely divisible goods ([AD54]; [CV07], Section 6.1.1, pp. 136–137). Each trader i holds a nonnegative initial endowment bundle endowment i : G → ℝ and evaluates nonnegative consumption bundles by utility i : (G → ℝ) → ℝ. At a price vector p : G → ℝ, trader i's budget is the market value expenditure p (endowment i) of their endowment, and their Marshallian demand set (demandSet) consists of the nonnegative bundles within that budget maximizing utility i. A competitive equilibrium (ExchangeMarket.IsCompetitiveEquilibrium) pairs an allocation x : I → G → ℝ with nonnegative prices p such that every trader's bundle lies in their demand set, aggregate demand does not exceed aggregate supply (excessDemand x g ≤ 0), and any good in strict excess supply has price zero (p g * excessDemand x g = 0).

In a Fisher market (FisherMarket) buyers instead arrive with exogenous money budgets budget : I → ℝ to purchase divisible goods of exogenous supply supply : G → ℝ ([Vaz07], Section 5.1, pp. 103–104; [CV07], Section 6.2, p. 141). Both models share the underlying consumer-choice primitives (expenditure, IsBudgetFeasible, demandSet, IsLocallyNonsatiated, linearUtility), and every positive-budget Fisher market embeds into an exchange market where each buyer holds a budget-proportional share of every good (FisherMarket.toExchangeMarket; [CV07], Section 6.1.7, p. 140).

Main definitions #

Main results #

References #

Consumer choice, budgets, and demand sets #

def Cslib.GameTheory.Market.expenditure {G : Type u_1} [Fintype G] (p b : G → ℝ) :

Total expenditure ∑ g, p g * b g of consumption bundle b at price vector p.

theorem Cslib.GameTheory.Market.expenditure_eq_sum {G : Type u_1} [Fintype G] (p b : G → ℝ) :
expenditure p b = ∑ g : G, p g * b g
@[simp]
@[simp]
theorem Cslib.GameTheory.Market.expenditure_add {G : Type u_1} [Fintype G] (p b₁ b₂ : G → ℝ) :
expenditure p (b₁ + b₂) = expenditure p b₁ + expenditure p b₂
theorem Cslib.GameTheory.Market.expenditure_sub {G : Type u_1} [Fintype G] (p b₁ b₂ : G → ℝ) :
expenditure p (b₁ - b₂) = expenditure p b₁ - expenditure p b₂
theorem Cslib.GameTheory.Market.expenditure_smul_left {G : Type u_1} [Fintype G] (c : ℝ) (p b : G → ℝ) :
expenditure (c • p) b = c * expenditure p b
theorem Cslib.GameTheory.Market.expenditure_smul_right {G : Type u_1} [Fintype G] (c : ℝ) (p b : G → ℝ) :
expenditure p (c • b) = c * expenditure p b
theorem Cslib.GameTheory.Market.expenditure_nonneg {G : Type u_1} [Fintype G] {p b : G → ℝ} (hp : ∀ (g : G), 0 ≤ p g) (hb : ∀ (g : G), 0 ≤ b g) :
def Cslib.GameTheory.Market.IsBudgetFeasibleOn {G : Type u_1} [Fintype G] (X : Set (G → ℝ)) (p : G → ℝ) (m : ℝ) (b : G → ℝ) :

Bundle b is budget-feasible on X at prices p and scalar budget m if b ∈ X and its expenditure is at most m.

theorem Cslib.GameTheory.Market.IsBudgetFeasibleOn.smul_price_budget {G : Type u_1} [Fintype G] {X : Set (G → ℝ)} {p : G → ℝ} {m c : ℝ} {b : G → ℝ} (hc : 0 < c) :
def Cslib.GameTheory.Market.IsBudgetFeasible {G : Type u_1} [Fintype G] (p : G → ℝ) (m : ℝ) (b : G → ℝ) :

Bundle b is budget-feasible at prices p and scalar budget m if it is nonnegative and its expenditure is at most m.

theorem Cslib.GameTheory.Market.IsBudgetFeasible.smul_price_budget {G : Type u_1} [Fintype G] {p : G → ℝ} {m c : ℝ} {b : G → ℝ} (hc : 0 < c) :
def Cslib.GameTheory.Market.demandSetOn {G : Type u_1} [Fintype G] (X : Set (G → ℝ)) (u : (G → ℝ) → ℝ) (p : G → ℝ) (m : ℝ) :
Set (G → ℝ)

The Marshallian demand set on X of a consumer with consumption set X, utility u, and budget m at prices p.

@[simp]
theorem Cslib.GameTheory.Market.mem_demandSetOn {G : Type u_1} [Fintype G] {X : Set (G → ℝ)} {u : (G → ℝ) → ℝ} {p : G → ℝ} {m : ℝ} {b : G → ℝ} :
b ∈ demandSetOn X u p m ↔ IsBudgetFeasibleOn X p m b ∧ ∀ (b' : G → ℝ), IsBudgetFeasibleOn X p m b' → u b' ≤ u b
theorem Cslib.GameTheory.Market.demandSetOn_smul {G : Type u_1} [Fintype G] (X : Set (G → ℝ)) (u : (G → ℝ) → ℝ) (p : G → ℝ) (m : ℝ) {c : ℝ} (hc : 0 < c) :
demandSetOn X u (c • p) (c * m) = demandSetOn X u p m
def Cslib.GameTheory.Market.demandSet {G : Type u_1} [Fintype G] (u : (G → ℝ) → ℝ) (p : G → ℝ) (m : ℝ) :
Set (G → ℝ)

The Marshallian demand set of a consumer with utility u and budget m at prices p: the set of budget-feasible bundles maximizing u ([CV07], Section 6.1.1, p. 136).

@[simp]
theorem Cslib.GameTheory.Market.mem_demandSet {G : Type u_1} [Fintype G] {u : (G → ℝ) → ℝ} {p : G → ℝ} {m : ℝ} {b : G → ℝ} :
b ∈ demandSet u p m ↔ IsBudgetFeasible p m b ∧ ∀ (b' : G → ℝ), IsBudgetFeasible p m b' → u b' ≤ u b
theorem Cslib.GameTheory.Market.demandSet_smul {G : Type u_1} [Fintype G] (u : (G → ℝ) → ℝ) (p : G → ℝ) (m : ℝ) {c : ℝ} (hc : 0 < c) :
demandSet u (c • p) (c * m) = demandSet u p m

Marshallian demand is homogeneous of degree zero in (p, m) for positive scalars c > 0 ([CV07], Section 6.1.1, p. 137).

def Cslib.GameTheory.Market.IsLocallyNonsatiatedOn {G : Type u_1} (X : Set (G → ℝ)) (u : (G → ℝ) → ℝ) :

A utility function u : (G → ℝ) → ℝ is locally nonsatiated on X if every ℓ_∞-neighborhood of every bundle b ∈ X contains a strictly preferred bundle b' ∈ X ([AD54]).

A utility function u : (G → ℝ) → ℝ is locally nonsatiated on nonnegative consumption bundles if every ℓ_∞-neighborhood of every nonnegative bundle contains a strictly preferred nonnegative bundle ([AD54]). Note that [CV07], Section 6.1.1, p. 136 assumes concavity, global nonsatiation, and monotonicity, whereas we assume local nonsatiation directly.

theorem Cslib.GameTheory.Market.IsLocallyNonsatiatedOn.le_expenditure_of_mem_demandSetOn {G : Type u_1} [Fintype G] {X : Set (G → ℝ)} {u : (G → ℝ) → ℝ} (hlns : IsLocallyNonsatiatedOn X u) {p : G → ℝ} {m : ℝ} {b b' : G → ℝ} (hb : b ∈ demandSetOn X u p m) (hb'_mem : b' ∈ X) (hub : u b ≤ u b') :

Under local nonsatiation on X, any bundle b' ∈ X weakly preferred to a demanded bundle b ∈ demandSetOn X u p m costs at least m.

theorem Cslib.GameTheory.Market.IsLocallyNonsatiatedOn.expenditure_eq_of_mem_demandSetOn {G : Type u_1} [Fintype G] {X : Set (G → ℝ)} {u : (G → ℝ) → ℝ} (hlns : IsLocallyNonsatiatedOn X u) {p : G → ℝ} {m : ℝ} {b : G → ℝ} (hb : b ∈ demandSetOn X u p m) :

Budget exhaustion on general consumption sets X.

theorem Cslib.GameTheory.Market.lt_expenditure_of_mem_demandSetOn {G : Type u_1} [Fintype G] {X : Set (G → ℝ)} {u : (G → ℝ) → ℝ} {p : G → ℝ} {m : ℝ} {b b' : G → ℝ} (hb : b ∈ demandSetOn X u p m) (hb'_mem : b' ∈ X) (hub : u b < u b') :
m < expenditure p b'

Any bundle b' ∈ X strictly preferred to a demanded bundle on X strictly exceeds the consumer's budget (valid without local nonsatiation).

theorem Cslib.GameTheory.Market.IsLocallyNonsatiated.le_expenditure_of_mem_demandSet {G : Type u_1} [Fintype G] {u : (G → ℝ) → ℝ} (hlns : IsLocallyNonsatiated u) {p : G → ℝ} {m : ℝ} {b b' : G → ℝ} (hb : b ∈ demandSet u p m) (hb'_nn : ∀ (g : G), 0 ≤ b' g) (hub : u b ≤ u b') :

Under local nonsatiation, any nonnegative bundle b' weakly preferred to a demanded bundle b costs at least the consumer's budget m; otherwise a nearby strictly preferred bundle would also be affordable.

theorem Cslib.GameTheory.Market.IsLocallyNonsatiated.expenditure_eq_of_mem_demandSet {G : Type u_1} [Fintype G] {u : (G → ℝ) → ℝ} (hlns : IsLocallyNonsatiated u) {p : G → ℝ} {m : ℝ} {b : G → ℝ} (hb : b ∈ demandSet u p m) :

Budget exhaustion: a locally nonsatiated consumer spends their entire budget at every optimal bundle.

theorem Cslib.GameTheory.Market.lt_expenditure_of_mem_demandSet {G : Type u_1} [Fintype G] {u : (G → ℝ) → ℝ} {p : G → ℝ} {m : ℝ} {b b' : G → ℝ} (hb : b ∈ demandSet u p m) (hb'_nn : ∀ (g : G), 0 ≤ b' g) (hub : u b < u b') :
m < expenditure p b'

Any nonnegative bundle strictly preferred to a demanded bundle strictly exceeds the consumer's budget (valid without local nonsatiation).

theorem Cslib.GameTheory.Market.IsLocallyNonsatiated.exists_price_pos_of_mem_demandSet {G : Type u_1} [Fintype G] {u : (G → ℝ) → ℝ} (hlns : IsLocallyNonsatiated u) {p : G → ℝ} {m : ℝ} {b : G → ℝ} (hp : ∀ (g : G), 0 ≤ p g) (hb : b ∈ demandSet u p m) :
∃ (g : G), 0 < p g

At nonnegative prices, a locally nonsatiated consumer can have a nonempty demand set only if at least one good has a strictly positive price.

Linear utilities and bang-per-buck demand #

def Cslib.GameTheory.Market.linearUtility {G : Type u_1} [Fintype G] (v b : G → ℝ) :

Additive linear utility ∑ g, v g * b g with marginal utility vector v : G → ℝ ([Vaz07], Section 5.2, p. 105; [CV07], Section 6.1.5, p. 139).

theorem Cslib.GameTheory.Market.linearUtility_eq_sum {G : Type u_1} [Fintype G] (v b : G → ℝ) :
linearUtility v b = ∑ g : G, v g * b g

A linear utility function linearUtility v is locally nonsatiated on nonnegative bundles if and only if at least one good has strictly positive marginal utility.

theorem Cslib.GameTheory.Market.price_pos_of_mem_demandSet_linearUtility {G : Type u_1} [Fintype G] {v p : G → ℝ} {m : ℝ} {b : G → ℝ} (hp : ∀ (g : G), 0 ≤ p g) (hb : b ∈ demandSet (linearUtility v) p m) {g : G} (hvg : 0 < v g) :
0 < p g

If a bundle b is optimal for linearUtility v at nonnegative prices p, every good with strictly positive marginal utility must have strictly positive price.

theorem Cslib.GameTheory.Market.mem_demandSet_linearUtility_iff {G : Type u_1} [Fintype G] {v p : G → ℝ} {m : ℝ} {b : G → ℝ} (hv : ∀ (g : G), 0 ≤ v g) (hm : 0 ≤ m) (hp : ∀ (g : G), 0 < p g) (hns : ∃ (g : G), 0 < v g) :
b ∈ demandSet (linearUtility v) p m ↔ (∀ (g : G), 0 ≤ b g) ∧ expenditure p b = m ∧ ∀ (g : G), 0 < b g → ∀ (g' : G), v g' / p g' ≤ v g / p g

Bang-per-buck characterization of linear demand ([Vaz07], Section 5.2, pp. 105–106): at strictly positive prices p > 0, a locally nonsatiated linear consumer (∃ g, 0 < v g) with nonnegative marginal utilities v ≥ 0 and budget m ≥ 0 demands a bundle b if and only if b is nonnegative, exhausts the budget m, and places positive weight only on goods maximizing the utility-per-unit-money ratio v g / p g.

theorem Cslib.GameTheory.Market.not_exists_paretoImprovementOn {G : Type u_1} [Fintype G] {I : Type u_2} {X : I → Set (G → ℝ)} {u : I → (G → ℝ) → ℝ} {budget : I → ℝ} {p : G → ℝ} {x y : I → G → ℝ} {S : Finset I} (hdem : ∀ i ∈ S, x i ∈ demandSetOn (X i) (u i) p (budget i)) (hlns : ∀ i ∈ S, IsLocallyNonsatiatedOn (X i) (u i)) (hy_mem : ∀ i ∈ S, y i ∈ X i) (hy_cost : ∑ i ∈ S, expenditure p (y i) ≤ ∑ i ∈ S, budget i) :
¬((∀ i ∈ S, u i (x i) ≤ u i (y i)) ∧ ∃ i ∈ S, u i (x i) < u i (y i))

Shared consumer-level First Welfare Theorem expenditure argument on general consumption sets and arbitrary coalitions S : Finset I: if every member i ∈ S is locally nonsatiated on X i and demands x i ∈ demandSetOn (X i) (u i) p (budget i), then no consumption profile y i ∈ X i costing at most ∑ i ∈ S, budget i can Pareto-dominate x on S.

theorem Cslib.GameTheory.Market.not_exists_strictParetoImprovementOn {G : Type u_1} [Fintype G] {I : Type u_2} {X : I → Set (G → ℝ)} {u : I → (G → ℝ) → ℝ} {budget : I → ℝ} {p : G → ℝ} {x y : I → G → ℝ} {S : Finset I} (hS : S.Nonempty) (hdem : ∀ i ∈ S, x i ∈ demandSetOn (X i) (u i) p (budget i)) (hy_mem : ∀ i ∈ S, y i ∈ X i) (hy_cost : ∑ i ∈ S, expenditure p (y i) ≤ ∑ i ∈ S, budget i) :
¬∀ i ∈ S, u i (x i) < u i (y i)

Local-nonsatiation-free strict Pareto expenditure argument on general consumption sets: if S is nonempty and every i ∈ S demands x i, then no profile y i ∈ X i costing at most ∑ i ∈ S, budget i can make every i ∈ S strictly better off.

theorem Cslib.GameTheory.Market.not_exists_paretoImprovement {G : Type u_1} [Fintype G] {I : Type u_2} [Fintype I] {u : I → (G → ℝ) → ℝ} {budget : I → ℝ} {supply p : G → ℝ} {x : I → G → ℝ} (hp : ∀ (g : G), 0 ≤ p g) (hdem : ∀ (i : I), x i ∈ demandSet (u i) p (budget i)) (hlns : ∀ (i : I), IsLocallyNonsatiated (u i)) (hbudget : ∑ i : I, budget i = expenditure p supply) :
¬∃ (y : I → G → ℝ), ((∀ (i : I) (g : G), 0 ≤ y i g) ∧ ∀ (g : G), ∑ i : I, y i g ≤ supply g) ∧ (∀ (i : I), u i (x i) ≤ u i (y i)) ∧ ∃ (i : I), u i (x i) < u i (y i)

Shared consumer-level First Welfare Theorem expenditure argument: if every agent i is locally nonsatiated and chooses an optimal bundle x i ∈ demandSet (u i) p (budget i) at nonnegative prices p, and total budget equals the market value of total supply (∑ i, budget i = expenditure p supply), then no nonnegative allocation y respecting supply can Pareto-dominate x.

Arrow–Debreu exchange markets #

structure Cslib.GameTheory.Market.ExchangeMarket (I : Type u_1) (G : Type u_2) :
Type (max u_1 u_2)

An Arrow–Debreu exchange market ([AD54]; [CV07], Section 6.1.1, pp. 136–137) with traders I and divisible goods G: each trader i starts with a nonnegative endowment endowment i : G → ℝ and evaluates consumption bundles via utility i : (G → ℝ) → ℝ.

  • endowment : I → G → ℝ

    Initial endowment endowment i g of good g held by trader i.

  • utility : I → (G → ℝ) → ℝ

    Utility utility i b derived by trader i from consumption bundle b : G → ℝ.

  • endowment_nonneg (i : I) (g : G) : 0 ≤ self.endowment i g

    Initial endowments are nonnegative.

theorem Cslib.GameTheory.Market.ExchangeMarket.ext {I : Type u_1} {G : Type u_2} {x y : ExchangeMarket I G} (endowment : x.endowment = y.endowment) (utility : x.utility = y.utility) :
x = y

Aggregate market supply ∑ i, endowment i g of good g.

theorem Cslib.GameTheory.Market.ExchangeMarket.totalSupply_eq_sum {I : Type u_1} {G : Type u_2} [Fintype I] (E : ExchangeMarket I G) (g : G) :
E.totalSupply g = ∑ i : I, E.endowment i g
def Cslib.GameTheory.Market.ExchangeMarket.income {I : Type u_1} {G : Type u_2} [Fintype G] (E : ExchangeMarket I G) (p : G → ℝ) (i : I) :

Trader i's endowment income expenditure p (E.endowment i) at prices p.

theorem Cslib.GameTheory.Market.ExchangeMarket.income_eq {I : Type u_1} {G : Type u_2} [Fintype G] (E : ExchangeMarket I G) (p : G → ℝ) (i : I) :
theorem Cslib.GameTheory.Market.ExchangeMarket.income_nonneg {I : Type u_1} {G : Type u_2} [Fintype G] (E : ExchangeMarket I G) {p : G → ℝ} (hp : ∀ (g : G), 0 ≤ p g) (i : I) :
0 ≤ E.income p i
theorem Cslib.GameTheory.Market.ExchangeMarket.sum_income {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] (E : ExchangeMarket I G) (p : G → ℝ) :
∑ i : I, E.income p i = expenditure p E.totalSupply
def Cslib.GameTheory.Market.ExchangeMarket.IsBudgetFeasible {I : Type u_1} {G : Type u_2} [Fintype G] (E : ExchangeMarket I G) (p : G → ℝ) (i : I) (b : G → ℝ) :

Bundle b is budget-feasible for trader i at prices p.

def Cslib.GameTheory.Market.ExchangeMarket.demandSet {I : Type u_1} {G : Type u_2} [Fintype G] (E : ExchangeMarket I G) (p : G → ℝ) (i : I) :
Set (G → ℝ)

Trader i's Marshallian demand set at prices p.

@[simp]
theorem Cslib.GameTheory.Market.ExchangeMarket.mem_demandSet {I : Type u_1} {G : Type u_2} [Fintype G] (E : ExchangeMarket I G) {p : G → ℝ} {i : I} {b : G → ℝ} :
b ∈ E.demandSet p i ↔ b ∈ Market.demandSet (E.utility i) p (E.income p i)
theorem Cslib.GameTheory.Market.ExchangeMarket.demandSet_smul {I : Type u_1} {G : Type u_2} [Fintype G] (E : ExchangeMarket I G) (p : G → ℝ) (i : I) {c : ℝ} (hc : 0 < c) :
E.demandSet (c • p) i = E.demandSet p i

An allocation x : I → G → ℝ is feasible (with free disposal) if every bundle is nonnegative and aggregate consumption of each good does not exceed E.totalSupply g.

def Cslib.GameTheory.Market.ExchangeMarket.excessDemand {I : Type u_1} {G : Type u_2} [Fintype I] (E : ExchangeMarket I G) (x : I → G → ℝ) (g : G) :

Aggregate excess demand (∑ i, x i g) - E.totalSupply g for good g under allocation x ([CV07], Section 6.1.1, p. 137).

theorem Cslib.GameTheory.Market.ExchangeMarket.excessDemand_eq {I : Type u_1} {G : Type u_2} [Fintype I] (E : ExchangeMarket I G) (x : I → G → ℝ) (g : G) :
E.excessDemand x g = ∑ i : I, x i g - E.totalSupply g
theorem Cslib.GameTheory.Market.ExchangeMarket.expenditure_excessDemand {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] (E : ExchangeMarket I G) (p : G → ℝ) (x : I → G → ℝ) :
expenditure p (E.excessDemand x) = ∑ i : I, (expenditure p (x i) - E.income p i)
theorem Cslib.GameTheory.Market.ExchangeMarket.expenditure_excessDemand_le_zero {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] (E : ExchangeMarket I G) {p : G → ℝ} {x : I → G → ℝ} (hfeas : ∀ (i : I), E.IsBudgetFeasible p i (x i)) :

Weak Walras inequality: if every trader chooses a budget-feasible bundle at prices p, the market value of aggregate excess demand is nonpositive.

theorem Cslib.GameTheory.Market.ExchangeMarket.walras_law {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] (E : ExchangeMarket I G) {p : G → ℝ} {x : I → G → ℝ} (hlns : ∀ (i : I), IsLocallyNonsatiated (E.utility i)) (hdem : ∀ (i : I), x i ∈ E.demandSet p i) :

Walras's law ([CV07], Section 6.1.1, p. 137): if every trader is locally nonsatiated and selects an optimal bundle x i ∈ E.demandSet p i, then the total value of excess demand vanishes (expenditure p (E.excessDemand x) = 0) at any price vector p.

theorem Cslib.GameTheory.Market.ExchangeMarket.excessDemand_eq_zero_of_other_goods {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] (E : ExchangeMarket I G) {p : G → ℝ} {x : I → G → ℝ} {g₀ : G} (hwalras : expenditure p (E.excessDemand x) = 0) (hp₀ : 0 < p g₀) (hother : ∀ (g : G), g ≠ g₀ → E.excessDemand x g = 0) :
E.excessDemand x g₀ = 0

Consequence of Walras's law: if expenditure p (E.excessDemand x) = 0, good g₀ has a strictly positive price, and all other goods clear (excessDemand x g = 0 for g ≠ g₀), then the market for g₀ also clears (excessDemand x g₀ = 0).

def Cslib.GameTheory.Market.ExchangeMarket.IsCompetitiveEquilibrium {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] (E : ExchangeMarket I G) (x : I → G → ℝ) (p : G → ℝ) :

A competitive (Walrasian) equilibrium ([AD54]; [CV07], Section 6.1.1, p. 136) consists of an allocation x and nonnegative prices p such that every trader maximizes utility within their endowment budget, no good is over-demanded (excessDemand x g ≤ 0), and any good in strict excess supply has price zero (p g * excessDemand x g = 0).

theorem Cslib.GameTheory.Market.ExchangeMarket.IsCompetitiveEquilibrium.smul {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] {E : ExchangeMarket I G} {x : I → G → ℝ} {p : G → ℝ} (heq : E.IsCompetitiveEquilibrium x p) {c : ℝ} (hc : 0 < c) :

Scaling equilibrium prices by any positive constant preserves competitive equilibrium.

theorem Cslib.GameTheory.Market.ExchangeMarket.IsCompetitiveEquilibrium.of_locallyNonsatiated {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] {E : ExchangeMarket I G} {x : I → G → ℝ} {p : G → ℝ} (hlns : ∀ (i : I), IsLocallyNonsatiated (E.utility i)) (hp : ∀ (g : G), 0 ≤ p g) (hdem : ∀ (i : I), x i ∈ E.demandSet p i) (hclear : ∀ (g : G), E.excessDemand x g ≤ 0) :

Under local nonsatiation, Walras's law implies that 0 ≤ p, individual demand optimality, and nonpositive excess demand excessDemand x g ≤ 0 automatically enforce complementary slackness p g * excessDemand x g = 0.

theorem Cslib.GameTheory.Market.ExchangeMarket.IsCompetitiveEquilibrium.sum_eq_totalSupply_of_price_pos {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] {E : ExchangeMarket I G} {x : I → G → ℝ} {p : G → ℝ} (heq : E.IsCompetitiveEquilibrium x p) {g : G} (hpg : 0 < p g) :
∑ i : I, x i g = E.totalSupply g

Every positively priced good clears with exact equality (∑ i, x i g = E.totalSupply g) in a competitive equilibrium.

def Cslib.GameTheory.Market.ExchangeMarket.IsParetoOptimal {I : Type u_1} {G : Type u_2} [Fintype I] (E : ExchangeMarket I G) (x : I → G → ℝ) :

A feasible allocation x is Pareto optimal if no feasible allocation y makes every trader weakly better off and at least one trader strictly better off ([AD54]).

theorem Cslib.GameTheory.Market.ExchangeMarket.IsCompetitiveEquilibrium.isParetoOptimal {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] {E : ExchangeMarket I G} {x : I → G → ℝ} {p : G → ℝ} (heq : E.IsCompetitiveEquilibrium x p) (hlns : ∀ (i : I), IsLocallyNonsatiated (E.utility i)) :

First Welfare Theorem ([AD54]): in an exchange market where every trader's utility function is locally nonsatiated, every competitive equilibrium allocation is Pareto optimal.

Linear Arrow–Debreu exchange markets #

structure Cslib.GameTheory.Market.LinearExchangeMarket (I : Type u_1) (G : Type u_2) :
Type (max u_1 u_2)

A linear Arrow–Debreu exchange market ([Vaz07], Section 5.11, p. 122; [CV07], Section 6.1.5 and Section 6.4.1, pp. 139, 147): each trader i has nonnegative endowment endowment i : G → ℝ and nonnegative marginal utilities utility i : G → ℝ inducing additive utility linearUtility (utility i).

  • endowment : I → G → ℝ

    Initial endowment endowment i g of good g held by trader i.

  • utility : I → G → ℝ

    Marginal utility utility i g derived by trader i per unit of good g.

  • endowment_nonneg (i : I) (g : G) : 0 ≤ self.endowment i g

    Initial endowments are nonnegative.

  • utility_nonneg (i : I) (g : G) : 0 ≤ self.utility i g

    Marginal utilities are nonnegative.

def Cslib.GameTheory.Market.LinearExchangeMarket.IsCompetitiveEquilibrium {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] (E : LinearExchangeMarket I G) (x : I → G → ℝ) (p : G → ℝ) :

Competitive equilibrium of a linear exchange market.

Pareto optimality in a linear exchange market.

theorem Cslib.GameTheory.Market.LinearExchangeMarket.walras_law {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] (E : LinearExchangeMarket I G) {p : G → ℝ} {x : I → G → ℝ} (hns : ∀ (i : I), ∃ (g : G), 0 < E.utility i g) (hdem : ∀ (i : I), x i ∈ E.toExchangeMarket.demandSet p i) :

Walras's law for linear exchange markets: when every trader desires at least one good, every optimal demand profile satisfies expenditure p (E.toExchangeMarket.excessDemand x) = 0.

theorem Cslib.GameTheory.Market.LinearExchangeMarket.IsCompetitiveEquilibrium.isParetoOptimal {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] {E : LinearExchangeMarket I G} {x : I → G → ℝ} {p : G → ℝ} (heq : E.IsCompetitiveEquilibrium x p) (hns : ∀ (i : I), ∃ (g : G), 0 < E.utility i g) :

First Welfare Theorem for linear exchange markets: when every trader desires at least one good, every competitive equilibrium allocation is Pareto optimal.

theorem Cslib.GameTheory.Market.LinearExchangeMarket.isCompetitiveEquilibrium_iff_bangPerBuck {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] (E : LinearExchangeMarket I G) {x : I → G → ℝ} {p : G → ℝ} (hp : ∀ (g : G), 0 < p g) (hns : ∀ (i : I), ∃ (g : G), 0 < E.utility i g) :
E.IsCompetitiveEquilibrium x p ↔ (∀ (i : I) (g : G), 0 ≤ x i g) ∧ (∀ (g : G), ∑ i : I, x i g = E.toExchangeMarket.totalSupply g) ∧ (∀ (i : I), expenditure p (x i) = E.toExchangeMarket.income p i) ∧ ∀ (i : I) (g : G), 0 < x i g → ∀ (g' : G), E.utility i g' / p g' ≤ E.utility i g / p g

Bang-per-buck characterization of linear Arrow–Debreu equilibrium ([Vaz07], Section 5.11, p. 122): at strictly positive prices p > 0, when every trader desires at least one good, (x, p) is a competitive equilibrium if and only if x is nonnegative, clears every good's total supply, exhausts every trader's endowment income, and allocates each trader only goods of maximum marginal-utility-to-price ratio E.utility i g / p g.

Fisher markets and reduction to Arrow–Debreu exchange #

structure Cslib.GameTheory.Market.FisherMarket (I : Type u_1) (G : Type u_2) :
Type (max u_1 u_2)

A Fisher market ([Vaz07], Section 5.1, pp. 103–104; [CV07], Section 6.2, p. 141) with buyers I and divisible goods G: each buyer i has an exogenous money budget budget i ≥ 0 and utility utility i : (G → ℝ) → ℝ, and each good g has supply supply g ≥ 0.

  • budget : I → ℝ

    Exogenous money budget budget i of buyer i.

  • supply : G → ℝ

    Available supply supply g of good g.

  • utility : I → (G → ℝ) → ℝ

    Utility utility i b derived by buyer i from bundle b : G → ℝ.

  • budget_nonneg (i : I) : 0 ≤ self.budget i

    Buyer budgets are nonnegative.

  • supply_nonneg (g : G) : 0 ≤ self.supply g

    Good supplies are nonnegative.

Aggregate money budget ∑ i, M.budget i of all buyers.

def Cslib.GameTheory.Market.FisherMarket.demandSet {I : Type u_1} {G : Type u_2} [Fintype G] (M : FisherMarket I G) (p : G → ℝ) (i : I) :
Set (G → ℝ)

Buyer i's Marshallian demand set at prices p.

@[simp]
theorem Cslib.GameTheory.Market.FisherMarket.mem_demandSet {I : Type u_1} {G : Type u_2} [Fintype G] (M : FisherMarket I G) {p : G → ℝ} {i : I} {b : G → ℝ} :
def Cslib.GameTheory.Market.FisherMarket.IsFeasibleAllocation {I : Type u_1} {G : Type u_2} [Fintype I] (M : FisherMarket I G) (x : I → G → ℝ) :

An allocation x : I → G → ℝ is feasible in Fisher market M if bundles are nonnegative and aggregate consumption of each good g is at most M.supply g.

def Cslib.GameTheory.Market.FisherMarket.IsEquilibrium {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] (M : FisherMarket I G) (x : I → G → ℝ) (p : G → ℝ) :

A market equilibrium of Fisher market M ([Vaz07], Section 5.1, p. 104; [CV07], Section 6.2, p. 141): nonnegative prices p and an allocation x such that every buyer chooses an optimal bundle in their budget, no good's supply is exceeded, and every positively priced good is completely sold (p g * (supply g - ∑ i, x i g) = 0).

theorem Cslib.GameTheory.Market.FisherMarket.IsEquilibrium.isFeasibleAllocation {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] {M : FisherMarket I G} {x : I → G → ℝ} {p : G → ℝ} (heq : M.IsEquilibrium x p) :
theorem Cslib.GameTheory.Market.FisherMarket.IsEquilibrium.sum_eq_supply_of_price_pos {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] {M : FisherMarket I G} {x : I → G → ℝ} {p : G → ℝ} (heq : M.IsEquilibrium x p) {g : G} (hpg : 0 < p g) :
∑ i : I, x i g = M.supply g
theorem Cslib.GameTheory.Market.FisherMarket.IsEquilibrium.expenditure_supply_eq_totalBudget {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] {M : FisherMarket I G} {x : I → G → ℝ} {p : G → ℝ} (heq : M.IsEquilibrium x p) (hlns : ∀ (i : I), IsLocallyNonsatiated (M.utility i)) :

Fisher market Walras identity: in any Fisher market equilibrium under local nonsatiation, the total market value of all supplies equals the aggregate buyer budget (expenditure p M.supply = M.totalBudget).

def Cslib.GameTheory.Market.FisherMarket.IsParetoOptimal {I : Type u_1} {G : Type u_2} [Fintype I] (M : FisherMarket I G) (x : I → G → ℝ) :

A feasible allocation x in Fisher market M is Pareto optimal if no feasible allocation makes every buyer weakly better off and at least one buyer strictly better off.

theorem Cslib.GameTheory.Market.FisherMarket.IsEquilibrium.isParetoOptimal {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] {M : FisherMarket I G} {x : I → G → ℝ} {p : G → ℝ} (heq : M.IsEquilibrium x p) (hlns : ∀ (i : I), IsLocallyNonsatiated (M.utility i)) :

First Welfare Theorem for Fisher markets: under local nonsatiation, every Fisher market equilibrium allocation is Pareto optimal.

Fisher-to-Arrow–Debreu proportional-endowment embedding ([CV07], Section 6.1.7, p. 140; see also Section 6.2, p. 141): embed Fisher market M into an ExchangeMarket by giving each buyer i fraction M.budget i / M.totalBudget of the supply of every good g.

Under local nonsatiation and positive aggregate budget 0 < M.totalBudget, (x, p) is a Fisher equilibrium of M if and only if expenditure p M.supply = M.totalBudget and (x, p) is a competitive equilibrium of M.toExchangeMarket ([CV07], Section 6.1.7, p. 140).

theorem Cslib.GameTheory.Market.FisherMarket.isEquilibrium_smul_of_toExchangeMarket {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] (M : FisherMarket I G) {x : I → G → ℝ} {p : G → ℝ} (hB : 0 < M.totalBudget) (hlns : ∀ (i : I), IsLocallyNonsatiated (M.utility i)) (heq : M.toExchangeMarket.IsCompetitiveEquilibrium x p) (hval : 0 < expenditure p M.supply) :

Rescaling recovery ([CV07], Section 6.1.7, p. 140): any competitive equilibrium (x, p) of M.toExchangeMarket with positive aggregate supply value 0 < expenditure p M.supply rescales to an exact Fisher market equilibrium (x, (M.totalBudget / expenditure p M.supply) • p) of M.