close

Want to learn and master Lean?

Join Exercism’s Lean Track for access to 100 exercises with automatic analysis of your code and personal mentoring, all 100% free.

About Lean

namespace HelloWorld

inductive World where
    | earth | mars

def hello (world : World) : String :=
    match world with
    | .earth => "Hello, Earth!"
    | .mars  => "Hi, Mars!"

end HelloWorld
Image

100 coding exercises for Lean on Exercism. From Alphametics to Allergies.


Get better at programming through fun, rewarding coding exercises that test your understanding of concepts with Exercism.

See all Lean exercises on ExercismImage
Image

Key Features of Lean


Lean
Image

Purely functional

Deterministic functions make code predictable, composable and easier to understand.

Image

Dependently typed

Encoding rules directly in types makes them self-documenting and invalid states unrepresentable.

Image

Programs and proofs

Write programs and prove them correct in the same language. Specification is code.

Image

Proved correctness

Go beyond testing by mathematically proving critical properties of your code.

Image

Type classes

Categorizing types into classes provides lightweight, extensible abstraction.

Image

Strong metaprogramming

A powerful macro and elaborator framework lets you extend the language to fit your domain.

Image

Get mentored the Lean way

Every language has its own way of doing things. Lean is no different. Our mentors will help you learn to think like a Lean developer and how to write idiomatic code in Lean. Once you've solved an exercise, submit it to our volunteer team, and they'll give you hints, ideas, and feedback on how to make it feel more like what you'd normally see in Lean - they'll help you discover the things you don't know that you don't know.

Learn more about mentoringImage
Image
Image

Community-sourced Lean exercises

The Lean track on Exercism has 100 exercises to help you write better code.

See all Lean exercisesImage
Image
Lean

Get started with the Lean track

The best part, it’s 100% free for everyone.

Join the Lean track