Documentation

CslibFrontier.GameTheory.Market.Tatonnement

Market regularization and projected discrete tâtonnement for WGS economies #

In general WGS exchange markets exact equilibrium prices can be irrational, so polynomial-time algorithms target multiplicative approximate equilibria ([CV07], Section 6.1.3, Definition 6.1, p. 138). Following Codenotti, McCune, and Varadarajan [CMcCV05] as presented in [CV07], Section 6.3.1, pp. 143–148 and Exercises 6.4–6.5, p. 158, this module formalizes the complete regularization and discrete-tâtonnement pipeline:

  1. Approximate demand and approximate equilibria (Definition 6.1, p. 138; Exercise 6.5, p. 158): IsApproxDemand, ExchangeMarket.IsStrongApproxEquilibrium, ExchangeMarket.IsWeakApproxEquilibrium, and the relative price-spread guarantee ExchangeMarket.isWeakApproxEquilibrium_of_priceRatio_le (Exercise 6.5).
  2. Unit-supply rescaling M → M' (Lemma 6.5, p. 143): ExchangeMarket.unitRescale normalizes every good's aggregate supply to 1 while preserving μ-approximate demands, weak μ-approximate equilibria, and weak gross substitutability.
  3. Phantom Cobb–Douglas regularization M' → M̂ (Lemma 6.6, pp. 143–144; Exercise 6.4, p. 158): adjoining an extra trader none with uniform endowment (η, …, η) (0 < η ≤ 1) and uniform Cobb–Douglas utility guarantees:
  4. Quantitative separating hyperplane and ℓ_2 bound (Lemma 6.7 & Lemma 6.8, pp. 145–147): for 0 < ε ≤ 1 and p ∈ Δ⁺ = [η/(4n), 1 + η/(4n)]^G not a weak (1 + ε)-approximate equilibrium of M̂, every equilibrium p̂ ∈ Δ satisfies expenditure p̂ (Z p) ≥ δ = ε^2 η^2 / (144 n^4) (expenditure_phantomExcessDemand_ge_delta), and ∑ g, (Z p g)^2 ≤ (12 n^2 / η)^2 (sum_sq_phantomExcessDemand_le).
  5. Projected discrete tâtonnement convergence (Theorem 6.9 & Theorem 6.10, pp. 147–148): iterating tatonnementStep from any p₀ ∈ Δ decreases ∑ g, (p*_g - p_g)^2 by at least μ = min((δ / (12 n^2 / η))^2, (η / (4n))^2) at every non-equilibrium step, visiting Δ⁺ at a weak (1 + ε)-approximate equilibrium of M̂ within ⌊n / μ⌋ iterations (exists_le_tatonnementIter_isWeakApproxEquilibrium), and transferring back via η = ε / 3 to the original WGS market M (exists_weakApproxEquilibrium_of_wgs_oracle).

Main definitions #

Main results #

References #

Multiplicative μ-approximate demand and approximate equilibria (Definition 6.1) #

def Cslib.GameTheory.Market.IsApproxDemand {G : Type u_2} [Fintype G] (u : (G → ℝ) → ℝ) (μ : ℝ) (p w x : G → ℝ) :

Bundle x is a μ-approximate demand (μ ≥ 1) of a trader with utility u and endowment w at prices p ([CV07], Definition 6.1, p. 138) if x ≥ 0, expenditure p x ≤ μ * expenditure p w, and u y ≤ μ * u x for every bundle y ≥ 0 affordable within expenditure p w (equivalent to u x ≥ (1 / μ) u* whenever the maximum utility u* is attained).

theorem Cslib.GameTheory.Market.isApproxDemand_iff_of_mem_demandSet {G : Type u_2} [Fintype G] {u : (G → ℝ) → ℝ} {μ : ℝ} {p w x xStar : G → ℝ} (hxStar : xStar ∈ demandSet u p (expenditure p w)) :
IsApproxDemand u μ p w x ↔ 1 ≤ μ ∧ (∀ (g : G), 0 ≤ x g) ∧ expenditure p x ≤ μ * expenditure p w ∧ 1 / μ * u xStar ≤ u x

When an exact Marshallian demand bundle xStar ∈ demandSet u p (expenditure p w) exists, IsApproxDemand matches the u x ≥ (1 / μ) u(xStar) formulation of [CV07], Definition 6.1, p. 138.

