Papers
Topics
Authors
Recent
Search
2000 character limit reached

EconCSLib: Lean Library for Econ & Computation

Updated 5 July 2026
  • EconCSLib is a Lean 4 library and AI-assisted workflow that formalizes computational economics by unifying diverse topics such as game theory, mechanism design, and fair division.
  • It features a two-layer architecture with a reusable shared infrastructure and paper-specific audit layers, enabling incremental formalization and cumulative reuse of mathematical definitions and theorems.
  • The design emphasizes local assumptions, human–AI collaboration, and open problems, fostering a scalable and community-driven research ecosystem.

EconCSLib is a Lean 4 library and AI-assisted formalization workflow for Economics & Computation and computational economics, intended as a shared formal foundation for algorithmic game theory, mechanism design, social choice, fair division, matching, and related optimization-oriented topics. It is presented simultaneously as infrastructure and as a case study in AI-assisted formalization: reusable definitions and theorems are collected in a common library, while research papers are formalized against that shared vocabulary rather than reconstructed independently for each result (Bei et al., 15 Jun 2026, Garg, 11 Jun 2026).

1. Domain, motivation, and research program

The project is motivated by the same cumulative logic that made mathlib important for mathematical formalization: once a domain has a sufficiently rich stock of machine-checkable definitions and lemmas, later formalization becomes incremental rather than one-off. In computational economics, this motivation is amplified by the recurrence of objects such as players, preferences, profiles, utilities, allocations, mechanisms, equilibria, and solution concepts, together with the fact that small changes in assumptions can substantially alter theorem statements. The project therefore treats the absence of a systematic Lean library for computational economics as a methodological bottleneck and proposes EconCSLib as the corresponding domain library (Bei et al., 15 Jun 2026).

The intended scope is explicitly broad. Foundation modules cover players, preferences, profiles, utility theory, allocations, and mechanisms. Mathematical infrastructure includes combinatorial optimization, matroid theory, fixed-point arguments, finite-dimensional tools, linear programming duality, Farkas’ lemma, and minimax theorems. Algorithmic infrastructure includes approximation algorithms, randomized algorithms, online algorithms, complexity-theoretic statements, decidable predicates, and computable checkers. The main application domains span strategic-form, extensive-form, and cooperative game theory; dominant-strategy and Bayesian mechanism design; auctions and incomplete-information game models; voting, fair division, and other parts of social choice; and market design topics including matching markets, exchange markets, and market equilibrium (Bei et al., 15 Jun 2026).

A parallel description emphasizes the repository as a public library for Economics & Computation research organized around formalized papers as well as reusable mathematics. In that presentation, the shared library includes probability and stochastic processes, optimization and certificates, matching markets, auctions and mechanisms, online algorithms and regret, complexity abstractions, recommender systems, social choice, rankings, fair division, graph tools, and finite-math foundations. This paper-centered orientation is central: the project is not limited to verifying isolated canonical theorems, but is designed so that authors can formalize their own papers and contribute reusable components back to a common infrastructure (Garg, 11 Jun 2026).

2. Repository architecture and paper-centered organization

EconCSLib is organized as a two-layer Lean codebase: a reusable shared library in EconCSLib/ and a paper-specific audit layer in papers/. The shared layer contains paper-independent infrastructure, while each paper folder is meant to preserve source notation, preserve theorem numbering, encode paper-facing statements, contain proofs, and include human-facing validation artifacts. Reusable results that appear likely to matter beyond a single paper are “elevated” into the shared library (Garg, 11 Jun 2026).

Layer or artifact Function Typical contents
EconCSLib/ Shared infrastructure probability, optimization, matching, auctions, graph tools
papers/ Paper-specific audit layer paper-facing statements, proofs, validation artifacts
PaperInterface.lean Reviewable translation boundary definitions and theorem statements without proofs
Dependency DAG Progress and dependency tracking named statements and their dependencies
FINAL_VALIDATION_REPORT.md Post-formalization audit proof-route deviations, extra assumptions, review status

The architecture distinguishes sharply between paper-facing formal statements and reusable infrastructure. Paper-facing statements correspond directly to source-paper definitions, lemmas, propositions, and theorems, and are intentionally kept compact so that humans can inspect the translation from paper language to Lean. Shared infrastructure, by contrast, collects results such as probability tools, optimization certificates, matching primitives, auction rules and truthfulness machinery, online-algorithm abstractions, graph lemmas, and complexity wrappers. This separation is designed to preserve source fidelity at the paper interface while still allowing cumulative reuse across formalizations (Garg, 11 Jun 2026).

A further organizational feature is explicit status tracking. The appendix of the workflow paper defines the formalization statuses formalized, formalized with caveat, and partially formalized. For translation audit it defines match, uncertain, mismatch, stale, and missing. This vocabulary reflects the project’s view that theorem proving and statement verification are different tasks: a proof may compile even when the formal statement has drifted from the source claim, so the repository records both mathematical closure and translation confidence (Garg, 11 Jun 2026).

