# MathFin > A Lean 4 library of formally verified mathematical finance, built on Mathlib and the BrownianMotion > package. 787 modules, 6,114 public theorems and lemmas, a corpus of 906 > theorem statements. `MathFin` contains no `sorry`; every theorem the corpus cites is pinned by > the build to `propext`, `Classical.choice` and `Quot.sound`. The library covers stochastic calculus, arbitrage and pricing, term structure and credit, portfolios and risk, choice and insurance. It is organized around one object, a price system (positions in a market and the pricing measures that price them), and three questions about it: valuation, risk and choice. This site is generated from the Lean environment's declaration index. ## Pins and dependency - [lean-toolchain](https://github.com/formal-applied-math/formal-mathfin/blob/main/lean-toolchain): the Lean version. - [lake-manifest.json](https://github.com/formal-applied-math/formal-mathfin/blob/main/lake-manifest.json): the Mathlib and BrownianMotion revisions. - [README, Using the library in a project](https://github.com/formal-applied-math/formal-mathfin#using-the-library-in-a-project): add a `[[require]]` entry named `MathFin` with `git = "https://github.com/formal-applied-math/formal-mathfin"` and `rev` set to a release tag, then `lake update`, `lake exe cache get`, `lake build`, and `import MathFin`. ## Reading a corpus entry Each corpus entry carries a status in `metadata.formalization_status`: - `full`: the theorem as stated. - `library_wrapper`: restates a Mathlib or BrownianMotion lemma. - `reduced_core`: proves less than the result it is named after. Cite only `full` and `library_wrapper` entries as the named theorem. Read the entry's `description` and `metadata.formalization_scope` for what it proves and what it leaves out. The corpus has 866 `full`, 18 `library_wrapper` and 22 `reduced_core` entries. ## Machine-readable resources - [search.json](https://formal-applied-math.github.io/formal-mathfin/search.json): 7,500 public declarations as `n` (name), `u` (page URL, relative to the site root), `k` (kind), `m` (module), `d` (first sentence of the docstring) and `h` (lowercased search text). - [Hugging Face dataset](https://huggingface.co/datasets/formal-applied-math/formal-mathfin-theorems): the corpus, one row per entry with `lean_code`, status, description, `formalization_scope`, `cell`, `family` and `subjects`. - Declaration index: `decl-index.json`, produced by `lake exe mathfin_index`; query it with `python3 -m tools.verify.find`. It is the `decl-index` artifact of the latest `build` workflow run on `main`. ## Pages - [Landmarks](https://formal-applied-math.github.io/formal-mathfin/landmarks.html): the headline theorems with their exact Lean statements. - [Blueprint](https://formal-applied-math.github.io/formal-mathfin/blueprint.html): 180 results proved in Lean and the stated results on the frontier, with dependencies read from proof terms. - [Program tree](https://formal-applied-math.github.io/formal-mathfin/tree.html): the library as roots, trunk and limbs. - [Markets and bridges](https://formal-applied-math.github.io/formal-mathfin/joints.html): which model families are priced in a market. - [Corpus](https://formal-applied-math.github.io/formal-mathfin/corpus.html): the theorem statements by status and area. - [Subjects](https://formal-applied-math.github.io/formal-mathfin/subjects.html), [References](https://formal-applied-math.github.io/formal-mathfin/references.html). ## Repository documentation - [Organization](https://github.com/formal-applied-math/formal-mathfin/blob/main/docs/organization.md): how the library is arranged. - [Glossary](https://github.com/formal-applied-math/formal-mathfin/blob/main/docs/glossary.md): the terms used on this site. - [CONTRIBUTING](https://github.com/formal-applied-math/formal-mathfin/blob/main/CONTRIBUTING.md) and [onboarding](https://github.com/formal-applied-math/formal-mathfin/blob/main/docs/onboarding.md): adding a theorem. - [Research problems](https://github.com/formal-applied-math/formal-mathfin/blob/main/docs/research-problems/README.md): the open-problem catalogue. - [AGENTS.md](https://github.com/formal-applied-math/formal-mathfin/blob/main/AGENTS.md): notes for agents that read, cite or change the repository.