AFTD Auto-Formalizing Theoretical Domains

walras_law

theoremverifiedformalization

In a pure exchange economy E with finite agents Agent and finite commodities Good, if an allocation x : Agent → Good → ℝ satisfies budget exhaustion at price vector p : Good → ℝ (that is, for every agent i, ∑ g, p g * x i g = ∑ g, p g * E.endowment i g), then the total market value of aggregate excess demand is zero: ∑ g, p g * (∑ i, x i g - ∑ i, E.endowment i g) = 0.

Statement

theorem walras_law {Agent Good : Type*} [Fintype Agent] [Fintype Good]
    (E : ExchangeEconomy Agent Good) (p : Good → ℝ) (x : Agent → Good → ℝ)
    (h_budget : ∀ i, ∑ g, p g * x i g = ∑ g, p g * E.endowment i g) :
    ∑ g, p g * (∑ i, x i g - ∑ i, E.endowment i g) = 0
Formalizes
Mas-Colell, Whinston, and Green, Microeconomic Theory (1995), Proposition 17.B.1; Debreu, Theory of Value (1959), Section 5.6.
Verified
01 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • ExchangeEconomyA pure exchange economy with agent type Agent and commodity type Good consists of a non-negative initial endowment of each good for each…

Read back from the Lean

For any finite types Agent and Good, let E be an exchange economy with agents Agent and goods Good, let p : Good → ℝ be a price function, and let x : Agent → Good → ℝ be an allocation. If every agent i : Agent satisfies the budget equation $\sum_{g} p(g) x(i, g) = \sum_{g} p(g) E.\text{endowment}(i, g)$, then the total value of aggregate excess demand is zero: $\sum_{g} p(g) \left(\sum_{i} x(i, g) - \sum_{i} E.\text{endowment}(i, g)\right) = 0$.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- Walras' Law: if every agent exhausts their budget constraint at price vector `p`, the total market value of aggregate excess demand is zero. -/theorem walras_law {Agent Good : Type*} [Fintype Agent] [Fintype Good]    (E : ExchangeEconomy Agent Good) (p : Good → ℝ) (x : Agent → Good → ℝ)    (h_budget : ∀ i, ∑ g, p g * x i g = ∑ g, p g * E.endowment i g) :    ∑ g, p g * (∑ i, x i g - ∑ i, E.endowment i g) = 0 := by  simp_rw [mul_sub, Finset.sum_sub_distrib, Finset.mul_sum]  rw [Finset.sum_comm, Finset.sum_comm (f := fun g i => p g * E.endowment i g)]  simp_rw [h_budget, sub_self]
See it in the graphDiscuss this resultChallenge it