theorem Cslib.GameTheory.Market.IsApproxDemand.of_mem_demandSet {G : Type u_2} [Fintype G] {u : (G → ℝ) → ℝ} {p w x : G → ℝ} (hx : x ∈ demandSet u p (expenditure p w)) :
IsApproxDemand u 1 p w x
theorem Cslib.GameTheory.Market.IsApproxDemand.mono {G : Type u_2} [Fintype G] {u : (G → ℝ) → ℝ} {μ μ' : ℝ} {p w x : G → ℝ} (h : IsApproxDemand u μ p w x) (hμμ' : μ ≤ μ') (hp : ∀ (g : G), 0 ≤ p g) (hw : ∀ (g : G), 0 ≤ w g) (hux : 0 ≤ u x) :
IsApproxDemand u μ' p w x
def Cslib.GameTheory.Market.IsRayConcave {G : Type u_2} (u : (G → ℝ) → ℝ) :

Utility function u is subhomogeneous from 0 on ℝ_+^G if scaling down any nonnegative bundle by c ∈ (0, 1] scales utility by at least c (c * u b ≤ u (c • b)). Every concave function on ℝ_+^G with 0 ≤ u 0 (the standing assumption of [CV07], Section 6.1.1, p. 136) and every homogeneous-of-degree-1 function (such as cobbDouglasUtility) satisfies this property.

theorem Cslib.GameTheory.Market.IsRayConcave.of_concaveOn {G : Type u_2} {u : (G → ℝ) → ℝ} (hconc : ConcaveOn ℝ {b : G → ℝ | ∀ (g : G), 0 ≤ b g} u) (hu0 : 0 ≤ u 0) :
theorem Cslib.GameTheory.Market.isRayConcave_cobbDouglasUtility {G : Type u_2} [Fintype G] {α : G → ℝ} (hα_sum : ∑ g : G, α g = 1) :

A price vector p is a strong μ-approximate equilibrium (μ ≥ 1) of E ([CV07], Definition 6.1, p. 138) if every trader receives an exact Marshallian demand bundle at p and aggregate demand of each good is at most μ * E.totalSupply g.

A price vector p is a weak μ-approximate equilibrium (μ ≥ 1) of E ([CV07], Definition 6.1, p. 138) if every trader receives a μ-approximate demand bundle at p and aggregate demand of each good is at most μ * E.totalSupply g.

theorem Cslib.GameTheory.Market.ExchangeMarket.IsStrongApproxEquilibrium.isWeakApproxEquilibrium {I : Type u_1} {G : Type u_2} [Fintype G] [Fintype I] {E : ExchangeMarket I G} {μ : ℝ} {p : G → ℝ} (h : E.IsStrongApproxEquilibrium μ p) (hu_nn : ∀ (i : I) (b : G → ℝ), (∀ (g : G), 0 ≤ b g) → 0 ≤ E.utility i b) :
theorem Cslib.GameTheory.Market.ExchangeMarket.IsWeakApproxEquilibrium.mono {I : Type u_1} {G : Type u_2} [Fintype G] [Fintype I] {E : ExchangeMarket I G} {μ μ' : ℝ} {p : G → ℝ} (h : E.IsWeakApproxEquilibrium μ p) (hμμ' : μ ≤ μ') (hu_nn : ∀ (i : I) (b : G → ℝ), (∀ (g : G), 0 ≤ b g) → 0 ≤ E.utility i b) :
theorem Cslib.GameTheory.Market.ExchangeMarket.isWeakApproxEquilibrium_of_priceRatio_le {I : Type u_1} {G : Type u_2} [Fintype G] [Fintype I] (E : ExchangeMarket I G) {xHat : I → G → ℝ} {pHat p : G → ℝ} {ε : ℝ} (hray : ∀ (i : I), IsRayConcave (E.utility i)) (hu_nn : ∀ (i : I) (b : G → ℝ), (∀ (g : G), 0 ≤ b g) → 0 ≤ E.utility i b) (heq : E.IsCompetitiveEquilibrium xHat pHat) (hpHat : ∀ (g : G), 0 < pHat g) (hp : ∀ (g : G), 0 < p g) (hε : 0 ≤ ε) (hratio : ∀ (j k : G), p j / pHat j ≤ (1 + ε / 3) * (p k / pHat k)) :

NRTV Exercise 6.5 ([CV07], p. 158; used in Lemma 6.7, p. 146): if (xHat, pHat) is a positive competitive equilibrium of E (pHat > 0), p > 0, 0 ≤ ε, and all pairwise relative price ratios satisfy p j / pHat j ≤ (1 + ε / 3) * (p k / pHat k), then p is a weak (1 + ε)-approximate equilibrium of E (in fact weak (1 + ε / 3)-approximate).

Unit-supply market rescaling M → M' (Lemma 6.5) #

noncomputable def Cslib.GameTheory.Market.ExchangeMarket.unitRescale {I : Type u_1} {G : Type u_2} [Fintype I] (E : ExchangeMarket I G) :

Unit-supply rescaling M → M' ([CV07], Section 6.3.1, p. 143): normalizes trader endowments by W_g = E.totalSupply g and rescales bundle coordinates in each trader's utility function by W_g so that totalSupply g = 1 for positively supplied goods.

@[simp]
@[simp]
theorem Cslib.GameTheory.Market.ExchangeMarket.unitRescale_utility {I : Type u_1} {G : Type u_2} [Fintype I] (E : ExchangeMarket I G) (i : I) (b : G → ℝ) :
E.unitRescale.utility i b = E.utility i fun (g : G) => E.totalSupply g * b g
theorem Cslib.GameTheory.Market.ExchangeMarket.isApproxDemand_unitRescale_iff {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] (E : ExchangeMarket I G) (hW : ∀ (g : G), 0 < E.totalSupply g) (μ : ℝ) (p : G → ℝ) (i : I) (b : G → ℝ) :
IsApproxDemand (E.unitRescale.utility i) μ p (E.unitRescale.endowment i) b ↔ IsApproxDemand (E.utility i) μ (fun (g : G) => p g / E.totalSupply g) (E.endowment i) fun (g : G) => E.totalSupply g * b g

Lemma 6.5 (i) ([CV07], p. 143): b is a μ-approximate demand at prices p for trader i in E.unitRescale if and only if (fun g => E.totalSupply g * b g) is a μ-approximate demand at prices (fun g => p g / E.totalSupply g) in E.

theorem Cslib.GameTheory.Market.ExchangeMarket.isWeakApproxEquilibrium_unitRescale_iff {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] (E : ExchangeMarket I G) (hW : ∀ (g : G), 0 < E.totalSupply g) (μ : ℝ) (p : G → ℝ) :

Lemma 6.5 (ii) ([CV07], p. 143): p is a weak μ-approximate equilibrium for E.unitRescale if and only if (fun g => p g / E.totalSupply g) is a weak μ-approximate equilibrium for E.

theorem Cslib.GameTheory.Market.isWeakGrossSubstitutes_unitRescale {G : Type u_2} {Z : (G → ℝ) → G → ℝ} {W : G → ℝ} (hW : ∀ (g : G), 0 < W g) (hWGS : IsWeakGrossSubstitutes Z) :
IsWeakGrossSubstitutes fun (p : G → ℝ) (g : G) => Z (fun (k : G) => p k / W k) g / W g

Lemma 6.5 (iii) ([CV07], p. 143): rescaling prices and excess demands by strictly positive total supplies W > 0 preserves weak gross substitutability.

Phantom Cobb–Douglas regularization M' → M̂ (Lemma 6.6 and Exercise 6.4) #

def Cslib.GameTheory.Market.tatonnementBox (G : Type u_3) [Fintype G] (η : ℝ) :
Set (G → ℝ)

Price box Δ = {p | ∀ g, η / (2 |G|) ≤ p g ≤ 1} containing normalized equilibria of the regularized market M̂ ([CV07], Section 6.3.1, p. 144).

@[simp]
theorem Cslib.GameTheory.Market.mem_tatonnementBox {G : Type u_2} [Fintype G] {η : ℝ} {p : G → ℝ} :
p ∈ tatonnementBox G η ↔ ∀ (g : G), η / (2 * ↑(Fintype.card G)) ≤ p g ∧ p g ≤ 1

Expanded price box Δ⁺ = {p | ∀ g, η / (4 |G|) ≤ p g ≤ 1 + η / (4 |G|)} on which excess-demand steps are taken during discrete tâtonnement ([CV07], Section 6.3.1, p. 144).

@[simp]
theorem Cslib.GameTheory.Market.mem_tatonnementOuterBox {G : Type u_2} [Fintype G] {η : ℝ} {p : G → ℝ} :
p ∈ tatonnementOuterBox G η ↔ ∀ (g : G), η / (4 * ↑(Fintype.card G)) ≤ p g ∧ p g ≤ 1 + η / (4 * ↑(Fintype.card G))
theorem Cslib.GameTheory.Market.priceRatio_le_of_mem_tatonnementOuterBox {G : Type u_2} [Fintype G] [Nonempty G] {η : ℝ} (hη0 : 0 < η) (hη1 : η ≤ 1) {p : G → ℝ} (hp : p ∈ tatonnementOuterBox G η) (j k : G) :
p j / p k ≤ 5 * ↑(Fintype.card G) / η
noncomputable def Cslib.GameTheory.Market.phantomDemand {G : Type u_2} [Fintype G] (η : ℝ) (p : G → ℝ) (g : G) :

Uniform Cobb–Douglas demand cobbDouglasDemand (1 / |G|) p (expenditure p (const η)) of the extra (m + 1)-st phantom trader in M̂ ([CV07], Section 6.3.1, p. 143).

@[simp]
theorem Cslib.GameTheory.Market.phantomDemand_apply {G : Type u_2} [Fintype G] (η : ℝ) (p : G → ℝ) (g : G) :
phantomDemand η p g = (1 / ↑(Fintype.card G) * expenditure p fun (x : G) => η) / p g
noncomputable def Cslib.GameTheory.Market.phantomExcessDemand {G : Type u_2} [Fintype G] (Z' : (G → ℝ) → G → ℝ) (η : ℝ) (p : G → ℝ) (g : G) :

Aggregate excess-demand function Z_{M̂}(p) = Z'(p) + (phantomDemand η p - η) of the regularized market M̂ ([CV07], p. 144).

@[simp]
theorem Cslib.GameTheory.Market.phantomExcessDemand_apply {G : Type u_2} [Fintype G] (Z' : (G → ℝ) → G → ℝ) (η : ℝ) (p : G → ℝ) (g : G) :
phantomExcessDemand Z' η p g = Z' p g + (phantomDemand η p g - η)

Lemma 6.6 (4) / Exercise 6.4 ([CV07], pp. 144, 158): adding the phantom Cobb–Douglas trader preserves weak gross substitutability.

theorem Cslib.GameTheory.Market.priceRatio_le_of_isWalrasianEquilibrium_phantomExcessDemand {G : Type u_2} [Fintype G] [Nonempty G] {Z' : (G → ℝ) → G → ℝ} {η : ℝ} (hη0 : 0 < η) (hη1 : η ≤ 1) (hX_nn : ∀ ⦃p : G → ℝ⦄, (∀ (g : G), 0 < p g) → ∀ (g : G), -1 ≤ Z' p g) {p : G → ℝ} (heq : IsWalrasianEquilibrium (phantomExcessDemand Z' η) p) (j k : G) :
p j / p k ≤ 2 * ↑(Fintype.card G) / η

Lemma 6.6 (2) / Exercise 6.4 ([CV07], pp. 144, 158): when original aggregate demand is nonnegative (∀ g, -1 ≤ Z' p g), every positive Walrasian equilibrium p of phantomExcessDemand Z' η (0 < η ≤ 1) satisfies p j / p k ≤ 2 |G| / η.

theorem Cslib.GameTheory.Market.mem_tatonnementBox_smul_of_isWalrasianEquilibrium {G : Type u_2} [Fintype G] [Nonempty G] {Z' : (G → ℝ) → G → ℝ} {η : ℝ} (hη0 : 0 < η) (hη1 : η ≤ 1) (hH : IsHomogeneousDegZero Z') (hX_nn : ∀ ⦃p : G → ℝ⦄, (∀ (g : G), 0 < p g) → ∀ (g : G), -1 ≤ Z' p g) {p : G → ℝ} (heq : IsWalrasianEquilibrium (phantomExcessDemand Z' η) p) :

Normalizing any positive Walrasian equilibrium of phantomExcessDemand Z' η by its maximum coordinate produces a Walrasian equilibrium inside tatonnementBox G η (Δ).

theorem Cslib.GameTheory.Market.exists_mem_tatonnementBox_isWalrasianEquilibrium {G : Type u_2} [Fintype G] [Nonempty G] {Z' : (G → ℝ) → G → ℝ} {η : ℝ} (hη0 : 0 < η) (hη1 : η ≤ 1) (hH : IsHomogeneousDegZero Z') (hW : SatisfiesWalrasLaw Z') (hX_nn : ∀ ⦃p : G → ℝ⦄, (∀ (g : G), 0 < p g) → ∀ (g : G), -1 ≤ Z' p g) (hcont : ContinuousOn Z' {p : G → ℝ | ∀ (g : G), 0 < p g}) :

Lemma 6.6 (1) ([CV07], p. 144): if Z' is homogeneous of degree 0, satisfies Walras's law, has nonnegative underlying demand (∀ g, -1 ≤ Z' p g), and is continuous on strictly positive price vectors, then phantomExcessDemand Z' η (0 < η ≤ 1) admits a Walrasian equilibrium pStar ∈ tatonnementBox G η. Proved directly from Cslib.Brouwer.exists_isFixedPt_pi_simplex via Gale–Nikaido price adjustment on the trimmed simplex {p | ∑ g, p g = 1 ∧ ∀ g, δ ≤ p g} with δ = η / (8 |G|^2).

noncomputable def Cslib.GameTheory.Market.ExchangeMarket.withPhantomTrader {I : Type u_1} {G : Type u_2} [Fintype G] (E : ExchangeMarket I G) (η : ℝ) (hη : 0 ≤ η) :

Adjoin the (m + 1)-st phantom Cobb–Douglas trader none with uniform endowment (η, …, η) (M' → M̂, [CV07], Section 6.3.1, p. 143).

@[simp]
theorem Cslib.GameTheory.Market.ExchangeMarket.withPhantomTrader_endowment_some {I : Type u_1} {G : Type u_2} [Fintype G] (E : ExchangeMarket I G) (η : ℝ) (hη : 0 ≤ η) (i : I) :
@[simp]
theorem Cslib.GameTheory.Market.ExchangeMarket.withPhantomTrader_endowment_none {I : Type u_1} {G : Type u_2} [Fintype G] (E : ExchangeMarket I G) (η : ℝ) (hη : 0 ≤ η) :
(E.withPhantomTrader η hη).endowment none = fun (x : G) => η
@[simp]
theorem Cslib.GameTheory.Market.ExchangeMarket.withPhantomTrader_utility_some {I : Type u_1} {G : Type u_2} [Fintype G] (E : ExchangeMarket I G) (η : ℝ) (hη : 0 ≤ η) (i : I) :
@[simp]
theorem Cslib.GameTheory.Market.ExchangeMarket.withPhantomTrader_utility_none {I : Type u_1} {G : Type u_2} [Fintype G] (E : ExchangeMarket I G) (η : ℝ) (hη : 0 ≤ η) :
(E.withPhantomTrader η hη).utility none = cobbDouglasUtility fun (x : G) => 1 / ↑(Fintype.card G)
theorem Cslib.GameTheory.Market.ExchangeMarket.withPhantomTrader_totalSupply {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] (E : ExchangeMarket I G) (η : ℝ) (hη : 0 ≤ η) (g : G) :
theorem Cslib.GameTheory.Market.ExchangeMarket.isWeakApproxEquilibrium_of_withPhantomTrader {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] (E : ExchangeMarket I G) (hsup : ∀ (g : G), E.totalSupply g = 1) (hu_nn : ∀ (i : I) (b : G → ℝ), (∀ (g : G), 0 ≤ b g) → 0 ≤ E.utility i b) {η μ : ℝ} (hη : 0 ≤ η) {p : G → ℝ} (h : (E.withPhantomTrader η hη).IsWeakApproxEquilibrium μ p) :
E.IsWeakApproxEquilibrium (μ * (1 + η)) p

Lemma 6.6 (3) / Exercise 6.4 ([CV07], pp. 144, 158): in a unit-supply market E (∀ g, E.totalSupply g = 1), any weak μ-approximate equilibrium p of E.withPhantomTrader η hη is a weak μ * (1 + η)-approximate equilibrium of E.

Quantitative separation (Lemma 6.7), ℓ_2 bound (Lemma 6.8), and Theorem 6.9 #

noncomputable def Cslib.GameTheory.Market.tatonnementDelta (n : ℕ) (ε η : ℝ) :

Explicit polynomial separation constant δ(n, ε, η) = ε^2 η^2 / (144 n^4) of [CV07], Lemma 6.7, p. 146.

@[simp]
theorem Cslib.GameTheory.Market.tatonnementDelta_eq (n : ℕ) (ε η : ℝ) :
tatonnementDelta n ε η = ε ^ 2 * η ^ 2 / (144 * ↑n ^ 4)
noncomputable def Cslib.GameTheory.Market.tatonnementBoundL (n : ℕ) (η : ℝ) :

Explicit ℓ_2 excess-demand upper bound L(n, η) = 12 n^2 / η of [CV07], Lemma 6.8, p. 146.

@[simp]
noncomputable def Cslib.GameTheory.Market.tatonnementMu (n : ℕ) (η δ : ℝ) :

Per-iteration squared-distance decrease μ = min((δ / (12 n^2 / η))^2, (η / (4n))^2) of [CV07], Theorem 6.9, p. 147.

@[simp]
theorem Cslib.GameTheory.Market.tatonnementMu_eq (n : ℕ) (η δ : ℝ) :
tatonnementMu n η δ = min ((δ / tatonnementBoundL n η) ^ 2) ((η / (4 * ↑n)) ^ 2)
theorem Cslib.GameTheory.Market.expenditure_phantomExcessDemand_ge_delta {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] [Nonempty G] {E : ExchangeMarket I G} (hray : ∀ (i : I), IsRayConcave (E.utility i)) (hu_nn : ∀ (i : I) (b : G → ℝ), (∀ (g : G), 0 ≤ b g) → 0 ≤ E.utility i b) {d : I → (G → ℝ) → G → ℝ} (hd : ∀ ⦃q : G → ℝ⦄, (∀ (g : G), 0 < q g) → ∀ (i : I), d i q ∈ E.demandSet q i) {Z' : (G → ℝ) → G → ℝ} (hZ'_eq : ∀ ⦃q : G → ℝ⦄, (∀ (g : G), 0 < q g) → ∀ (g : G), Z' q g = ∑ i : I, d i q g - E.totalSupply g) (hH' : IsHomogeneousDegZero Z') (hW' : SatisfiesWalrasLaw Z') (hWGS' : IsWeakGrossSubstitutes Z') {η ε : ℝ} (hη0 : 0 < η) (hε0 : 0 < ε) (hε1 : ε ≤ 1) {pHat p : G → ℝ} (hpHat_box : pHat ∈ tatonnementBox G η) (heqHat : IsWalrasianEquilibrium (phantomExcessDemand Z' η) pHat) (hp_box : p ∈ tatonnementOuterBox G η) (hnot : ¬(E.withPhantomTrader η ⋯).IsWeakApproxEquilibrium (1 + ε) p) :

Lemma 6.7 ([CV07], Section 6.3.1, pp. 145–146): suppose E is a unit-supply market (∀ g, E.totalSupply g = 1) with ray-concave nonnegative utilities whose excess-demand map Z' comes from trader Marshallian demands d i p ∈ E.demandSet p i and satisfies degree-0 homogeneity, Walras's law, and WGS. For 0 < η, 0 < ε ≤ 1, any equilibrium pHat ∈ tatonnementBox G η of phantomExcessDemand Z' η, and any p ∈ tatonnementOuterBox G η that is not a weak (1 + ε)-approximate equilibrium of E.withPhantomTrader η hη0.le, tatonnementDelta (Fintype.card G) ε η ≤ expenditure pHat (phantomExcessDemand Z' η p). (Note the minor typo on p. 146 line 3 of [CV07] writing "weak ε-approximate equilibrium" in the proof body for the statement's "weak (1 + ε)-approximate equilibrium".)

theorem Cslib.GameTheory.Market.sum_sq_phantomExcessDemand_le {G : Type u_2} [Fintype G] [Nonempty G] {Z' : (G → ℝ) → G → ℝ} {η : ℝ} (hη0 : 0 < η) (hη1 : η ≤ 1) (hW' : SatisfiesWalrasLaw Z') (hX_nn : ∀ ⦃q : G → ℝ⦄, (∀ (g : G), 0 < q g) → ∀ (g : G), -1 ≤ Z' q g) {p : G → ℝ} (hp : p ∈ tatonnementOuterBox G η) :
∑ g : G, phantomExcessDemand Z' η p g ^ 2 ≤ tatonnementBoundL (Fintype.card G) η ^ 2

Lemma 6.8 ([CV07], Section 6.3.1, pp. 146–147): for any p ∈ tatonnementOuterBox G η (0 < η ≤ 1), when Z' satisfies Walras's law and ∀ g, -1 ≤ Z' p g (nonnegative original demand against unit supplies), the ℓ_1 and squared ℓ_2 norms of phantomExcessDemand Z' η p satisfy ∑ g, |Z p g| ≤ 12 |G|^2 / η and ∑ g, (Z p g)^2 ≤ (12 |G|^2 / η)^2.

noncomputable def Cslib.GameTheory.Market.projectTatonnementBox {G : Type u_2} [Fintype G] (η : ℝ) (p : G → ℝ) (g : G) :

Componentwise projection max (η / (2 |G|)) (min 1 (p g)) onto tatonnementBox G η (Δ) ([CV07], Section 6.3.1, p. 144).

@[simp]
theorem Cslib.GameTheory.Market.projectTatonnementBox_apply {G : Type u_2} [Fintype G] (η : ℝ) (p : G → ℝ) (g : G) :
projectTatonnementBox η p g = max (η / (2 * ↑(Fintype.card G))) (min 1 (p g))
noncomputable def Cslib.GameTheory.Market.tatonnementStep {G : Type u_2} [Fintype G] (Z : (G → ℝ) → G → ℝ) (η δ : ℝ) (p : G → ℝ) :
G → ℝ

One step of the projected discrete tâtonnement process ([CV07], Section 6.3.1, p. 144): if p ∈ Δ⁺, move in direction Z p with step size δ / (12 |G|^2 / η)^2; otherwise project componentwise back onto Δ.

theorem Cslib.GameTheory.Market.tatonnementStep_of_mem {G : Type u_2} [Fintype G] (Z : (G → ℝ) → G → ℝ) (η δ : ℝ) {p : G → ℝ} (hp : p ∈ tatonnementOuterBox G η) :
tatonnementStep Z η δ p = p + (δ / tatonnementBoundL (Fintype.card G) η ^ 2) • Z p
theorem Cslib.GameTheory.Market.tatonnementStep_of_not_mem {G : Type u_2} [Fintype G] (Z : (G → ℝ) → G → ℝ) (η δ : ℝ) {p : G → ℝ} (hp : p ∉ tatonnementOuterBox G η) :
noncomputable def Cslib.GameTheory.Market.tatonnementIter {G : Type u_2} [Fintype G] (Z : (G → ℝ) → G → ℝ) (η δ : ℝ) (p₀ : G → ℝ) (k : ℕ) :
G → ℝ

k-th iterate of tatonnementStep Z η δ starting from p₀.

@[simp]
theorem Cslib.GameTheory.Market.tatonnementIter_zero {G : Type u_2} [Fintype G] (Z : (G → ℝ) → G → ℝ) (η δ : ℝ) (p₀ : G → ℝ) :
tatonnementIter Z η δ p₀ 0 = p₀
theorem Cslib.GameTheory.Market.tatonnementIter_succ {G : Type u_2} [Fintype G] (Z : (G → ℝ) → G → ℝ) (η δ : ℝ) (p₀ : G → ℝ) (k : ℕ) :
tatonnementIter Z η δ p₀ (k + 1) = tatonnementStep Z η δ (tatonnementIter Z η δ p₀ k)
theorem Cslib.GameTheory.Market.exists_le_tatonnementIter_sep_lt {G : Type u_2} [Fintype G] [Nonempty G] {Z : (G → ℝ) → G → ℝ} (hWZ : SatisfiesWalrasLaw Z) {η δ : ℝ} (hη0 : 0 < η) (hη1 : η ≤ 1) (hδ : 0 < δ) (hnorm : ∀ p ∈ tatonnementOuterBox G η, ∑ g : G, Z p g ^ 2 ≤ tatonnementBoundL (Fintype.card G) η ^ 2) {pStar p₀ : G → ℝ} (hpStar : pStar ∈ tatonnementBox G η) (hp₀ : p₀ ∈ tatonnementBox G η) :
∃ k ≤ ⌊↑(Fintype.card G) / tatonnementMu (Fintype.card G) η δ⌋₊, tatonnementIter Z η δ p₀ k ∈ tatonnementOuterBox G η ∧ expenditure pStar (Z (tatonnementIter Z η δ p₀ k)) < δ

Theorem 6.9 (Lyapunov separating-hyperplane core) ([CV07], Section 6.3.1, pp. 147–148): let Z satisfy Walras's law on ℝ_{++}^G and ∑ g, (Z p g)^2 ≤ L^2 on Δ⁺, and let pStar ∈ Δ be a reference vector (0 < η ≤ 1, 0 < δ). Starting from any p₀ ∈ Δ, within k ≤ ⌊|G| / μ⌋ iterations (μ = tatonnementMu |G| η δ), tatonnementIter visits a price vector p_k ∈ Δ⁺ satisfying expenditure pStar (Z p_k) < δ. (Note the minor intermediate exponent slip on p. 147 line 19 of [CV07] writing δ / L^2 before ‖Z‖_2^2 where (δ / L^2)^2 is meant; the exact 2 (a · q) - ‖q‖_2^2 expansion gives the exact printed decrease δ^2 / L^2 on p. 148.)

theorem Cslib.GameTheory.Market.exists_le_tatonnementIter_isWeakApproxEquilibrium {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] [Nonempty G] {E : ExchangeMarket I G} (hray : ∀ (i : I), IsRayConcave (E.utility i)) (hu_nn : ∀ (i : I) (b : G → ℝ), (∀ (g : G), 0 ≤ b g) → 0 ≤ E.utility i b) {d : I → (G → ℝ) → G → ℝ} (hd : ∀ ⦃q : G → ℝ⦄, (∀ (g : G), 0 < q g) → ∀ (i : I), d i q ∈ E.demandSet q i) {Z' : (G → ℝ) → G → ℝ} (hZ'_eq : ∀ ⦃q : G → ℝ⦄, (∀ (g : G), 0 < q g) → ∀ (g : G), Z' q g = ∑ i : I, d i q g - E.totalSupply g) (hsup : ∀ (g : G), E.totalSupply g = 1) (hH' : IsHomogeneousDegZero Z') (hW' : SatisfiesWalrasLaw Z') (hWGS' : IsWeakGrossSubstitutes Z') (hcont' : ContinuousOn Z' {q : G → ℝ | ∀ (g : G), 0 < q g}) {η ε : ℝ} (hη0 : 0 < η) (hη1 : η ≤ 1) (hε0 : 0 < ε) (hε1 : ε ≤ 1) {p₀ : G → ℝ} (hp₀ : p₀ ∈ tatonnementBox G η) :
have δ := tatonnementDelta (Fintype.card G) ε η; have μ := tatonnementMu (Fintype.card G) η δ; ∃ k ≤ ⌊↑(Fintype.card G) / μ⌋₊, tatonnementIter (phantomExcessDemand Z' η) η δ p₀ k ∈ tatonnementOuterBox G η ∧ (E.withPhantomTrader η ⋯).IsWeakApproxEquilibrium (1 + ε) (tatonnementIter (phantomExcessDemand Z' η) η δ p₀ k)

Theorem 6.9 ([CV07], Section 6.3.1, p. 147): for a unit-supply WGS exchange economy E with continuous Marshallian demands d i, parameters 0 < η ≤ 1 and 0 < ε ≤ 1, separation constant δ = tatonnementDelta |G| ε η, and any starting price vector p₀ ∈ tatonnementBox G η, projected discrete tâtonnement finds a weak (1 + ε)-approximate equilibrium of E.withPhantomTrader η hη0.le inside tatonnementOuterBox G η within ⌊|G| / μ⌋ iterations.

theorem Cslib.GameTheory.Market.ExchangeMarket.unitRescale_wgs_transfer {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] {E : ExchangeMarket I G} (hW : ∀ (g : G), 0 < E.totalSupply g) (hray : ∀ (i : I), IsRayConcave (E.utility i)) (hu_nn : ∀ (i : I) (b : G → ℝ), (∀ (g : G), 0 ≤ b g) → 0 ≤ E.utility i b) {d : I → (G → ℝ) → G → ℝ} (hd : ∀ ⦃q : G → ℝ⦄, (∀ (g : G), 0 < q g) → ∀ (i : I), d i q ∈ E.demandSet q i) {Z : (G → ℝ) → G → ℝ} (hZ_eq : ∀ ⦃q : G → ℝ⦄, (∀ (g : G), 0 < q g) → ∀ (g : G), Z q g = ∑ i : I, d i q g - E.totalSupply g) (hH : IsHomogeneousDegZero Z) (hWalras : SatisfiesWalrasLaw Z) (hWGS : IsWeakGrossSubstitutes Z) (hcont : ContinuousOn Z {q : G → ℝ | ∀ (g : G), 0 < q g}) :
have d' := fun (i : I) (q : G → ℝ) (g : G) => d i (fun (l : G) => q l / E.totalSupply l) g / E.totalSupply g; have Z' := fun (p : G → ℝ) (g : G) => Z (fun (l : G) => p l / E.totalSupply l) g / E.totalSupply g; (∀ (i : I), IsRayConcave (E.unitRescale.utility i)) ∧ (∀ (i : I) (b : G → ℝ), (∀ (g : G), 0 ≤ b g) → 0 ≤ E.unitRescale.utility i b) ∧ (∀ ⦃q : G → ℝ⦄, (∀ (g : G), 0 < q g) → ∀ (i : I), d' i q ∈ E.unitRescale.demandSet q i) ∧ (∀ ⦃q : G → ℝ⦄, (∀ (g : G), 0 < q g) → ∀ (g : G), Z' q g = ∑ i : I, d' i q g - E.unitRescale.totalSupply g) ∧ (∀ (g : G), E.unitRescale.totalSupply g = 1) ∧ IsHomogeneousDegZero Z' ∧ SatisfiesWalrasLaw Z' ∧ IsWeakGrossSubstitutes Z' ∧ ContinuousOn Z' {q : G → ℝ | ∀ (g : G), 0 < q g}

Shared unit-supply rescaling transfer for WGS excess-demand solvers: given a positively supplied exchange market E with ray-concave nonnegative utilities, Marshallian demands d, and continuous degree-0 homogeneous Walrasian WGS excess demand Z, transfers all nine demand, unit-supply, homogeneity, Walras's law, WGS, and continuity hypotheses to E.unitRescale.

theorem Cslib.GameTheory.Market.exists_weakApproxEquilibrium_of_wgs_oracle {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] [Nonempty G] {E : ExchangeMarket I G} (hW : ∀ (g : G), 0 < E.totalSupply g) (hray : ∀ (i : I), IsRayConcave (E.utility i)) (hu_nn : ∀ (i : I) (b : G → ℝ), (∀ (g : G), 0 ≤ b g) → 0 ≤ E.utility i b) {d : I → (G → ℝ) → G → ℝ} (hd : ∀ ⦃q : G → ℝ⦄, (∀ (g : G), 0 < q g) → ∀ (i : I), d i q ∈ E.demandSet q i) {Z : (G → ℝ) → G → ℝ} (hZ_eq : ∀ ⦃q : G → ℝ⦄, (∀ (g : G), 0 < q g) → ∀ (g : G), Z q g = ∑ i : I, d i q g - E.totalSupply g) (hH : IsHomogeneousDegZero Z) (hWalras : SatisfiesWalrasLaw Z) (hWGS : IsWeakGrossSubstitutes Z) (hcont : ContinuousOn Z {q : G → ℝ | ∀ (g : G), 0 < q g}) {ε : ℝ} (hε0 : 0 < ε) (hε1 : ε ≤ 1) :
have Z' := fun (p : G → ℝ) (g : G) => Z (fun (l : G) => p l / E.totalSupply l) g / E.totalSupply g; have η := ε / 3; have δ := tatonnementDelta (Fintype.card G) η η; have μ := tatonnementMu (Fintype.card G) η δ; ∃ k ≤ ⌊↑(Fintype.card G) / μ⌋₊, E.IsWeakApproxEquilibrium (1 + ε) fun (g : G) => tatonnementIter (phantomExcessDemand Z' η) η δ (fun (x : G) => 1) k g / E.totalSupply g

End-to-end excess-demand oracle guarantee (Theorem 6.10 iteration bound) ([CV07], Section 6.3.1, Theorem 6.10, p. 148): for any positively supplied WGS exchange economy E (∀ g, 0 < E.totalSupply g) with continuous single-valued demands d i and accuracy 0 < ε ≤ 1, running projected discrete tâtonnement on the rescaled, regularized excess-demand oracle with η = ε / 3 from uniform prices (fun _ => 1) ∈ Δ visits within ⌊|G| / μ⌋ oracle calls a price vector whose un-rescaled image (fun g => p_k g / E.totalSupply g) is a weak (1 + ε)-approximate equilibrium of the original market E.

theorem Cslib.GameTheory.Market.CobbDouglasExchangeMarket.toExchangeMarket_utility_nonneg {I : Type u_1} {G : Type u_2} [Fintype G] (E : CobbDouglasExchangeMarket I G) (i : I) {b : G → ℝ} (hb : ∀ (g : G), 0 ≤ b g) :
theorem Cslib.GameTheory.Market.CobbDouglasExchangeMarket.exists_weakApproxEquilibrium_tatonnement {I : Type u_1} {G : Type u_2} [Fintype I] [Fintype G] (E : CobbDouglasExchangeMarket I G) [Nonempty G] (hW : ∀ (g : G), 0 < E.toExchangeMarket.totalSupply g) {ε : ℝ} (hε0 : 0 < ε) (hε1 : ε ≤ 1) :
have W := E.toExchangeMarket.totalSupply; have Z' := fun (p : G → ℝ) (g : G) => E.excessDemandFn (fun (l : G) => p l / W l) g / W g; have η := ε / 3; have δ := tatonnementDelta (Fintype.card G) η η; have μ := tatonnementMu (Fintype.card G) η δ; ∃ k ≤ ⌊↑(Fintype.card G) / μ⌋₊, E.toExchangeMarket.IsWeakApproxEquilibrium (1 + ε) fun (g : G) => tatonnementIter (phantomExcessDemand Z' η) η δ (fun (x : G) => 1) k g / W g

Direct instantiation of Theorem 6.10 (exists_weakApproxEquilibrium_of_wgs_oracle) for any positively supplied CobbDouglasExchangeMarket: discharges ray concavity, nonnegativity, Marshallian demand optimality, Walras's law, WGS, and continuity automatically.