{"slug": "mathlib", "name": "mathlib", "category": "dev-libs", "category_name": "Libraries and frameworks", "description": "", "recommenders": 5, "commenters": 10, "warners": 1, "score": 4.774, "rising": 1.02, "first": "2025-11-02", "latest": "2026-10-10", "why": "I generally rather rely on someone else getting the category theory and algebraic structures right", "why_is_quote": true, "has_verdict": false, "sentiment": {"recommend": 5, "neutral": 5, "compare": 0, "warn": 1}, "spark": [1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2], "listed": true, "loved": [], "caveat": "", "short_quote": "I generally rather rely on someone else getting the category theory and algebraic structures right", "kind": "", "icon": true, "domain": null, "github_repo": "github.com/leanprover-community/mathlib4", "official_url": "https://leanprover-community.github.io", "pricing": "", "aliases": ["mathlib", "Mathlib"], "verdict": null, "praise": [{"label": "", "summary": "", "quotes": [{"id": 799922576, "item_id": 49995161, "url": "https://news.ycombinator.com/item?id=49995161", "by": "ammar2", "date": "2026-10-07", "stance": "recommend", "quote": "so we can be reasonably confident about their correctness", "excerpt": "That assumes the natural language paper came first and then was formalized in lean. I haven't looked too deeply into how these labs solve these problems (or if they even specify this publicly) but you could also start with lean and then write the natural language proof based on it. For what it's worth the initial lean specifications for the top-level theorems generally come from human written formalizations such as i", "context": "", "use_case": "", "switched_from": "", "story": "Navier\u2013Stokes Lost in Translation"}, {"id": 799811776, "item_id": 49988236, "url": "https://news.ycombinator.com/item?id=49988236", "by": "porcoda", "date": "2026-10-07", "stance": "recommend", "quote": "mathlib (human, expert curated)", "excerpt": "More specifically, a combination of mathlib (human, expert curated) and projects like TauCeti (AI-welcome complement to mathlib). See: https://github.com/TauCetiProject/TauCeti", "context": "", "use_case": "", "switched_from": "", "story": "Sharing AI progress in mathematics"}, {"id": 785008129, "item_id": 49063008, "url": "https://news.ycombinator.com/item?id=49063008", "by": "Jhsto", "date": "2026-07-26", "stance": "recommend", "quote": "I generally rather rely on someone else getting the category theory and algebraic structures right", "excerpt": "As a meta-comment on the topic, something I have noticed is that there still exists confusion what it means to use theorem provers for projects -- the other day I read a tweet from Paradigm, a crypto-VC now seemingly AI-pilled. Some LP of theirs had made a Lean 4 formalization of the Ethereum's virtual machine. The tweet said this would have cost like $150k in API tokens (\"would have\", as in, I guess they get theirs ", "context": "uses theorem provers for projects", "use_case": "reusing formalized math", "switched_from": "", "story": "We have proof automation now"}, {"id": 783986976, "item_id": 48999186, "url": "https://news.ycombinator.com/item?id=48999186", "by": "YoshiRulz", "date": "2026-07-21", "stance": "recommend", "quote": "From the article: https://mathlib.org", "excerpt": "From the article: https://mathlib.org Also https://1000-plus.github.io and https://us.metamath.org", "context": "", "use_case": "Formal math library", "switched_from": "", "story": "Human mathematicians are being outcounterexampled"}, {"id": 732661362, "item_id": 45791335, "url": "https://news.ycombinator.com/item?id=45791335", "by": "lacker", "date": "2025-11-02", "stance": "recommend", "quote": "Lean's library of mathematics, mathlib, is organized like an open source community with pull requests", "excerpt": "Dependent types are very useful for some things. For example, I wish Python had the ability to express \"a 10 x 5 matrix of float32s\" as a type, and typecheck that. The Curry-Howard correspondence, using dependent type system to have \"proofs\" be equivalent to \"types\", is powerful, but it can be really confusing. From a human point of view, there is a huge difference between \"Your proof is wrong\" and \"You wrote a state", "context": "", "use_case": "", "switched_from": "", "story": "Why don't you use dependent types?"}]}], "caveats": [{"label": "", "summary": "", "quotes": [{"id": 800133521, "item_id": 50008345, "url": "https://news.ycombinator.com/item?id=50008345", "by": "mirashii", "date": "2026-10-08", "stance": "warn", "quote": "the Lean formalization of the Riemann Hypothesis in Mathlib was incorrect.", "excerpt": "Here's a recent example of an AI exploiting a soundness hole in Lean in a paper purporting to have solved the Collatz Conjecture. https://leodemoura.github.io/blog/2026-8-1-postmortem-for-kernel-soundness-bug-14576/ There's also a fairly well known incident where the Lean formalization of the Riemann Hypothesis in Mathlib was incorrect.", "context": "", "use_case": "", "switched_from": "", "story": "OpenAI withdraws three mathematical results"}]}], "who": [{"by": "Jhsto", "context": "uses theorem provers for projects", "url": "https://news.ycombinator.com/item?id=49063008", "date": "2026-07-26"}], "tags": [], "use_cases": ["formal math library", "reusing formalized math"], "compared": [{"slug": "lean", "name": "Lean", "co": 6, "switched_from": 0, "switched_to": 0}], "makers": [], "threads": [{"url": "https://news.ycombinator.com/item?id=50024090", "title": "What mathematicians should know about the Lean Theorem Prover: reliability & AI", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=50002650", "title": "OpenAI withdraws three mathematical results", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=49994145", "title": "Navier\u2013Stokes Lost in Translation", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=49984923", "title": "Sharing AI progress in mathematics", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=49755095", "title": "Mathematicians Build Long-Awaited Graph Sandwich", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=49568506", "title": "Formalizing Fermat's Last Theorem", "mentions": 1}], "sentiment_by_month": {"2025-11": {"recommend": 1, "neutral": 1}, "2025-12": {}, "2026-01": {}, "2026-02": {}, "2026-03": {}, "2026-04": {"neutral": 1}, "2026-05": {}, "2026-06": {}, "2026-07": {"recommend": 2}, "2026-08": {}, "2026-09": {"neutral": 2}, "2026-10": {"recommend": 2, "warn": 1, "neutral": 1}}, "quotes": [{"id": 800549025, "item_id": 50034314, "url": "https://news.ycombinator.com/item?id=50034314", "by": "dnautics", "date": "2026-10-10", "stance": "neutral", "quote": "considerable uplift of Lean's mathlib", "excerpt": "The openai-wiles retraction is instructive here. First of all, openai did not formalize the theorem they proved. Probably because it would have required a considerable uplift of Lean's mathlib to get there (or shimming a lot of existing theorems as axioms, which OpenAI did not choose to do). Interestingly, if you shim the well-known theorems, it does not uncover the error in the proofs (tldr there are competing conve", "context": "", "use_case": "", "switched_from": "", "story": "What mathematicians should know about the Lean Theorem Prover: reliability & AI"}, {"id": 800133521, "item_id": 50008345, "url": "https://news.ycombinator.com/item?id=50008345", "by": "mirashii", "date": "2026-10-08", "stance": "warn", "quote": "the Lean formalization of the Riemann Hypothesis in Mathlib was incorrect.", "excerpt": "Here's a recent example of an AI exploiting a soundness hole in Lean in a paper purporting to have solved the Collatz Conjecture. https://leodemoura.github.io/blog/2026-8-1-postmortem-for-kernel-soundness-bug-14576/ There's also a fairly well known incident where the Lean formalization of the Riemann Hypothesis in Mathlib was incorrect.", "context": "", "use_case": "", "switched_from": "", "story": "OpenAI withdraws three mathematical results"}, {"id": 799922576, "item_id": 49995161, "url": "https://news.ycombinator.com/item?id=49995161", "by": "ammar2", "date": "2026-10-07", "stance": "recommend", "quote": "so we can be reasonably confident about their correctness", "excerpt": "That assumes the natural language paper came first and then was formalized in lean. I haven't looked too deeply into how these labs solve these problems (or if they even specify this publicly) but you could also start with lean and then write the natural language proof based on it. For what it's worth the initial lean specifications for the top-level theorems generally come from human written formalizations such as i", "context": "", "use_case": "", "switched_from": "", "story": "Navier\u2013Stokes Lost in Translation"}, {"id": 799811776, "item_id": 49988236, "url": "https://news.ycombinator.com/item?id=49988236", "by": "porcoda", "date": "2026-10-07", "stance": "recommend", "quote": "mathlib (human, expert curated)", "excerpt": "More specifically, a combination of mathlib (human, expert curated) and projects like TauCeti (AI-welcome complement to mathlib). See: https://github.com/TauCetiProject/TauCeti", "context": "", "use_case": "", "switched_from": "", "story": "Sharing AI progress in mathematics"}, {"id": 796121632, "item_id": 49757602, "url": "https://news.ycombinator.com/item?id=49757602", "by": "UltraSane", "date": "2026-09-18", "stance": "neutral", "quote": "And they depend on https://github.com/leanprover-community/mathlib4", "excerpt": "LLMs have gotten good at creating Lean proofs so the are much more common but not universal. And they depend on https://github.com/leanprover-community/mathlib4", "context": "", "use_case": "", "switched_from": "", "story": "Mathematicians Build Long-Awaited Graph Sandwich"}, {"id": 793293840, "item_id": 49580865, "url": "https://news.ycombinator.com/item?id=49580865", "by": "thaumasiotes", "date": "2026-09-05", "stance": "neutral", "quote": "It is in mathlib.", "excerpt": "It is in mathlib. In textbooks it's presented as an introductory part of the Second Isomorphism Theorem; in mathlib it's here: https://leanprover-community.github.io/mathlib4_docs/Mathlib/Algebra/Group/Subgroup/Pointwise.html#Subgroup.coe_mul_of_left_le_normalizer_right . The part of the proof that I quoted just proves that the product set HN is closed under multiplication - the product of any two elements in HN is a", "context": "", "use_case": "", "switched_from": "", "story": "Formalizing Fermat's Last Theorem"}, {"id": 785008129, "item_id": 49063008, "url": "https://news.ycombinator.com/item?id=49063008", "by": "Jhsto", "date": "2026-07-26", "stance": "recommend", "quote": "I generally rather rely on someone else getting the category theory and algebraic structures right", "excerpt": "As a meta-comment on the topic, something I have noticed is that there still exists confusion what it means to use theorem provers for projects -- the other day I read a tweet from Paradigm, a crypto-VC now seemingly AI-pilled. Some LP of theirs had made a Lean 4 formalization of the Ethereum's virtual machine. The tweet said this would have cost like $150k in API tokens (\"would have\", as in, I guess they get theirs ", "context": "uses theorem provers for projects", "use_case": "reusing formalized math", "switched_from": "", "story": "We have proof automation now"}, {"id": 783986976, "item_id": 48999186, "url": "https://news.ycombinator.com/item?id=48999186", "by": "YoshiRulz", "date": "2026-07-21", "stance": "recommend", "quote": "From the article: https://mathlib.org", "excerpt": "From the article: https://mathlib.org Also https://1000-plus.github.io and https://us.metamath.org", "context": "", "use_case": "Formal math library", "switched_from": "", "story": "Human mathematicians are being outcounterexampled"}, {"id": 766791344, "item_id": 47924459, "url": "https://news.ycombinator.com/item?id=47924459", "by": "thaumasiotes", "date": "2026-04-27", "stance": "neutral", "quote": "Mathlib defines `by_contradiction` as a theorem proving `(\u00acp \u2192 False) \u2192 p` for any proposition p.", "excerpt": "Well, at some point you have to define what you mean by \"proof by contradiction\". I was responding to your statement, \"prove something by showing that the alternative is unsound\". You can prove that something is false that way without needing classical logic. Mathlib defines `by_contradiction` as a theorem proving `(\u00acp \u2192 False) \u2192 p` for any proposition p. ( https://leanprover-community.github.io/mathlib4_docs/Mathlib", "context": "", "use_case": "formal math library", "switched_from": "", "story": "\"Why not just use Lean?\""}, {"id": 733986785, "item_id": 45874174, "url": "https://news.ycombinator.com/item?id=45874174", "by": "reuben364", "date": "2025-11-10", "stance": "neutral", "quote": "modulo my unfamiliarity with mathlib", "excerpt": "I'm working on formalizing https://arxiv.org/pdf/2508.18475 (A convex polyhedron without Rupert's property) in Lean4 I'm only on lemma 11 at this point, and up until that point the paper has been fairly easy to formalize (modulo my unfamiliarity with mathlib). The repo is here https://github.com/badly-drawn-wizards/noperthedron", "context": "", "use_case": "", "switched_from": "", "story": "Ask HN: What Are You Working On? (Nov 2025)"}, {"id": 732661362, "item_id": 45791335, "url": "https://news.ycombinator.com/item?id=45791335", "by": "lacker", "date": "2025-11-02", "stance": "recommend", "quote": "Lean's library of mathematics, mathlib, is organized like an open source community with pull requests", "excerpt": "Dependent types are very useful for some things. For example, I wish Python had the ability to express \"a 10 x 5 matrix of float32s\" as a type, and typecheck that. The Curry-Howard correspondence, using dependent type system to have \"proofs\" be equivalent to \"types\", is powerful, but it can be really confusing. From a human point of view, there is a huge difference between \"Your proof is wrong\" and \"You wrote a state", "context": "", "use_case": "", "switched_from": "", "story": "Why don't you use dependent types?"}]}