Skip to content
SPECIFICTION
Get listed

Lean vs Why3

Lean

lean-lang.org

Why3

why3.org

Side by side

FigureLeanWhy3
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
WebYesYes
WindowsYesYes
macOSYes—
LinuxYesYes
API—Yes
Self-hosted—Yes
Plans published11
Spec score · Formal Verification Tools8.6 (#2)8.0 (#12)
ExtensibilityLean's metaprogramming capabilities let users add domain-specific notation and proof automation.Why3 can be extended with support for new external provers and used as a software library through its API.
LicenseLean is released under the Apache 2.0 license, which the documentation describes as allowing others to use and extend the code and mathematical libraries freely.TryWhy3 is distributed under the GNU Lesser General Public License version 2.1 with a special linking exception.
SupportThe Lean Community Zulip is described as the central hub for questions and collaboration, and Lean FRO hosts weekly technical office hours.The project provides a user mailing list, a Zulip chat, and a bug tracking system.

Plans

Lean

  • Lean 4Free

Lean pricing →

Why3

  • Why3Free

Why3 pricing →

In their own words

Lean

Lean is an open-source programming language and proof assistant for formalizing mathematics, verifying software, and writing general code. Its minimal trusted kernel checks proofs, and the project describes it as supporting correctness in mathematical, software, and hardware verification. Lean includes the Grind tool for automating some pattern matching, case analysis, and systems of linear inequalities; metaprogramming lets users add notation and proof automation. Projects are managed with Lake, the package manager bundled with Lean. Mathlib is a community-driven library with over a million lines spanning areas including algebra, analysis, topology, probability, and computer science. The recommended setup uses VS Code with the Lean 4 extension for syntax highlighting and code completion, while Neovim with lean.nvim is also well-supported. Lean runs on Linux, macOS, and Windows, and Lean4Web lets users run code in a browser. The software is free under the Apache 2.0 license. Learning resources include textbooks, tutorials, interactive games, documentation, and an API reference.

Visit lean-lang.org

Why3

Why3 is a platform for deductive program verification. It uses WhyML to express programs and specifications, then works with external automated or interactive theorem provers to discharge verification conditions. WhyML supports preconditions, postconditions, assertions, and loop invariants, alongside logical theories and data structures such as arrays, queues, and hash tables. External provers need to be installed and configured separately. Why3 can be extended with support for new provers and used as a software library through its OCaml API. WhyML programs can be extracted automatically into correct-by-construction OCaml programs, and WhyML is also used as an intermediate language for verification of C, Java, Rust, and Ada. TryWhy3 provides a JavaScript version that runs in a browser. Installation options include Opam, Docker, source compilation, and listed Debian, Fedora, and Ubuntu packages. Its graphical interface saves proof attempts and transformations in an XML file and can replay obsolete attempts. Why3 is free and open source under GNU LGPL 2.1 with a special linking exception. Loop invariant inference is a work in progress, and many features remain very limited.

Visit why3.org