3. Foundational abstractions and Lean 4 design principles

The library emphasizes two design principles. The first is reuse through abstraction: rather than building separate local models for each theorem, EconCSLib organizes the domain around shared notions such as preference relations, strategy profiles, allocation rules, and mechanisms. The second is to keep assumptions local: core definitions should carry only the data necessary to define the object, while assumptions such as finiteness, decidability, or nonemptiness are introduced only at theorem sites when required. This design is particularly important in economics, where one theorem may depend on finiteness and another may be purely structural, and where algorithmic results need computability assumptions that foundational objects do not (Bei et al., 15 Jun 2026).

The Lean implementation style is correspondingly minimal at the core. A preference is bundled as a relation together with proofs of the standard axioms; preference profiles are functions from agents to preferences; and a social-choice instance contains feasibility and a preference profile. Strategic games are defined minimally as strategy spaces plus a payoff function. Profiles are abstract dependent functions, and unilateral deviation is represented generally via Function.update. No finiteness assumptions are built into the core game object. The point is not merely notational elegance: this “small core object” style is intended to maximize reuse across voting, matching, fair division, mechanism design, and game theory (Bei et al., 15 Jun 2026).

A related design lesson drawn from development experience is that building reusable infrastructure is harder than formalizing a single theorem. Early choices about abstractions determine which later papers fit naturally into the library and which require awkward encodings. The project therefore warns against overcommitting to one modeling choice too early, and treats foundational interfaces—not just theorem counts—as a primary technical contribution (Bei et al., 15 Jun 2026).

The workflow paper describes the same principle from the repository side. When an agent formalizing a paper encounters a result that seems broadly useful, it may “elevate” that result into the shared library; otherwise the statement remains local to the paper folder. This is a formal analogue of library design in conventional software engineering, but here the pressure is heightened by the need to keep the paper interface reviewable while still enabling future mechanization to be cumulative (Garg, 11 Jun 2026).

4. Existing scale, modules, and verified mathematical content

The project is already nontrivial in scale. One paper states that the library contains more than 40,000 lines of Lean code and over 1,300 theorems/lemmas, with no additional axioms (Bei et al., 15 Jun 2026). A second paper reports that, as of June 11, 2026, the public repository contains 14 paper formalizations total, with 11 fully formalized and 3 partially formalized, and that about 5 additional papers are in progress in a private repository (Garg, 11 Jun 2026).

The verified mathematical content spans both classical theorems and domain-specific constructions. Representative completed formalizations include Arrow’s theorem, the Gibbard–Satterthwaite theorem, Zermelo-style determinacy, linear programming strong duality, Farkas’ lemma, minimax via Loomis’ theorem, Brouwer, KKM, and Scarf fixed-point theorems, VCG mechanisms, Myerson’s optimal auction, Gale–Shapley deferred acceptance, cut-and-choose, Dubins–Spanier cake cutting, and the existence of EFX allocations for two agents (Bei et al., 15 Jun 2026).

The domain breakdown is similarly broad. In game theory the library includes strategic-form games, extensive-form games, cooperative games, dominance, best response, mixed strategies, Nash equilibrium, zero-sum and constant-sum games, potential games, subgames, and backward induction; Kuhn’s theorem is identified as a next target. In mechanism design it includes dominant-strategy and Bayesian mechanisms, auctions, VCG-style mechanisms, Myerson’s optimal auction, and the Vickrey auction. In social choice it includes voting rules, axioms, Arrow, and Gibbard–Satterthwaite. In fair division it covers indivisible and divisible resources, envy-freeness, proportionality, relaxations of fairness notions, and EFX for two agents. In market design it includes stable matching and the Gale–Shapley algorithm, with competitive equilibrium with equal incomes and market-equilibrium existence listed as targets (Bei et al., 15 Jun 2026).

The workflow paper supplies a second perspective by listing formalized papers. Examples include Gale–Shapley’s College Admissions and the Stability of Marriage, Roth’s The Economics of Matching: Stability and Incentives, Goldberg, Hartline, and Wright’s Competitive Auctions and Digital Goods, Mehta et al.’s AdWords and Generalized Online Matching, and several papers by the project author and collaborators on rankings, rating systems, test-optional policies, surge pricing, recommender-system fairness, demographic prediction, and prior-weighted rating-system design. It also reports approximate module sizes, including 50,319 LOC for probability and stochastic processes, 12,347 LOC for auctions and mechanisms, 9,540 LOC for social choice, rankings, and fair division, and 8,223 LOC for finite math and graph tools (Garg, 11 Jun 2026).

5. Human–AI–Lean workflow and formal open problems

