HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
leanprover-community
mathlib4
Lean2023–2026
leanprover-community / mathlib4

mathlib4

The math library of Lean 4

18Distinct people
20Mentions
1Explicit recommenders
4.5KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

The math library of Lean 4

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

I may have been spending too much time with Lean recently, but the number one thing I’d like to see for the future of TLA+ is an equivalent of Mathlib…

mjb used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 12:54:37 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year20 dated mentions

Observed mentions: 2023-09-08 09:05:46 UTC to 2026-10-07 16:34:54 UTC.

024682023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 8 mentions; 0 submissions, 8 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments20242025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC808
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC505
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC514
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC202

What Hacker News says

20 sources
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 in https://github.com/leanprover-community/mathlib4/blob/021ce6... so we can be reasonably confident about their correctness.
In Navier–Stokes Lost in Translation
What propositions cannot be written this way? If your answer is along the lines of "things that use the axiom of choice" or "things that use LEM", then you can instead prove `AC -> P` or `LEM -> P`, which are constructible (assuming no similar missing "magic" axioms, but those can be solved with the same technique). Then we can again look at programming where we have the Reader monad as a way to pretend `AC -> P` is just `P` and use it as if it were (but with the ability to pull `AC` out of a hat when needed). Arguably then, we can only prove `AC -> P` and not `P` itself because `P` is not true (obviously that's a controversial take). I don't know what strategies they're using, but mathlib in Lean has formalizations for measure theory for example: https://github.com/leanprover-community/mathlib4/blob/master... For very practical programmi
Read the rest
ng work (like business software), I'd be surprised if there were any useful programs that can't be boiled down to `while True: f(x)` where f(x) is some finite terminating program that you can prove stuff about. When you do a bunch of work in a language/ecosystem like Scala's, you get used to the idea that if your function says it returns an A, then it returns an A; there's generally no failure modes to consider if they're not in the type (ignoring realities like a datacenter catching on fire that are outside of the programming model). Passing a B to a `Function[B,A]` is an actual proof that you now have an `A` in your hand.
In A proof checker meant for education
> shouldn't proof checkers have a database of theorems and be able to fill in the intermediate steps or confirm that it's possible to fill in the missing steps? This is essentially exactly what Mathlib[1] is, which is Lean's database of mathematics, and which large portions of the FLT project will likely continually contribute into. [1]: https://github.com/leanprover-community/mathlib4/ (Other theorem provers have similar libraries, e.g. Coq's is called math-comp: https://math-comp.github.io/ )
In Fermat's Last Theorem – how it’s going
mjb·Aug 28, 2024Recommendation phrase
I may have been spending too much time with Lean recently, but the number one thing I’d like to see for the future of TLA+ is an equivalent of Mathlib (https://github.com/leanprover-community/mathlib4). What’s so great about the experience of using Lean is that I can pull theorems off the shelf from Mathlib, use them if I want to, or learn from the way their proofs work if I want to do something similar. > The reason for using TLA+ is that it isn’t a programming language; it’s mathematics. I love TLA+, I’ve used it for a decade and reach for it often. I have a huge amount of respect for Leslie Lamport and Chris Newcombe. But I think they’re missing something major here. The sematics of TLA+ are, in my mind, a great set of choices for a whole wide range of systems work. The syntax, on the other hand, is fairly obscure and complex, and make
Read the rest
s it harder to learn the language (and, in particular, translate other ways of expressing mathematics into TLA+). I would love to see somebody who thinks deeply about PL syntax to make another language with the same semantics as TLA+, the same goals of looking like mathematics, but more familiar syntax. I don’t know what that would look like, but I’d love to see it. It seems like with the right library (see my mathlib point) and syntax, writing a TLA+ program should be no harder than writing a P program for the same behavior, but that’s not where we are right now. > The errors [types] catch are almost always quickly found by model checking. This hasn’t been my experience, and in fact a lot of the TLA+ programs I see contain partial implementations of arbitrary type checkers. I don’t think TLA+ needs a type system like Coq’s or Lean’s or Haskell’s, but I do think that some level of type enforcement would help avoid whole classes of common specification bugs (or even auto-generation of a type checking specification, which may be the way to go). > [A Coq-like type system] would put TLA+ beyond the ability of so many potential users that no proposal to add them should be taken seriously. I do think this is right, though. > This may turn out to be unnecessary if provers become smarter, which should be possible with the use of AI. Almost definitely will. This just seems like a no-brainer to bet on at this stage. See AlphaProof, moogle.ai, and many other similar examples. > A Unicode representation that can be automatically converted to the ascii version is the best alternative for now. Yes, please! Lean has a unicode representation, along with a nice UI for adding the Unicode operators in VSCode, and it’s awesome. The ASCII encoding is still something I trip over in TLA+, even after a decade of using it.
In The Future of TLA+ [pdf]
I am not aware of any good one, but I realized you could probably mechanically extract such a map from Lean's mathlib[0][1]. Since Lean builds everything from scratch, this should be doable, albeit Lean builds everything on top of type theory which is not the only choice possible. Different foundations will result in a different graph. Also the best way to learn math is probably not by following this sort of graph, it would be far too abstract and disconnected from both the real world and usual practical applications. [0] https://leanprover-community.github.io/mathlib4_docs/ [1] https://github.com/leanprover-community/mathlib4
In How to choose a textbook that is optimal for oneself?
We essentially implemented this matrix version in Lean/mathlib to both compute the fibonacci number and generate an efficient proof for the calculation. https://github.com/leanprover-community/mathlib4/blob/master... In practice this isn't very useful (the definition of Nat.fib unfolds quick enough and concrete large fibonacci numbers don't often appear in proofs) but still it shaves a bit of time off the calculation and the proof verification.
In A linear algebra trick for computing Fibonacci numbers fast
https://en.wikipedia.org/wiki/Zermelo%E2%80%93Fraenkel_set_t... : > Today, Zermelo–Fraenkel set theory [ZFC], with the historically controversial axiom of choice (AC) included, is the standard form of axiomatic set theory and as such is the most common foundation of mathematics. Foundation of mathematics: https://en.wikipedia.org/wiki/Foundations_of_mathematics Implementation of mathematics in set theory: https://en.wikipedia.org/wiki/Implementation_of_mathematics_... : > The implementation of a number of basic mathematical concepts is carried out in parallel in ZFC (the dominant set theory) and in NFU, the version of Quine's New Foundations shown to be consistent by R. B. Jensen in 1969 (here understood to include at least axioms of Infinity and Choice). > What is said here applies also to two families of set theories: on the one hand, a
Read the rest
range of theories including Zermelo set theory near the lower end of the scale and going up to ZFC extended with large cardinal hypotheses such as "there is a measurable cardinal"; and on the other hand a hierarchy of extensions of NFU which is surveyed in the New Foundations article. These correspond to different general views of what the set-theoretical universe is like IEEE-754 specifies that float64s have ±infinity and specify ZeroDivisionError. Symbolic CAS with MPFR needn't be limited to float64s. HoTT in CoQ: Coq-HoTT: https://github.com/HoTT/Coq-HoTT What is the relation between Coq-HoTT & Homotopy Type Theory and Set Theory with e.g. ZFC? Homotopy Type Theory: https://en.wikipedia.org/wiki/Homotopy_type_theory : > "Cartesian Cubical Computational Type Theory: Constructive Reasoning with Paths and Equalities" (2018) https://scholar.google.com/scholar?cites=9763697449338277760... and sorted by date: https://scholar.google.com/scholar?hl=en&as_sdt=5,43&sciodt=... What does Mathlib have for SetTheory, ZFC, NFU, and HoTT? leanprover-community/mathlib4// Mathlib/SetTheory: https://github.com/leanprover-community/mathlib4/tree/master...
In What do we mean by "the foundations of mathematics"?

Showing the 15 most recent of 20 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.