EconLib is an open-source project dedicated to formalizing microeconomic theory using the Lean 4 interactive theorem prover.
This project serves a dual purpose:
- Educational: A platform for students to master Lean 4 while reviewing core mathematical economics and microeconomic theorems.
- Infrastructure: A growing "toolbox" of verified economic definitions and lemmas (e.g., MLRP, Risk Aversion, IC Constraints) that researchers can import and use in their own proofs.
- Bridge the Gap: Move beyond "sketched proofs" to fully verified economic logic.
- Property-Based Abstraction: Encode common economic assumptions as Lean Typeclasses. Instead of re-proving analytical properties, users can simply declare
[RiskAverse u]or[MLRP f g]and leverage automated deductions. - Collaborative Learning: Create a space where Economics PhDs can learn formal verification and Lean experts can explore economic structures.
The library is organized into modular directories:
EconLib.Foundations: Preferences, utility representation, and convexity analysis.EconLib.Uncertainty: Risk attitudes (ARA/RRA), Stochastic Dominance (FOSD/SOSD), and Information structures (MLRP).EconLib.Models: Core frameworks for Contract Theory (Principal-Agent) and Mechanism Design.EconLib.Lab: An experimental space for formalizing specific lemmas from classic papers (e.g., Holmström, Baron-Myerson).
This library depends heavily on mathlib4.
- Install Lean 4 and Elan.
- Clone the repo and run
lake update. - Start exploring from
EconLib/Foundations/Basic.lean.
If you are new to Lean but want to contribute:
- Pre-formalization: Provide rigorous LaTeX proofs of core lemmas in our Issues tracker. Breaking a proof into small, logical steps is the first step toward formalization.
- Review: Ensure that our code definitions accurately reflect the nuances of economic theory.
We welcome contributions at all levels!
- The "Review" Path: Pick a theorem from a graduate-level textbook (e.g., Mas-Colell) and attempt to prove it in the
Lab/folder. - The "Toolbox" Path: Help us define and bridge economic properties to existing
mathlibresults (e.g., linkingConcaveOntoRiskAversion). - The "Infrastructure" Path: Help us improve the automation of common economic derivations (e.g., using
aesoporexttactics).
If you are a student (like me) looking to review Micro-Theory while learning Lean 4, we recommend following our Roadmap.md.
- Pick a Lemma: Choose a "white box" (unproved) theorem from the roadmap.
- Draft in Lab: Create a file in
EconLib/Lab/to draft your proof. - Refine & Move: Once the proof is complete and cleaned of
sorrytags, we will move it to the coreEconLib/directory.
Current Focus: Formalizing the relationship between Risk Aversion and Utility Concavity.
- Maintainer: Ping-Ju (Ben) Hsieh (Incoming PhD student at TSE)
- Discussion: Join the conversation on the Lean Zulip Chat.