The workflow is explicitly described as a human–AI–Lean pipeline. An LLM writes Lean code from a paper PDF or LaTeX source by extracting definitions, lemmas, theorems, and proof ideas, and by following the paper’s proof structure where possible. Lean then checks that the formal statements and proofs compile. Humans, typically assisted by a dashboard, verify the translation boundary: whether the Lean statements actually match the intended paper claims. The project treats this last step as the principal epistemic bottleneck, because a valid formal proof does not guarantee faithful formalization of the informal theorem (Garg, 11 Jun 2026).

Several workflow artifacts are designed around that bottleneck. Each paper gets an auto-generated dependency DAG of its named mathematical statements. Each formalization also receives a FINAL_VALIDATION_REPORT.md summarizing which results were formalized, whether the proof followed the paper’s argument, whether proof strategy deviations occurred, whether extra assumptions were needed, whether source mistakes or ambiguities were found, and the current translation-review status. A review dashboard displays the paper’s LaTeX statement, the corresponding Lean statement, an AI-generated Lean-to-TeX draft produced without access to the source paper, and controls for marking whether the two statements match. The repository also experiments with an “LLM-as-Judge” loop in which one model translates Lean back to LaTeX and another compares that reconstruction with the source statement, although the current implementation raises concerns about correlated errors because the same Codex sub-agent performs the validation (Garg, 11 Jun 2026).

AI is described as locally powerful but globally subordinate. Current systems are said to be effective at expanding definitions, filling short proofs, translating informal arguments into initial Lean code, and adapting proofs after changes in definitions or modules. What remains hard is choosing the right abstractions, ensuring that the formal statement captures the intended economics, avoiding definitions that are too narrow to reuse, and validating semantic correctness. The recommended loop is therefore: domain researcher specifies the intended economic object, AI helps generate or repair Lean definitions and proofs, and the Lean kernel verifies the result (Bei et al., 15 Jun 2026).

A distinctive feature of the library is the treatment of open problems as first-class formal objects. The project intends to host not only finished proofs but also machine-checked open conjectures, represented either by sorry-bearing declarations or by explicit propositions awaiting proof, with a future plan to adopt the answer(sorry) mechanism from the Formal Conjectures project. Two examples are emphasized. One asks for a randomized polynomial-time demand-oracle algorithm for submodular welfare maximization that beats the $1 - 1/e$ approximation barrier. The other formalizes the open problem of whether EFX allocations always exist for indivisible goods with additive nonnegative valuations; the paper notes that the problem is known for up to three agents, while the case of four or more agents remains open (Bei et al., 15 Jun 2026).

6. Significance, limitations, and future directions

EconCSLib’s central significance lies in its attempt to do for computational economics what mathlib did for mathematics: establish a shared, reusable, machine-checkable infrastructure on which later work can accumulate. Its contribution is therefore not exhausted by the stock of verified theorems. Equally important are the domain-specific Lean abstractions, the insistence on local assumptions, the separation between paper-facing interfaces and reusable infrastructure, the treatment of open problems as formal targets, and the embedding of AI assistance inside a workflow that preserves human control over semantics (Bei et al., 15 Jun 2026).

The project is also explicitly author-facing. Authors are expected to clone the repository, open an LLM agent tool, provide a paper link, and ask the agent to formalize the paper using the repository’s workflow files. The author monitors the agent, intervenes when it gets stuck, checks that statement translation is faithful, and promotes reusable components into the shared library. The papers present this as one of the first systematic attempts by applied-mathematics researchers to formalize their own publications while simultaneously building a community library (Garg, 11 Jun 2026).

The limitations are stated plainly. The effort is early and experimental. The major bottlenecks include sparse human review of Lean statements, missing shared-library results, high token cost, gaps in continuous and probabilistic infrastructure, and uncertainty about how to organize community contributions. Even where theorems are formally closed, the expensive human validation of the paper-to-Lean translation remains incomplete in many cases. A concrete example in the validation system notes that, for ma2025balancing, a strict inequality required an extra assumption implicit in the source paper, namely that Bernoulli success probabilities pp were bounded away from 0 and 1. Such episodes show that formal closure and faithful translation are not identical achievements (Garg, 11 Jun 2026).

Future directions are correspondingly dual. On the mathematical side, the project aims to move from classical results to contemporary research papers, thereby testing whether its abstractions are expressive enough for current work in Economics & Computation. On the AI side, it aims at theorem-discovery and counterexample search over precise formal definitions, and at benchmark suites for evaluating theorem-proving agents on tasks ranging from local proof obligations to open research problems. Institutionally, the library is envisioned as community-driven and open-source, following the collaborative model of mathlib and cslib, with human review combined with AI-assisted contributions (Bei et al., 15 Jun 2026).

In this form, EconCSLib is neither merely a theorem archive nor merely an automated-code-generation experiment. It is a proposal for a formal research substrate in which papers, abstractions, proofs, caveats, and open conjectures are all represented within a common Lean 4 ecosystem, with explicit mechanisms for reuse, audit, and gradual expansion (Garg, 11 Jun 2026).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (2)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to EconCSLib.